From 73b9de2085de8d52cec9622a2de83383e8080277 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 13 Feb 2021 22:47:34 +0100 Subject: [PATCH] Correctly sort PhotoSizeProgressive thumb size --- telethon/client/downloads.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/telethon/client/downloads.py b/telethon/client/downloads.py index 3d2af555..f76129ee 100644 --- a/telethon/client/downloads.py +++ b/telethon/client/downloads.py @@ -740,6 +740,8 @@ class DownloadMethods: return 1, len(thumb.bytes) if isinstance(thumb, types.PhotoSize): return 1, thumb.size + if isinstance(thumb, types.PhotoSizeProgressive): + return 1, max(thumb.sizes) if isinstance(thumb, types.VideoSize): return 2, thumb.size