From 256d960cf518326ada5e3e4b73dc8aadb366ae9d Mon Sep 17 00:00:00 2001 From: "Ilya (Marshal)" Date: Tue, 20 Feb 2024 09:21:18 +0100 Subject: [PATCH] add android stable (from dl) --- make_and_send_alert.py | 5 ++++- make_files_tree.py | 21 +++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/make_and_send_alert.py b/make_and_send_alert.py index 088b3cb23b..0d86215539 100644 --- a/make_and_send_alert.py +++ b/make_and_send_alert.py @@ -44,7 +44,8 @@ STATUS_TO_EMOJI = { } AVAILABLE_HASHTAGS = { - 'web_tr', 'web_res', 'web', 'server', 'test_server', 'client', 'ios', 'macos', 'android', 'mini_app', 'wallet' + 'web_tr', 'web_res', 'web', 'server', 'test_server', 'client', + 'ios', 'macos', 'android', 'android_dl', 'mini_app', 'wallet' } HASHTAGS_PATTERNS = { # regex will be more flexible. for example, in issue with double hashtag '#web #web_res' when data/res not changed @@ -57,6 +58,7 @@ HASHTAGS_PATTERNS = { 'ios': os.path.join(ROOT_TREE_DIR, 'client', 'ios-beta'), 'macos': os.path.join(ROOT_TREE_DIR, 'client', 'macos-beta'), 'android': os.path.join(ROOT_TREE_DIR, 'client', 'android-beta'), + 'android_dl': os.path.join(ROOT_TREE_DIR, 'client', 'android-stable-dl'), 'mini_app': os.path.join(ROOT_TREE_DIR, 'mini_app'), 'wallet': os.path.join(ROOT_TREE_DIR, 'mini_app', 'wallet'), } @@ -79,6 +81,7 @@ HASHTAG_TO_TOPIC = { 'ios': '2194', 'macos': '2187', 'android': '2190', + 'android_dl': '12235', 'wallet': '5685', } diff --git a/make_files_tree.py b/make_files_tree.py index aad72b5429..5343bc519f 100644 --- a/make_files_tree.py +++ b/make_files_tree.py @@ -351,11 +351,28 @@ async def download_telegram_ios_beta_and_extract_resources(session: aiohttp.Clie cleanup2() +async def download_telegram_android_and_extract_resources(session: aiohttp.ClientSession) -> None: + await download_telegram_android_stable_dl_and_extract_resources(session) + await download_telegram_android_beta_and_extract_resources(session) + + +async def download_telegram_android_stable_dl_and_extract_resources(session: aiohttp.ClientSession): + download_url = 'https://telegram.org/dl/android/apk' + + await _download_telegram_android_and_extract_resources(session, download_url, 'android-stable-dl') + + async def download_telegram_android_beta_and_extract_resources(session: aiohttp.ClientSession): parameterized_url = 'apps/drklo-2kb-ghpo/telegram-beta-2/distribution_groups/all-users-of-telegram-beta-2' download_url = await get_download_link_of_latest_appcenter_release(parameterized_url, session) - crawled_data_folder = os.path.join(OUTPUT_CLIENTS_FOLDER, 'android-beta') + await _download_telegram_android_and_extract_resources(session, download_url, 'android-beta') + + +async def _download_telegram_android_and_extract_resources( + session: aiohttp.ClientSession, download_url: str, folder_name: str +): + crawled_data_folder = os.path.join(OUTPUT_CLIENTS_FOLDER, folder_name) if not download_url: return @@ -861,7 +878,7 @@ async def start(mode: str): track_mtproto_methods(), ) mode == 'client' and await asyncio.gather( - download_telegram_android_beta_and_extract_resources(session), + download_telegram_android_and_extract_resources(session), download_telegram_macos_beta_and_extract_resources(session), download_telegram_ios_beta_and_extract_resources(session), )