mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-25 03:48:37 +09:00
🎨 Merge APKM bundles to get apk for patching (#297)
This commit is contained in:
@@ -15,7 +15,7 @@ from src.utils import handle_github_response, update_changelog
|
||||
class Github(Downloader):
|
||||
"""Files downloader."""
|
||||
|
||||
def latest_version(self, app: str, **kwargs: Dict[str, str]) -> None:
|
||||
def latest_version(self, app: str, **kwargs: Dict[str, str]) -> str:
|
||||
"""Function to download files from GitHub repositories.
|
||||
|
||||
:param app: App to download
|
||||
@@ -25,7 +25,7 @@ class Github(Downloader):
|
||||
logger.debug(
|
||||
f"Skipping download of {app}. File already exists or dry running."
|
||||
)
|
||||
return
|
||||
return app
|
||||
owner = str(kwargs["owner"])
|
||||
repo_name = str(kwargs["name"])
|
||||
repo_url = f"https://api.github.com/repos/{owner}/{repo_name}/releases/latest"
|
||||
@@ -35,7 +35,7 @@ class Github(Downloader):
|
||||
if self.config.personal_access_token:
|
||||
logger.debug("Using personal access token")
|
||||
headers["Authorization"] = f"token {self.config.personal_access_token}"
|
||||
response = requests.get(repo_url, headers=headers)
|
||||
response = requests.get(repo_url, headers=headers, timeout=60)
|
||||
handle_github_response(response)
|
||||
if repo_name == "revanced-patches":
|
||||
download_url = response.json()["assets"][1]["browser_download_url"]
|
||||
@@ -43,6 +43,7 @@ class Github(Downloader):
|
||||
download_url = response.json()["assets"][0]["browser_download_url"]
|
||||
update_changelog(f"{owner}/{repo_name}", response.json())
|
||||
self._download(download_url, file_name=app)
|
||||
return app
|
||||
|
||||
@staticmethod
|
||||
def _extract_repo_owner_and_tag(url: str) -> Tuple[str, str, str]:
|
||||
@@ -78,7 +79,7 @@ class Github(Downloader):
|
||||
}
|
||||
if config.personal_access_token:
|
||||
headers["Authorization"] = f"token {config.personal_access_token}"
|
||||
response = requests.get(api_url, headers=headers)
|
||||
response = requests.get(api_url, headers=headers, timeout=60)
|
||||
handle_github_response(response)
|
||||
assets = response.json()["assets"]
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user