From 5ce361b81eee84622df7c43db754104ce85fc11a Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 4 May 2023 16:45:10 -0400 Subject: [PATCH] better detection of redirect errors --- doab_check/check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doab_check/check.py b/doab_check/check.py index 1748a3d..95c0379 100755 --- a/doab_check/check.py +++ b/doab_check/check.py @@ -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