Telethon icon indicating copy to clipboard operation
Telethon copied to clipboard

Helper method for video avatars

Open ingria opened this issue 3 years ago • 3 comments

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.

ingria avatar Aug 01 '20 23:08 ingria

Does passing the FileLocation to download_media not work?

Lonami avatar Aug 01 '20 23:08 Lonami

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.

ingria avatar Aug 02 '20 01:08 ingria

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.

Lonami avatar Aug 02 '20 08:08 Lonami

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.

Lonami avatar Apr 06 '23 12:04 Lonami