From abbcebb81d27763237c61fd974aca08a772eac02 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Fri, 5 Jul 2019 10:41:25 +0200 Subject: [PATCH] Tweak media caching --- utils/media.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/utils/media.py b/utils/media.py index 0dfe44c..d00aa67 100644 --- a/utils/media.py +++ b/utils/media.py @@ -15,8 +15,6 @@ def load(url, user_agent): """Initializes a `PIL.Image` from the URL.""" with requests.get(url, stream=True, headers={"User-Agent": user_agent}) as resp: resp.raise_for_status() - if not resp.headers.get("content-type").startswith("image/"): - raise ValueError(f"bad content-type {resp.headers.get('content-type')}") resp.raw.decode_content = True return Image.open(BytesIO(resp.raw.read()))