From 2890da4f764ed5b8ddbde96f20a7b853143753ea Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Mon, 28 Aug 2023 13:38:16 -0500 Subject: [PATCH] fix: Use the new api --- src/ReVancedBuilder/APKPure_dl.py | 3 ++- src/ReVancedBuilder/ReVancedBuilder.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ReVancedBuilder/APKPure_dl.py b/src/ReVancedBuilder/APKPure_dl.py index 90d910f..9cc4e88 100644 --- a/src/ReVancedBuilder/APKPure_dl.py +++ b/src/ReVancedBuilder/APKPure_dl.py @@ -71,7 +71,8 @@ def get_apks(appstate): # Get latest patches using the ReVanced API try: - patches = req.get('https://releases.revanced.app/patches').json() + patches_json = next(filter(lambda x: x['repository'] == 'revanced/revanced-patches', appstate['tools'])) # Get the first result + patches = req.get(patches_json['browser_download_url']).json() except req.exceptions.RequestException as e: err_exit(f"Error fetching patches, {e}", appstate) diff --git a/src/ReVancedBuilder/ReVancedBuilder.py b/src/ReVancedBuilder/ReVancedBuilder.py index f588738..ff0a7d1 100755 --- a/src/ReVancedBuilder/ReVancedBuilder.py +++ b/src/ReVancedBuilder/ReVancedBuilder.py @@ -23,6 +23,7 @@ from ReVancedBuilder.Cleanup import move_apps, err_exit def update_tools(appstate): for item in ['revanced-cli', 'revanced-integrations', 'revanced-patches']: print(f"Checking updates for {item}...") + tools = appstate['tools'] *_, tool = filter(lambda x: x['repository'] == 'revanced/'+item, tools) # Get the last result latest_ver = Version(tool['version']) @@ -146,7 +147,8 @@ appstate['notification_config'].read('notification_config') # Pull the latest information using the ReVanced API try: - tools = req.get('https://releases.revanced.app/tools').json()['tools'] + tools = req.get('https://api.revanced.app/tools').json()['tools'] + appstate['tools'] = tools except req.exceptions.RequestException as e: err_exit(f"Error fetching patch list, {e}", appstate)