better detection of redirect errors

main
eric 2023-05-04 16:45:10 -04:00
parent e7670c9e40
commit 5ce361b81e
1 changed files with 1 additions and 1 deletions

View File

@ -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