mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Added webp mime type (useful when downloading stickers)
This commit is contained in:
parent
308adc4192
commit
d290a569c5
|
@ -2,7 +2,7 @@
|
|||
We have these because some TLObjects differ in very little things,
|
||||
for example, some may have an `user_id` attribute and other a `chat_id` but,
|
||||
after all, both are the same attribute, IDs."""
|
||||
from mimetypes import guess_extension
|
||||
from mimetypes import add_type, guess_extension
|
||||
|
||||
from telethon.tl.types import \
|
||||
User, Chat, Channel, \
|
||||
|
@ -23,6 +23,9 @@ def get_display_name(entity):
|
|||
if isinstance(entity, Chat) or isinstance(entity, Channel):
|
||||
return entity.title
|
||||
|
||||
# For some reason, .webp (stickers' format) is not registered
|
||||
add_type('image/webp', '.webp')
|
||||
|
||||
|
||||
def get_extension(media):
|
||||
"""Gets the corresponding extension for any Telegram media"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user