Telethon
Telethon copied to clipboard
Helper method for video avatars
Telegram now supports "profile videos", which are basically a list of VideoSize
, contained in video_sizes
attribute of Photo
type.
Though it is a video, it's supposed to be downloaded like photo, using inputPhotoFileLocation
. :man_shrugging:
Right now profile video is impossible to download using Telethon photo-related helper methods, because its constructor is stored in video_sizes
instead of sizes
.
Does passing the FileLocation
to download_media
not work?
It works indeed. But having something like download_media(entity.chat_photo, thumb='u')
, or download_profile_photo(entity, video=True)
would be nice, too.
Just a convenience method(s), so that it's possible to deal with profile videos without building the FileLocation object.
You don't need to build it, only access it. "Download profile photo" has "photo" in its name and I don't think it should download videos.
I think download_media
should support the VideoSize
type if it doesn't already and just use that. If it does we can close this.
This is unlikely to happen in the near future so I will be closing the issue. We can reopen it if there's still interest once the time is right.