summaryrefslogtreecommitdiffstats
path: root/gallery_dl/downloader/http.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-02-16 21:35:52 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-02-16 21:35:52 -0500
commitfc83315c164afd74734adf27e0f7fec2011904aa (patch)
treed5976be93924dc4cd76c41e5e3f13bb44b6516b3 /gallery_dl/downloader/http.py
parent2e29d2158d56879e5578dfabf9e8c0fa2e855ccf (diff)
New upstream version 1.16.5.upstream/1.16.5
Diffstat (limited to 'gallery_dl/downloader/http.py')
-rw-r--r--gallery_dl/downloader/http.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py
index 179a552..8d72dc2 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))