mirror of
https://github.com/SinTan1729/ReVancedBuilder.git
synced 2024-12-25 20:28:37 -06:00
fix: Some other places still need requests
This commit is contained in:
parent
6cbe6454a3
commit
f4cd430e9d
2 changed files with 6 additions and 7 deletions
|
@ -11,7 +11,7 @@ requires-python = ">=3.6"
|
||||||
keywords = ["revanced", "patch"]
|
keywords = ["revanced", "patch"]
|
||||||
license = { file = "LICENSE" }
|
license = { file = "LICENSE" }
|
||||||
classifiers = ["Programming Language :: Python :: 3"]
|
classifiers = ["Programming Language :: Python :: 3"]
|
||||||
dependencies = ["cloudscraper", "packaging", "bs4"]
|
dependencies = ["cloudscraper", "requests", "packaging", "bs4"]
|
||||||
version = "1.2"
|
version = "1.2"
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-only
|
# SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
import json
|
|
||||||
|
|
||||||
from packaging.version import Version
|
from packaging.version import Version
|
||||||
import cloudscraper as scraper
|
import cloudscraper as scraper
|
||||||
|
@ -90,17 +88,18 @@ def get_apks(appstate):
|
||||||
|
|
||||||
print('Downloading required apk files from APKPure...')
|
print('Downloading required apk files from APKPure...')
|
||||||
|
|
||||||
|
# Create a cloudscraper session
|
||||||
|
session = scraper.create_scraper()
|
||||||
|
|
||||||
# Get latest patches using the ReVanced API
|
# Get latest patches using the ReVanced API
|
||||||
try:
|
try:
|
||||||
# Get the first result
|
# Get the first result
|
||||||
patches_json = next(filter(
|
patches_json = next(filter(
|
||||||
lambda x: x['repository'] == 'revanced/revanced-patches', appstate['tools']))
|
lambda x: x['repository'] == 'revanced/revanced-patches', appstate['tools']))
|
||||||
patches = req.get(patches_json['browser_download_url']).json()
|
patches = session.get(patches_json['browser_download_url']).json()
|
||||||
except req.exceptions.RequestException as e:
|
except session.exceptions.RequestException as e:
|
||||||
err_exit(f"Error fetching patches, {e}", appstate)
|
err_exit(f"Error fetching patches, {e}", appstate)
|
||||||
|
|
||||||
session = scraper.create_scraper()
|
|
||||||
|
|
||||||
for app in build_config:
|
for app in build_config:
|
||||||
# Check if we need to build an app
|
# Check if we need to build an app
|
||||||
if not build_config[app].getboolean('build'):
|
if not build_config[app].getboolean('build'):
|
||||||
|
|
Loading…
Reference in a new issue