From 0594821fcd571ed098b97ed98f9812643433b13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 1 Jan 2021 16:07:33 +0100 Subject: [PATCH] [downloader:http] add MIME type and signature for .ico files (closes #1211) --- gallery_dl/downloader/http.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py index b8546a88..179a5529 100644 --- a/gallery_dl/downloader/http.py +++ b/gallery_dl/downloader/http.py @@ -283,7 +283,10 @@ MIME_TYPES = { "image/x-ms-bmp": "bmp", "image/webp" : "webp", "image/svg+xml" : "svg", - + "image/ico" : "ico", + "image/icon" : "ico", + "image/x-icon" : "ico", + "image/vnd.microsoft.icon" : "ico", "image/x-photoshop" : "psd", "application/x-photoshop" : "psd", "image/vnd.adobe.photoshop": "psd", @@ -314,7 +317,7 @@ MIME_TYPES = { "application/octet-stream": "bin", } -# taken from https://en.wikipedia.org/wiki/List_of_file_signatures +# https://en.wikipedia.org/wiki/List_of_file_signatures FILE_SIGNATURES = { "jpg" : b"\xFF\xD8\xFF", "png" : b"\x89PNG\r\n\x1A\n", @@ -322,6 +325,8 @@ FILE_SIGNATURES = { "bmp" : b"BM", "webp": b"RIFF", "svg" : b"