mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-25 03:48:37 +09:00
🎨 Updated function name
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
+1
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user