Skip to content

Commit c87177e

Browse files
committed
Do not parse PhotoStrippedSize
1 parent 384f4eb commit c87177e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • pyrogram/types/messages_and_media

pyrogram/types/messages_and_media/photo.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818

19-
from typing import List
19+
from typing import List, Optional
2020

2121
import pyrogram
2222
from pyrogram import raw
@@ -80,10 +80,13 @@ def __init__(
8080
self.thumbs = thumbs
8181

8282
@staticmethod
83-
def _parse(client, photo: "raw.types.Photo", ttl_seconds: int = None) -> "Photo":
83+
def _parse(client, photo: "raw.types.Photo", ttl_seconds: int = None) -> Optional["Photo"]:
8484
if isinstance(photo, raw.types.Photo):
8585
big = photo.sizes[-1]
8686

87+
if isinstance(big, raw.types.PhotoStrippedSize):
88+
return None
89+
8790
if isinstance(big, raw.types.PhotoSizeProgressive):
8891
big = raw.types.PhotoSize(
8992
type=big.type,

0 commit comments

Comments
 (0)