From bcfce6b7dbfbfcbd3763ca2277b2b862083330cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 20 Jun 2025 14:39:32 +0200 Subject: [PATCH] [dl:http] improve HTML signature check (#7697) https://github.com/mikf/gallery-dl/issues/7697#issuecomment-2990734451 ignore leading whitespace --- gallery_dl/downloader/http.py | 3 ++- test/test_downloader.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py index 94aa8f33..165f7898 100644 --- a/gallery_dl/downloader/http.py +++ b/gallery_dl/downloader/http.py @@ -486,7 +486,8 @@ MIME_TYPES = { def _signature_html(s): - return b"..."), + ("html", b" \n \n\r\t\n ..."), ("ico" , b"\x00\x00\x01\x00"), ("cur" , b"\x00\x00\x02\x00"), ("psd" , b"8BPS"),