mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 01:16:35 +03:00
Let download_profile_photo work with min-User
This commit is contained in:
parent
04cf2953f6
commit
299b090cde
|
@ -272,7 +272,9 @@ class DownloadMethods:
|
||||||
if isinstance(photo, (types.UserProfilePhoto, types.ChatPhoto)):
|
if isinstance(photo, (types.UserProfilePhoto, types.ChatPhoto)):
|
||||||
dc_id = photo.dc_id
|
dc_id = photo.dc_id
|
||||||
loc = types.InputPeerPhotoFileLocation(
|
loc = types.InputPeerPhotoFileLocation(
|
||||||
peer=await self.get_input_entity(entity),
|
# min users can be used to download profile photos
|
||||||
|
# self.get_input_entity would otherwise not accept those
|
||||||
|
peer=utils.get_input_peer(entity, check_hash=False),
|
||||||
photo_id=photo.photo_id,
|
photo_id=photo.photo_id,
|
||||||
big=download_big
|
big=download_big
|
||||||
)
|
)
|
||||||
|
@ -402,7 +404,7 @@ class DownloadMethods:
|
||||||
if isinstance(message.action,
|
if isinstance(message.action,
|
||||||
types.MessageActionChatEditPhoto):
|
types.MessageActionChatEditPhoto):
|
||||||
media = media.photo
|
media = media.photo
|
||||||
|
|
||||||
if isinstance(media, types.MessageMediaWebPage):
|
if isinstance(media, types.MessageMediaWebPage):
|
||||||
if isinstance(media.webpage, types.WebPage):
|
if isinstance(media.webpage, types.WebPage):
|
||||||
media = media.webpage.document or media.webpage.photo
|
media = media.webpage.document or media.webpage.photo
|
||||||
|
|
Loading…
Reference in New Issue
Block a user