From c87177e7a655a1958b024064e6fbfdcab53d90e3 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 30 Nov 2020 12:40:26 +0100 Subject: [PATCH] Do not parse PhotoStrippedSize --- pyrogram/types/messages_and_media/photo.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyrogram/types/messages_and_media/photo.py b/pyrogram/types/messages_and_media/photo.py index 01337801..801d7118 100644 --- a/pyrogram/types/messages_and_media/photo.py +++ b/pyrogram/types/messages_and_media/photo.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from typing import List +from typing import List, Optional import pyrogram from pyrogram import raw @@ -80,10 +80,13 @@ class Photo(Object): self.thumbs = thumbs @staticmethod - def _parse(client, photo: "raw.types.Photo", ttl_seconds: int = None) -> "Photo": + def _parse(client, photo: "raw.types.Photo", ttl_seconds: int = None) -> Optional["Photo"]: if isinstance(photo, raw.types.Photo): big = photo.sizes[-1] + if isinstance(big, raw.types.PhotoStrippedSize): + return None + if isinstance(big, raw.types.PhotoSizeProgressive): big = raw.types.PhotoSize( type=big.type,