[downloader] fix extension from content-type

This commit is contained in:
Mike Fährmann
2017-06-19 09:24:00 +02:00
parent e68af4febe
commit fac6c02224

View File

@@ -65,6 +65,7 @@ class Downloader(BasicDownloader):
if not pathfmt.has_extension:
# set 'extension' keyword from Content-Type header
mtype = response.headers.get("Content-Type", "image/jpeg")
mtype = mtype.partition(";")[0]
exts = mimetypes.guess_all_extensions(mtype, strict=False)
if exts:
exts.sort()