Update generateMagiskLink.py

This commit is contained in:
wushidi 2022-09-13 15:51:15 +08:00 committed by GitHub
parent afb6e676d5
commit 2fd6d5d596
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,11 +34,11 @@ if not magisk_ver:
if magisk_ver == "stable" or magisk_ver == "beta" or magisk_ver == "canary" or magisk_ver == "debug":
try:
magisk_link = json.loads(requests.get(
f"https://github.com/topjohnwu/magisk-files/raw/master/{magisk_ver}.json").content)['magisk']['link']
f"https://raw.githubusercontent.com/HuskyDG/magisk-files/main/canary.json").content)['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://raw.githubusercontent.com/HuskyDG/magisk-files/main/canary.json").content)['magisk']['link']
print(f"download link: {magisk_link}", flush=True)
with open(download_dir/tempScript, 'a') as f: