From 0e91fc36684778a2398bdf90877256a1da063f50 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 27 Aug 2018 17:19:10 +0200 Subject: [PATCH] Manually register webp mimetype Otherwise, sending stickers would fail on some systems. --- telethon/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/telethon/utils.py b/telethon/utils.py index 81dd9f23..b1a5ddc8 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -24,6 +24,10 @@ try: except ImportError: hachoir = None +# .webp mimetype is unknown on some operative systems, so stickers won't +# work. Manually register it here to make sure stickers work everywhere. +mimetypes.add_type('image/webp', '.webp') + USERNAME_RE = re.compile( r'@|(?:https?://)?(?:www\.)?(?:telegram\.(?:me|dog)|t\.me)/(joinchat/)?' )