diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-04-09 17:48:47 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-04-09 17:48:47 -0700 |
commit | 042bd36c25206ff45e305d094028b6482a4c4074 (patch) | |
tree | 5e25122ad6227855416fe964658e0581e048332c /fatcat_covid19 | |
parent | 5b22495057fa9cb40271764c9e80166882ba3f21 (diff) | |
download | fatcat-covid19-042bd36c25206ff45e305d094028b6482a4c4074.tar.gz fatcat-covid19-042bd36c25206ff45e305d094028b6482a4c4074.zip |
bugfix: handle missing file mimetypes
Diffstat (limited to 'fatcat_covid19')
-rw-r--r-- | fatcat_covid19/common.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fatcat_covid19/common.py b/fatcat_covid19/common.py index 97bc675..7b88344 100644 --- a/fatcat_covid19/common.py +++ b/fatcat_covid19/common.py @@ -80,7 +80,7 @@ def find_local_file(files, base_dir="."): If found, returns the file entity; the path can be determined from the sha1hex field. """ for f in files: - if f['mimetype'] and not 'pdf' in f['mimetype'].lower(): + if f.get('mimetype') and not 'pdf' in f['mimetype'].lower(): continue pdf_path = blob_path(f['sha1'], directory="pdf/", file_suffix=".pdf", base_dir=base_dir) if os.path.isfile(pdf_path): |