adjust output for HTTP status related errors
This commit is contained in:
@@ -107,7 +107,7 @@ class HttpDownloader(DownloaderBase):
|
|||||||
elif code == 416 and filesize: # Requested Range Not Satisfiable
|
elif code == 416 and filesize: # Requested Range Not Satisfiable
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
msg = "{}: {} for url: {}".format(code, response.reason, url)
|
msg = "'{} {}' for '{}'".format(code, response.reason, url)
|
||||||
if code == 429 or 500 <= code < 600: # Server Error
|
if code == 429 or 500 <= code < 600: # Server Error
|
||||||
continue
|
continue
|
||||||
self.log.warning("%s", msg)
|
self.log.warning("%s", msg)
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class Extractor():
|
|||||||
msg = ""
|
msg = ""
|
||||||
self.log.warning("Cloudflare CAPTCHA" + msg)
|
self.log.warning("Cloudflare CAPTCHA" + msg)
|
||||||
|
|
||||||
msg = "{}: {} for url: {}".format(code, response.reason, url)
|
msg = "'{} {}' for '{}'".format(code, response.reason, url)
|
||||||
if code < 500 and code != 429 and code != 430:
|
if code < 500 and code != 429 and code != 430:
|
||||||
break
|
break
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ class Extractor():
|
|||||||
return username, password
|
return username, password
|
||||||
|
|
||||||
def _init_headers(self):
|
def _init_headers(self):
|
||||||
"""Set additional headers for the 'session' object"""
|
"""Initialize HTTP headers for the 'session' object"""
|
||||||
headers = self.session.headers
|
headers = self.session.headers
|
||||||
headers.clear()
|
headers.clear()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user