Update generateMagiskLink.py

This commit is contained in:
MustardChef 2024-07-14 13:59:15 +01:00 committed by GitHub
parent a26b32e8cb
commit 53f02b6776
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,12 +67,12 @@ if magisk_branch == "vvb2060":
else:
try:
magisk_link = json.loads(requests.get(
f"https://github.com/{magisk_branch}/magisk-files/raw/master/{magisk_ver}.json").content)['magisk']['link']
f"https://raw.githubusercontent.com/{magisk_branch}/magisk-files/master/{magisk_ver}.json").content)['magisk']['link']
download_files[f"magisk-{magisk_ver}.zip"] = magisk_link
except Exception:
print("Failed to fetch from GitHub API, fallbacking to jsdelivr...")
magisk_link = json.loads(requests.get(
f"https://fastly.jsdelivr.net/gh/topjohnwu/magisk-files@master/{magisk_ver}.json").content)['magisk']['link']
f"https://fastly.jsdelivr.net/gh/{magisk_branch}/magisk-files@master/{magisk_ver}.json").content)['magisk']['link']
download_files[f"magisk-{magisk_ver}.zip"] = magisk_link
res = requests.get(
f"https://api.github.com/repos/LSPosed/WSA-Addon/releases/latest", auth=github_auth)