summaryrefslogtreecommitdiffstats
path: root/gallery_dl/downloader/http.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2022-02-10 22:50:56 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2022-02-10 22:50:56 -0500
commit99bc014c924c755f10a4a930b1a83efabd84fde1 (patch)
tree596bbab18416b66adf87011a0a6e439468f68778 /gallery_dl/downloader/http.py
parent8a812de1450d5d53fc1cd9a59f6c3f08452fc5b1 (diff)
New upstream version 1.20.4.upstream/1.20.4
Diffstat (limited to 'gallery_dl/downloader/http.py')
-rw-r--r--gallery_dl/downloader/http.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py
index d2efd3f..91ce731 100644
--- a/gallery_dl/downloader/http.py
+++ b/gallery_dl/downloader/http.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2014-2021 Mike Fährmann
+# Copyright 2014-2022 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -148,9 +148,15 @@ class HttpDownloader(DownloaderBase):
# check for invalid responses
validate = kwdict.get("_http_validate")
- if validate and not validate(response):
- self.log.warning("Invalid response")
- return False
+ if validate:
+ result = validate(response)
+ if isinstance(result, str):
+ url = result
+ tries -= 1
+ continue
+ if not result:
+ self.log.warning("Invalid response")
+ return False
# set missing filename extension from MIME type
if not pathfmt.extension: