diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index 503f1c0f..05926216 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -84,7 +84,7 @@ from .tl.types import ( InputMessageEntityMentionName, DocumentAttributeVideo, UpdateEditMessage, UpdateEditChannelMessage, UpdateShort, Updates, MessageMediaWebPage, ChannelParticipantsSearch, PhotoSize, PhotoCachedSize, - PhotoSizeEmpty, MessageService, ChatParticipants, User, + PhotoSizeEmpty, MessageService, ChatParticipants, User, WebPage, ChannelParticipantsBanned, ChannelParticipantsKicked ) from .tl.types.messages import DialogsSlice @@ -1905,6 +1905,10 @@ class TelegramClient(TelegramBareClient): date = datetime.now() media = message + if isinstance(media, MessageMediaWebPage): + if isinstance(media.webpage, WebPage): + media = media.webpage.document or media.webpage.photo + if isinstance(media, (MessageMediaPhoto, Photo, PhotoSize, PhotoCachedSize)): return self._download_photo(