From d5fc21e6f4c9664dc0781b65c0257ab9ce2cf727 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 27 Jul 2020 14:27:09 +0200 Subject: [PATCH] Get the proper biggest photo size --- pyrogram/client/types/messages_and_media/photo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/client/types/messages_and_media/photo.py b/pyrogram/client/types/messages_and_media/photo.py index 36d37cac..fe0678ab 100644 --- a/pyrogram/client/types/messages_and_media/photo.py +++ b/pyrogram/client/types/messages_and_media/photo.py @@ -82,7 +82,7 @@ class Photo(Object): @staticmethod def _parse(client, photo: types.Photo, ttl_seconds: int = None) -> "Photo": if isinstance(photo, types.Photo): - big = photo.sizes[-1] + big = list(filter(lambda p: isinstance(p, types.PhotoSize), photo.sizes))[-1] return Photo( file_id=encode_file_id(