Fix some strings

This commit is contained in:
Syuugo 2022-08-25 18:46:37 +09:00 committed by GitHub
parent 5c59ac539c
commit 3fb9ef1e77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,7 @@ arch = sys.argv[1]
variant = sys.argv[2] variant = sys.argv[2]
download_dir = Path.cwd().parent / "download" if sys.argv[3] == "" else Path(sys.argv[3]).resolve() download_dir = Path.cwd().parent / "download" if sys.argv[3] == "" else Path(sys.argv[3]).resolve()
tempScript = sys.argv[4] tempScript = sys.argv[4]
print(f"Generating OpenGapps download link: arch={arch} variant={variant}", flush=True) print(f"Generating OpenGApps download link: arch={arch} variant={variant}", flush=True)
abi_map = {"x64": "x86_64", "arm64": "arm64"} abi_map = {"x64": "x86_64", "arm64": "arm64"}
# TODO: keep it 11.0 since opengapps does not support 12+ yet # TODO: keep it 11.0 since opengapps does not support 12+ yet
# As soon as opengapps is available for 12+, we need to get the sdk/release from build.prop and # As soon as opengapps is available for 12+, we need to get the sdk/release from build.prop and
@ -43,7 +43,7 @@ try:
link = {i["name"]: i for i in j["archs"][abi_map[arch]] link = {i["name"]: i for i in j["archs"][abi_map[arch]]
["apis"][release]["variants"]}[variant]["zip"] ["apis"][release]["variants"]}[variant]["zip"]
except Exception: except Exception:
print("Failed to fetch from opengapps api, fallbacking to sourceforge rss...") print("Failed to fetch from OpenGApps API, fallbacking to SourceForge RSS...")
res = requests.get( res = requests.get(
f'https://sourceforge.net/projects/opengapps/rss?path=/{abi_map[arch]}&limit=100') f'https://sourceforge.net/projects/opengapps/rss?path=/{abi_map[arch]}&limit=100')
link = re.search(f'https://.*{abi_map[arch]}/.*{release}.*{variant}.*\.zip/download', res.text).group().replace( link = re.search(f'https://.*{abi_map[arch]}/.*{release}.*{variant}.*\.zip/download', res.text).group().replace(