diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py index 179a5529..8d72dc27 100644 --- a/gallery_dl/downloader/http.py +++ b/gallery_dl/downloader/http.py @@ -134,6 +134,12 @@ class HttpDownloader(DownloaderBase): self.log.warning(msg) return False + # check for invalid responses + validate = pathfmt.kwdict.get("_http_validate") + if validate and not validate(response): + self.log.warning("Invalid response") + return False + # set missing filename extension from MIME type if not pathfmt.extension: pathfmt.set_extension(self._find_extension(response))