mirror of
https://github.com/varunsridharan/github-gitea-mirror.git
synced 2024-08-17 13:51:15 +03:00
Added TryCache Handler for all.
This commit is contained in:
parent
66707f7ea1
commit
7d243e02ba
18
CHANGELOG.md
18
CHANGELOG.md
@ -19,5 +19,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
|
||||
### Security
|
||||
-->
|
||||
|
||||
## 1.1 - 25/10/2020
|
||||
* Due to `ytdl-org/youtube-dl` **DCMAed** i was able to understand the error & fix it.
|
||||
```y
|
||||
Traceback (most recent call last):
|
||||
File "./mirror-handler/repoStared.py", line 14, in <module>
|
||||
repositoryStared()
|
||||
File "/github/workspace/mirror-handler/src/repositoryStared.py", line 39, in repositoryStared
|
||||
topics = repo.get_topics()
|
||||
File "/usr/lib/python3.8/site-packages/github/Repository.py", line 2982, in get_topics
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
File "/usr/lib/python3.8/site-packages/github/Requester.py", line 317, in requestJsonAndCheck
|
||||
return self.__check(
|
||||
File "/usr/lib/python3.8/site-packages/github/Requester.py", line 342, in __check
|
||||
raise self.__createException(status, responseHeaders, output)
|
||||
github.GithubException.GithubException: 451 {"message": "Repository access blocked", "block": {"reason": "dmca", "created_at": "2020-10-23T19:13:29Z", "html_url": "https://github.com/github/dmca/blob/master/2020/10/2020-10-23-RIAA.md"}}
|
||||
```
|
||||
|
||||
## 1.0 - 12/10/2020
|
||||
**First Release**
|
||||
|
@ -1,13 +1,13 @@
|
||||
{
|
||||
"github" : {
|
||||
"username" : "",
|
||||
"accesstoken" : ""
|
||||
"username" : "varunsridharan",
|
||||
"accesstoken" : "216eea386ac155d4a651daf21707fad5c5e89852"
|
||||
},
|
||||
"gitea" : {
|
||||
"host" : "",
|
||||
"accesstoken" : "",
|
||||
"username" : "",
|
||||
"default_userpassword" : "RY7VpBD62P7964c9$mSz%2GAM82hv68yUbHc4@Gdw8c%f^W3*qdzo$f*8a6b^rKy",
|
||||
"host" : "http://64.225.86.99",
|
||||
"accesstoken" : "1695801a477a4c3e2c8e682eb5dc60fb41726d55",
|
||||
"username" : "varunsridharan",
|
||||
"default_userpassword" : "RY7VpBD62P7964c4c3e2c8e$mSz%2GAM82hv68yUbHc4@Gdw8c%f^W3*qd4c3e2c8ef*8a6b^rKy",
|
||||
"gist" : {
|
||||
"prefix" : "gist",
|
||||
"surfix" : ""
|
||||
@ -19,4 +19,4 @@
|
||||
"repositoryStared" : true,
|
||||
"repositorySource" : true,
|
||||
"repositoryForked" : true
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
# https://github.com/PyGithub/PyGithub
|
||||
from helper import log,getConfig,giteaCreateUserOrOrg, giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser
|
||||
from github import GithubException
|
||||
|
||||
def gistsSource():
|
||||
config = getConfig()
|
||||
@ -50,14 +51,19 @@ def gistsSource():
|
||||
status = giteaCreateRepo(m,isPrivate)
|
||||
|
||||
if status != 'failed':
|
||||
topics = ['gist','{0}-gist'.format(repo_owner)]
|
||||
if isPrivate:
|
||||
topics.append('secret-gist')
|
||||
topics.append('secret-{0}-gist'.format(repo_owner))
|
||||
else:
|
||||
topics.append('public-gist')
|
||||
topics.append('public-{0}-gist'.format(repo_owner))
|
||||
giteaSetRepoTopics(repo_owner,m["repo_name"],topics)
|
||||
try:
|
||||
topics = ['gist','{0}-gist'.format(repo_owner)]
|
||||
if isPrivate:
|
||||
topics.append('secret-gist')
|
||||
topics.append('secret-{0}-gist'.format(repo_owner))
|
||||
else:
|
||||
topics.append('public-gist')
|
||||
topics.append('public-{0}-gist'.format(repo_owner))
|
||||
giteaSetRepoTopics(repo_owner,m["repo_name"],topics)
|
||||
except GithubException as e:
|
||||
print("###[error] ---> Github API Error Occured !")
|
||||
print(e)
|
||||
print(" ")
|
||||
|
||||
if status == 'failed':
|
||||
log(repo)
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
# https://github.com/PyGithub/PyGithub
|
||||
from helper import log,getConfig,giteaCreateUserOrOrg,giteaSetRepoStar, giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser
|
||||
from github import GithubException
|
||||
|
||||
def gistsStared():
|
||||
config = getConfig()
|
||||
@ -50,16 +51,20 @@ def gistsStared():
|
||||
status = giteaCreateRepo(m,isPrivate)
|
||||
|
||||
if status != 'failed':
|
||||
topics = ['gist','{0}-gist'.format(repo_owner),'gist-stared','{0}-stared-gist'.format(repo_owner)]
|
||||
if isPrivate:
|
||||
topics.append('secret-gist')
|
||||
topics.append('secret-{0}-gist'.format(repo_owner))
|
||||
else:
|
||||
topics.append('public-gist')
|
||||
topics.append('public-{0}-gist'.format(repo_owner))
|
||||
giteaSetRepoTopics(repo_owner,m["repo_name"],topics)
|
||||
giteaSetRepoStar(repo_owner,m["repo_name"])
|
||||
|
||||
try:
|
||||
topics = ['gist','{0}-gist'.format(repo_owner),'gist-stared','{0}-stared-gist'.format(repo_owner)]
|
||||
if isPrivate:
|
||||
topics.append('secret-gist')
|
||||
topics.append('secret-{0}-gist'.format(repo_owner))
|
||||
else:
|
||||
topics.append('public-gist')
|
||||
topics.append('public-{0}-gist'.format(repo_owner))
|
||||
giteaSetRepoTopics(repo_owner,m["repo_name"],topics)
|
||||
giteaSetRepoStar(repo_owner,m["repo_name"])
|
||||
except GithubException as e:
|
||||
print("###[error] ---> Github API Error Occured !")
|
||||
print(e)
|
||||
print(" ")
|
||||
if status == 'failed':
|
||||
log(repo)
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
# https://github.com/PyGithub/PyGithub
|
||||
from helper import log,getConfig,giteaCreateUserOrOrg,giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser,config
|
||||
from github import GithubException
|
||||
|
||||
def repositoryForked():
|
||||
config = getConfig()
|
||||
@ -37,10 +38,15 @@ def repositoryForked():
|
||||
|
||||
status = giteaCreateRepo(m,repo.private)
|
||||
if status != 'failed':
|
||||
topics = repo.get_topics()
|
||||
topics.append('forked-repo')
|
||||
topics.append('forked-{0}-repo'.format(repo_owner))
|
||||
giteaSetRepoTopics(repo_owner,repo_name,topics)
|
||||
try:
|
||||
topics = repo.get_topics()
|
||||
topics.append('forked-repo')
|
||||
topics.append('forked-{0}-repo'.format(repo_owner))
|
||||
giteaSetRepoTopics(repo_owner,repo_name,topics)
|
||||
except GithubException as e:
|
||||
print("###[error] ---> Github API Error Occured !")
|
||||
print(e)
|
||||
print(" ")
|
||||
else:
|
||||
log(repo)
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
# https://github.com/PyGithub/PyGithub
|
||||
from helper import log,getConfig,giteaCreateUserOrOrg,giteaSetRepoTopics,giteaSession,giteaCreateRepo,ghApi,giteaCreateOrg,giteaGetUser,config
|
||||
from github import GithubException
|
||||
|
||||
def repositorySource():
|
||||
config = getConfig()
|
||||
@ -37,8 +38,13 @@ def repositorySource():
|
||||
|
||||
status = giteaCreateRepo(m,repo.private)
|
||||
if status != 'failed':
|
||||
topics = repo.get_topics()
|
||||
giteaSetRepoTopics(repo_owner,repo_name,topics)
|
||||
try:
|
||||
topics = repo.get_topics()
|
||||
giteaSetRepoTopics(repo_owner,repo_name,topics)
|
||||
except GithubException as e:
|
||||
print("###[error] ---> Github API Error Occured !")
|
||||
print(e)
|
||||
print(" ")
|
||||
else:
|
||||
log(repo)
|
||||
|
||||
|
@ -44,7 +44,7 @@ def repositoryStared():
|
||||
giteaSetRepoTopics(repo_owner,repo_name,topics)
|
||||
giteaSetRepoStar(repo_owner,repo_name)
|
||||
except GithubException as e:
|
||||
print("###[error] ---> Github API Error Occured !")
|
||||
print("###[error] ---> Github API Error Occured !")
|
||||
print(e)
|
||||
print(" ")
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user