From b1eed82b7f7c793c05defeb0a504659f6f2ae761 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Tue, 6 Aug 2019 23:25:58 +0200 Subject: [PATCH] Fix use of newer file IDs and add two new errors --- telethon/utils.py | 30 ++++++++++++++++++++++------- telethon_generator/data/errors.csv | 2 ++ telethon_generator/data/methods.csv | 2 +- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/telethon/utils.py b/telethon/utils.py index e2b9d827..b1b27410 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -954,12 +954,22 @@ def resolve_bot_file_id(file_id): For thumbnails, the photo ID and hash will always be zero. """ data = _rle_decode(_decode_telegram_base64(file_id)) - if not data or data[-1] != 2: + if not data: return None - data = data[:-1] - if len(data) == 24: - file_type, dc_id, media_id, access_hash = struct.unpack('