Update generateMagiskLink.py

This commit is contained in:
Peter Njeim 2022-12-09 22:28:29 -04:00 committed by GitHub
parent 60a2ad0efc
commit db06eb0eda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,7 @@ if magisk_ver == "stable" or magisk_ver == "beta" or magisk_ver == "canary" or m
f"https://github.com/topjohnwu/magisk-files/raw/master/{magisk_ver}.json").content)['magisk']['link'] f"https://github.com/topjohnwu/magisk-files/raw/master/{magisk_ver}.json").content)['magisk']['link']
magisk_version = json.loads(requests.get( magisk_version = json.loads(requests.get(
f"https://github.com/topjohnwu/magisk-files/raw/master/{magisk_ver}.json").content)['magisk']['version'] f"https://github.com/topjohnwu/magisk-files/raw/master/{magisk_ver}.json").content)['magisk']['version']
with open(os.environ['WSA_WORK_ENV'], 'a') as environ_file: with open(os.environ['GITHUB_ENV'], 'a') as environ_file:
environ_file.write(f'MAGISK_VERSION={magisk_version}\n') environ_file.write(f'MAGISK_VERSION={magisk_version}\n')
except Exception: except Exception:
print("Failed to fetch from GitHub API, fallbacking to jsdelivr...") print("Failed to fetch from GitHub API, fallbacking to jsdelivr...")
@ -45,7 +45,7 @@ if magisk_ver == "stable" or magisk_ver == "beta" or magisk_ver == "canary" or m
f"https://fastly.jsdelivr.net/gh/topjohnwu/magisk-files@master/{magisk_ver}.json").content)['magisk']['link'] f"https://fastly.jsdelivr.net/gh/topjohnwu/magisk-files@master/{magisk_ver}.json").content)['magisk']['link']
magisk_version = json.loads(requests.get( magisk_version = json.loads(requests.get(
f"https://fastly.jsdelivr.net/gh/topjohnwu/magisk-files@master/{magisk_ver}.json").content)['magisk']['version'] f"https://fastly.jsdelivr.net/gh/topjohnwu/magisk-files@master/{magisk_ver}.json").content)['magisk']['version']
with open(os.environ['WSA_WORK_ENV'], 'a') as environ_file: with open(os.environ['GITHUB_ENV'], 'a') as environ_file:
environ_file.write(f'MAGISK_VERSION={magisk_version}\n') environ_file.write(f'MAGISK_VERSION={magisk_version}\n')
print(f"download link: {magisk_link}", flush=True) print(f"download link: {magisk_link}", flush=True)