Skip to content

Commit

Permalink
fix: Magisk Alpha not downloaded correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
YT-Advanced authored Mar 19, 2024
1 parent d77f906 commit 2162dc6
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions scripts/generateMagiskLink.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,22 @@ def __call__(self, r):
magisk_ver = "stable"

if magisk_branch == "vvb2060":
magisk_ver = "alpha"

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/{magisk_branch}/magisk-files/raw/master/{magisk_ver}.json").content)['magisk']['link']
f"https://install.appcenter.ms/api/v0.1/apps/vvb2060/magisk/distribution_groups/public/releases/latest?is_install_page=true", headers=headers).content)['download_url']
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']
download_files[f"magisk-{magisk_ver}.zip"] = magisk_link
print("Failed to fetch from AppCenter API...")
else:
try:
magisk_link = json.loads(requests.get(
f"https://install.appcenter.ms/api/v0.1/apps/vvb2060/magisk/distribution_groups/public/releases/latest?is_install_page=true", headers=headers).content)['download_url']
f"https://github.com/{magisk_branch}/magisk-files/raw/master/{magisk_ver}.json").content)['magisk']['link']
download_files[f"magisk-{magisk_ver}.zip"] = magisk_link
except Exception:
print("Failed to fetch from AppCenter API...")

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']
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)
json_data = json.loads(res.content)
Expand Down

0 comments on commit 2162dc6

Please sign in to comment.