diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-06-26 09:56:14 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-06-26 09:56:14 -0700 |
commit | f766aa742dee0b3937a432e3afc4cc48250b1d09 (patch) | |
tree | 344d9f5259f230287fdf2677445a7d6973aa3bae /python | |
parent | d47a51c927a57208bea22900b5b5c9f519140a3c (diff) | |
download | sandcrawler-f766aa742dee0b3937a432e3afc4cc48250b1d09.tar.gz sandcrawler-f766aa742dee0b3937a432e3afc4cc48250b1d09.zip |
handle non-success case of parsing extract from JSON/dict
Diffstat (limited to 'python')
-rw-r--r-- | python/sandcrawler/pdfextract.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/sandcrawler/pdfextract.py b/python/sandcrawler/pdfextract.py index 921c883..3701172 100644 --- a/python/sandcrawler/pdfextract.py +++ b/python/sandcrawler/pdfextract.py @@ -53,7 +53,7 @@ class PdfExtractResult: """ if record['status'] != 'success': return PdfExtractResult( - sha1hex=record['sha1hex'], + sha1hex=record.get('sha1hex') or record['key'], status=record['status'], error_msg=record.get('error_msg'), ) |