mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-11-21 14:56:46 +01:00
add android stable (from dl)
This commit is contained in:
parent
1dfe14ac8f
commit
256d960cf5
2 changed files with 23 additions and 3 deletions
|
@ -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',
|
||||
}
|
||||
|
||||
|
|
|
@ -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),
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue