优先查找 arm64 apk 文件

This commit is contained in:
xtaodada 2023-02-03 17:59:55 +08:00
parent e8a79dd15d
commit 568a0eb9ef
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 9 additions and 4 deletions

View File

@ -65,8 +65,13 @@ async def download(url: str, name: str, pack_name: str) -> (str, str):
data = Module(content) data = Module(content)
url = None url = None
if data.releases and data.releases[0].releaseAssets: if data.releases and data.releases[0].releaseAssets:
url = data.releases[0].releaseAssets[0].url # find arm64 or universal first
mime = data.releases[0].releaseAssets[0].name.split(".")[-1:][0] asset = next(
(i for i in data.releases[0].releaseAssets if "arm64" in i.name or "universal" in i.name),
data.releases[0].releaseAssets[0],
)
url = asset.url
mime = asset.name.split(".")[-1:][0]
name = data.name.replace('.', '_') + "-" + data.latestRelease + "." + mime name = data.name.replace('.', '_') + "-" + data.latestRelease + "." + mime
if not url: if not url:
raise FileNotFoundError raise FileNotFoundError

View File

@ -1,5 +1,5 @@
Pyrogram>=2.0.59 Pyrogram==2.0.97
Tgcrypto>=1.2.4 Tgcrypto==1.2.5
httpx>=0.22.0 httpx>=0.22.0
apscheduler>=3.8.1 apscheduler>=3.8.1
sqlitedict>=2.0.0 sqlitedict>=2.0.0