aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2019-07-31 17:24:25 -0700
committerBryan Newbold <bnewbold@archive.org>2019-07-31 17:24:25 -0700
commit601e23d816282e125c48b9224d0e47f45d06f9f8 (patch)
tree8d82b0d47137942251e8e8c84aaf9990e80e2bc9
parent5f3ac46907a6eca27be8c4b7bd8be69a009370c9 (diff)
downloadchocula-601e23d816282e125c48b9224d0e47f45d06f9f8.tar.gz
chocula-601e23d816282e125c48b9224d0e47f45d06f9f8.zip
more check_issn_urls corner-cases
-rwxr-xr-xcheck_issn_urls.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/check_issn_urls.py b/check_issn_urls.py
index 399fd93..ff73353 100755
--- a/check_issn_urls.py
+++ b/check_issn_urls.py
@@ -94,7 +94,7 @@ def check_gwb(url, match_type='exact'):
break
time.sleep(5)
if not resp.status_code == 200:
- sys.stderr.write("CDX ERR {}: {}".format(resp.status_code, url))
+ sys.stderr.write("CDX ERR {}: {}\n".format(resp.status_code, url))
return 'error'
line = resp.text.strip().split('\n')[0]
if line:
@@ -134,6 +134,10 @@ def check_url(issnl, url):
info['error'] = 'ContentDecodingError'
info['terminal_status_code'] = info['status_code'] = -1
return info
+ except requests.exceptions.InvalidSchema:
+ info['error'] = 'InvalidSchema'
+ info['terminal_status_code'] = info['status_code'] = -1
+ return info
if resp.history:
info['status_code'] = resp.history[0].status_code