better detection of redirect errors
parent
e7670c9e40
commit
5ce361b81e
|
@ -37,7 +37,7 @@ class ContentTyper(object):
|
|||
r.status_code = 511
|
||||
return r
|
||||
except requests.exceptions.ConnectionError as ce:
|
||||
if '[Errno 8]' in str(ce):
|
||||
if '[Errno 8]' in str(ce) or [Errno -2] in str(ce):
|
||||
try:
|
||||
r = requests.get(url, allow_redirects=False, headers=HEADERS)
|
||||
return r
|
||||
|
|
Loading…
Reference in New Issue