summaryrefslogtreecommitdiffstats
path: root/gallery_dl/downloader/http.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/downloader/http.py')
-rw-r--r--gallery_dl/downloader/http.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py
index 9cd2aa6..844e422 100644
--- a/gallery_dl/downloader/http.py
+++ b/gallery_dl/downloader/http.py
@@ -193,6 +193,9 @@ class HttpDownloader(DownloaderBase):
mtype = response.headers.get("Content-Type", "image/jpeg")
mtype = mtype.partition(";")[0]
+ if "/" not in mtype:
+ mtype = "image/" + mtype
+
if mtype in MIMETYPE_MAP:
return MIMETYPE_MAP[mtype]
@@ -231,6 +234,8 @@ MIMETYPE_MAP = {
"image/png": "png",
"image/gif": "gif",
"image/bmp": "bmp",
+ "image/x-bmp": "bmp",
+ "image/x-ms-bmp": "bmp",
"image/webp": "webp",
"image/svg+xml": "svg",
@@ -247,6 +252,7 @@ MIMETYPE_MAP = {
"application/zip": "zip",
"application/x-zip": "zip",
"application/x-zip-compressed": "zip",
+ "application/rar": "rar",
"application/x-rar": "rar",
"application/x-rar-compressed": "rar",
"application/x-7z-compressed": "7z",