diff --git a/scripts/status_check.py b/scripts/status_check.py index 253bb71..3eeeaba 100644 --- a/scripts/status_check.py +++ b/scripts/status_check.py @@ -10,7 +10,7 @@ from google_play_scraper.exceptions import GooglePlayScraperException from src.exceptions import APKMirrorScrapperFailure from src.patches import Patches -from src.utils import handle_response +from src.utils import handle_github_response not_found_icon = "https://img.icons8.com/bubbles/500/android-os.png" headers = { @@ -105,7 +105,7 @@ def generate_markdown_table(data: List[List[str]]) -> str: def main() -> None: repo_url = "https://api.revanced.app/v2/patches/latest" response = requests.get(repo_url) - handle_response(response) + handle_github_response(response) parsed_data = response.json() compatible_packages = parsed_data["patches"] diff --git a/src/downloader/download.py b/src/downloader/download.py index 4f40a71..c0e560b 100644 --- a/src/downloader/download.py +++ b/src/downloader/download.py @@ -12,7 +12,7 @@ from src.config import RevancedConfig from src.downloader.utils import implement_method from src.exceptions import PatchingFailed from src.patches import Patches -from src.utils import handle_response +from src.utils import handle_github_response class Downloader(object): @@ -54,7 +54,7 @@ class Downloader(object): stream=True, headers=headers, ) - handle_response(response) + handle_github_response(response) total = int(response.headers.get("content-length", 0)) bar = tqdm( desc=file_name, diff --git a/src/downloader/github.py b/src/downloader/github.py index 30e494a..fb8a014 100644 --- a/src/downloader/github.py +++ b/src/downloader/github.py @@ -8,7 +8,7 @@ from loguru import logger from src.config import RevancedConfig from src.downloader.download import Downloader -from src.utils import handle_response, update_changelog +from src.utils import handle_github_response, update_changelog class Github(Downloader): @@ -35,7 +35,7 @@ class Github(Downloader): logger.debug("Using personal access token") headers["Authorization"] = f"token {self.config.personal_access_token}" response = requests.get(repo_url, headers=headers) - handle_response(response) + handle_github_response(response) if repo_name == "revanced-patches": download_url = response.json()["assets"][1]["browser_download_url"] else: @@ -78,7 +78,7 @@ class Github(Downloader): if config.personal_access_token: headers["Authorization"] = f"token {config.personal_access_token}" response = requests.get(api_url, headers=headers) - handle_response(response) + handle_github_response(response) assets = response.json()["assets"] try: filter_pattern = re.compile(asset_filter) diff --git a/src/utils.py b/src/utils.py index d72b837..46248c5 100644 --- a/src/utils.py +++ b/src/utils.py @@ -40,7 +40,7 @@ def update_changelog(name: str, response: Dict[str, str]) -> None: file1.write(change_log) -def handle_response(response: Response) -> None: +def handle_github_response(response: Response) -> None: """Handle Get Request Response.""" response_code = response.status_code if response_code != 200: