From e1d2c81dca7c26c11365457ad2f7857853249471 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 7 Nov 2020 12:46:46 +0100 Subject: [PATCH] Parse part of newer bot file IDs for photos Helps with #1613. --- telethon/utils.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/telethon/utils.py b/telethon/utils.py index 81ba9523..a5f95e9a 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -1161,15 +1161,20 @@ def resolve_bot_file_id(file_id): attributes=attributes, file_reference=b'' ) - elif (version == 2 and len(data) == 44) or (version == 4 and len(data) == 49): + elif (version == 2 and len(data) == 44) or (version == 4 and len(data) in (49, 77)): if version == 2: (file_type, dc_id, media_id, access_hash, volume_id, secret, local_id) = struct.unpack('