diff options
| author | 2025-10-07 02:11:52 -0400 | |
|---|---|---|
| committer | 2025-10-07 02:11:52 -0400 | |
| commit | 83e1e051b8c0e622ef5f61c1955c47b4bde95b57 (patch) | |
| tree | 544a434cb398d2adb8b8a2d553dc1c9a44b4ee1d /gallery_dl/downloader/http.py | |
| parent | f1612851ae9fe68c7444fb31e786503868aeaa7c (diff) | |
| parent | bbe7fac03d881662a458e7fbf870c9d71f5257f4 (diff) | |
Update upstream source from tag 'upstream/1.30.9'
Update to upstream version '1.30.9'
with Debian dir 46cc56e13f05f4465cc64f67b4d7b775a95bd87a
Diffstat (limited to 'gallery_dl/downloader/http.py')
| -rw-r--r-- | gallery_dl/downloader/http.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py index 111fd9b..248bf70 100644 --- a/gallery_dl/downloader/http.py +++ b/gallery_dl/downloader/http.py @@ -413,7 +413,7 @@ class HttpDownloader(DownloaderBase): def _find_extension(self, response): """Get filename extension from MIME type""" mtype = response.headers.get("Content-Type", "image/jpeg") - mtype = mtype.partition(";")[0] + mtype = mtype.partition(";")[0].lower() if "/" not in mtype: mtype = "image/" + mtype @@ -475,6 +475,10 @@ MIME_TYPES = { "audio/ogg" : "ogg", "audio/mpeg" : "mp3", + "application/vnd.apple.mpegurl": "m3u8", + "application/x-mpegurl" : "m3u8", + "application/dash+xml" : "mpd", + "application/zip" : "zip", "application/x-zip": "zip", "application/x-zip-compressed": "zip", @@ -526,6 +530,8 @@ SIGNATURE_CHECKS = { s[8:12] == b"WAVE"), "mp3" : lambda s: (s[0:3] == b"ID3" or s[0:2] in (b"\xFF\xFB", b"\xFF\xF3", b"\xFF\xF2")), + "m3u8": lambda s: s[0:7] == b"#EXTM3U", + "mpd" : lambda s: b"<MPD" in s, "zip" : lambda s: s[0:4] in (b"PK\x03\x04", b"PK\x05\x06", b"PK\x07\x08"), "rar" : lambda s: s[0:6] == b"Rar!\x1A\x07", "7z" : lambda s: s[0:6] == b"\x37\x7A\xBC\xAF\x27\x1C", |
