diff --git a/get_custom_emoji.py b/get_custom_emoji.py index 4cf8279..b532229 100755 --- a/get_custom_emoji.py +++ b/get_custom_emoji.py @@ -4,7 +4,6 @@ import sys import os import re import json -import mimetypes import urllib.request @@ -46,12 +45,8 @@ def get_emoji_image(name, emoji_id): print(f"Downloading {name}", file=sys.stderr, flush=True) with mm_api_get(f"/v4/emoji/{emoji_id}/image") as upstream_response: headers = {k.lower(): v for (k, v) in upstream_response.headers.items()} - mime = headers.get("content-type") - if not mime.startswith("image/"): - raise Exception(f"Got response with MIME type {mime}, not an image") - extension = mimetypes.guess_extension(mime) - filepath = f"{destination_dir}/{name}{extension}" + filepath = f"{destination_dir}/{name}" with open(filepath, "wb") as fh: chunk = upstream_response.read1() while chunk != b"":