From 01dac9d0e11e8d7fd9e517f0de83157c7ef5be73 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Tue, 3 May 2022 13:11:12 +0200 Subject: [PATCH] add tracking of animated emoji --- make_files_tree.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/make_files_tree.py b/make_files_tree.py index da6d0eaa45..da6a12261a 100644 --- a/make_files_tree.py +++ b/make_files_tree.py @@ -261,6 +261,7 @@ async def track_mtproto_configs(): import json from pyrogram import Client from pyrogram.raw import functions + from pyrogram.raw.types import InputStickerSetAnimatedEmoji app = Client( os.environ['TELEGRAM_SESSION'], @@ -279,11 +280,17 @@ async def track_mtproto_configs(): 'GetCountriesList': await app.send(functions.help.GetCountriesList(lang_code='en', hash=0)), 'GetAppConfig': await app.send(functions.help.GetAppConfig()), # 'GetAppUpdate': await app.send(functions.help.GetAppUpdate(source='')), + 'AnimatedEmoji': await app.send( + functions.messages.GetStickerSet(stickerset=InputStickerSetAnimatedEmoji(), hash=0) + ), } - keys_to_hide = {'access_hash', 'autologin_token', 'file_reference_base64'} + keys_to_hide = {'access_hash', 'autologin_token', 'file_reference', 'file_reference_base64'} def rem_rec(config): + if not isinstance(config, dict): + return + for key, value in config.items(): if isinstance(value, dict): rem_rec(value) @@ -292,10 +299,13 @@ async def track_mtproto_configs(): rem_rec(item) elif key == 'key' and value in keys_to_hide: config['value']['value'] = 'crawler' + elif key in keys_to_hide: + config[key] = 'crawler' - configs['GetAppConfig'] = json.loads(str(configs['GetAppConfig'])) - rem_rec(configs['GetAppConfig']) - configs['GetAppConfig'] = json.dumps(configs['GetAppConfig'], indent=4) + for config_name in {'GetAppConfig', 'AnimatedEmoji'}: + configs[config_name] = json.loads(str(configs[config_name])) + rem_rec(configs[config_name]) + configs[config_name] = json.dumps(configs[config_name], indent=4) configs['GetConfig'].date = 0 configs['GetConfig'].expires = 0