diff --git a/defs/source.py b/defs/source.py index b7b6b40..d180fd7 100644 --- a/defs/source.py +++ b/defs/source.py @@ -65,8 +65,13 @@ async def download(url: str, name: str, pack_name: str) -> (str, str): data = Module(content) url = None if data.releases and data.releases[0].releaseAssets: - url = data.releases[0].releaseAssets[0].url - mime = data.releases[0].releaseAssets[0].name.split(".")[-1:][0] + # find arm64 or universal first + 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 if not url: raise FileNotFoundError diff --git a/requirements.txt b/requirements.txt index f2480be..4e6b579 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -Pyrogram>=2.0.59 -Tgcrypto>=1.2.4 +Pyrogram==2.0.97 +Tgcrypto==1.2.5 httpx>=0.22.0 apscheduler>=3.8.1 sqlitedict>=2.0.0