feat 增加GITHUB_TOKEN,提高API限流阈值
This commit is contained in:
@ -163,7 +163,13 @@ def latest_version(_: schemas.TokenPayload = Depends(verify_token)):
|
||||
"""
|
||||
查询Github所有Release版本
|
||||
"""
|
||||
version_res = RequestUtils().get_res(f"https://api.github.com/repos/jxxghp/MoviePilot/releases")
|
||||
headers = {}
|
||||
if settings.GITHUB_TOKEN:
|
||||
headers = {
|
||||
"Authorization": f"Bearer {settings.GITHUB_TOKEN}"
|
||||
}
|
||||
version_res = RequestUtils(proxies=settings.PROXY, headers=headers).get_res(
|
||||
f"https://api.github.com/repos/jxxghp/MoviePilot/releases")
|
||||
if version_res:
|
||||
ver_json = version_res.json()
|
||||
if ver_json:
|
||||
|
Reference in New Issue
Block a user