From 36cedfde374a2643396b070d3116e4b568500e14 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 3 Nov 2021 14:01:33 -0700 Subject: more involved type wrangling and fixes for importers --- python/fatcat_tools/importers/wayback_static.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'python/fatcat_tools/importers/wayback_static.py') diff --git a/python/fatcat_tools/importers/wayback_static.py b/python/fatcat_tools/importers/wayback_static.py index 3c619b14..5caed2c7 100755 --- a/python/fatcat_tools/importers/wayback_static.py +++ b/python/fatcat_tools/importers/wayback_static.py @@ -113,15 +113,15 @@ def lookup_cdx( hit = resp.content.decode("utf-8").split("\n")[0] if cdx_output: cdx_output.write(hit + "\n") - cdx = hit.split(" ") - cdx = [x if (x and x != "-") else None for x in cdx] + cdx_chunks = hit.split(" ") + cdx = [x if (x and x != "-") else None for x in cdx_chunks] webcapture_cdx = WebcaptureCdxLine( surt=cdx[0], - timestamp=parse_wbm_timestamp(cdx[1]).isoformat() + "Z", + timestamp=parse_wbm_timestamp(cdx[1] or "").isoformat() + "Z", url=cdx[2], mimetype=cdx[3], - status_code=(cdx[4] and int(cdx[4])) or None, - sha1=b32_hex(cdx[5]), + status_code=int(cdx[4] or ""), + sha1=b32_hex(cdx[5] or ""), sha256=None, ) if verify_hashes: -- cgit v1.2.3