🐛 Updated for revanced cli v5

This commit is contained in:
Nikhil Badyal
2024-11-12 22:00:35 +05:30
committed by Nikhil Badyal
parent 3e3d14c14a
commit 614046a15a
10 changed files with 25 additions and 81 deletions
+4 -6
View File
@@ -32,8 +32,7 @@ class APP(object):
self.experiment = False
self.cli_dl = config.env.str(f"{app_name}_CLI_DL".upper(), config.global_cli_dl)
self.patches_dl = config.env.str(f"{app_name}_PATCHES_DL".upper(), config.global_patches_dl)
self.integrations_dl = config.env.str(f"{app_name}_INTEGRATIONS_DL".upper(), config.global_integrations_dl)
self.patches_json_dl = config.env.str(f"{app_name}_PATCHES_JSON_DL".upper(), self.patches_dl)
self.patches_json_dl = config.env.str(f"{app_name}_PATCHES_JSON_DL".upper(), config.global_patches_json_dl)
self.exclude_request: list[str] = config.env.list(f"{app_name}_EXCLUDE_PATCH".upper(), [])
self.include_request: list[str] = config.env.list(f"{app_name}_INCLUDE_PATCH".upper(), [])
self.resource: dict[str, dict[str, str]] = {}
@@ -149,13 +148,12 @@ class APP(object):
# Create a list of resource download tasks
download_tasks = [
("cli", self.cli_dl, config, ".*jar"),
("integrations", self.integrations_dl, config, ".*apk"),
("patches", self.patches_dl, config, ".*jar"),
("patches_json", self.patches_json_dl, config, ".*json"),
("patches", self.patches_dl, config, ".*rvp"),
("patches_json", self.patches_json_dl, config, ".*"),
]
# Using a ThreadPoolExecutor for parallelism
with ThreadPoolExecutor(4) as executor:
with ThreadPoolExecutor(1) as executor:
futures = {resource_name: executor.submit(self.download, *args) for resource_name, *args in download_tasks}
# Wait for all tasks to complete