fix bug
This commit is contained in:
parent
9b917cd4c2
commit
f51c4ebed7
@ -132,7 +132,9 @@ class PluginHelper(metaclass=Singleton):
|
|||||||
"""
|
"""
|
||||||
file_api = f"https://api.github.com/repos/{user}/{repo}/contents/plugins/{_p.lower()}"
|
file_api = f"https://api.github.com/repos/{user}/{repo}/contents/plugins/{_p.lower()}"
|
||||||
r = RequestUtils(proxies=settings.PROXY, headers=settings.GITHUB_HEADERS, timeout=30).get_res(file_api)
|
r = RequestUtils(proxies=settings.PROXY, headers=settings.GITHUB_HEADERS, timeout=30).get_res(file_api)
|
||||||
if not r or r.status_code != 200:
|
if r is None:
|
||||||
|
return None, "连接仓库失败"
|
||||||
|
elif r.status_code != 200:
|
||||||
return None, f"连接仓库失败:{r.status_code} - {r.reason}"
|
return None, f"连接仓库失败:{r.status_code} - {r.reason}"
|
||||||
ret = r.json()
|
ret = r.json()
|
||||||
if ret and ret[0].get("message") == "Not Found":
|
if ret and ret[0].get("message") == "Not Found":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user