fix: Use the new api

This commit is contained in:
Sayantan Santra 2023-08-28 13:38:16 -05:00
parent 3fa866b90e
commit 2890da4f76
Signed by: SinTan1729
GPG Key ID: EB3E68BFBA25C85F
2 changed files with 5 additions and 2 deletions

View File

@ -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)

View File

@ -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)