From 0059e2bfe727015cde179272327effd804aaf605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 1 Nov 2022 17:25:21 +0100 Subject: [PATCH] [downloader:http] add MIME type and signature for .avif files --- gallery_dl/downloader/http.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py index e159f125..4e074665 100644 --- a/gallery_dl/downloader/http.py +++ b/gallery_dl/downloader/http.py @@ -325,6 +325,7 @@ MIME_TYPES = { "image/x-bmp" : "bmp", "image/x-ms-bmp": "bmp", "image/webp" : "webp", + "image/avif" : "avif", "image/svg+xml" : "svg", "image/ico" : "ico", "image/icon" : "ico", @@ -368,6 +369,7 @@ SIGNATURE_CHECKS = { "bmp" : lambda s: s[0:2] == b"BM", "webp": lambda s: (s[0:4] == b"RIFF" and s[8:12] == b"WEBP"), + "avif": lambda s: s[4:12] == b"ftypavif", "svg" : lambda s: s[0:5] == b"