From 08591e8fbb0d5497bf622be9f3a946ba7c6e2b17 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 7 Nov 2017 10:39:48 -0500 Subject: [PATCH] fix archive_org KeyError when running with it disabled --- index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.py b/index.py index 7c5d2cfe..42b1c85f 100644 --- a/index.py +++ b/index.py @@ -138,8 +138,8 @@ def write_html_link_index(out_dir, link): 'tags': link['tags'] or 'untagged', 'bookmarked': datetime.fromtimestamp(float(link['timestamp'])).strftime('%Y-%m-%d %H:%M'), 'updated': datetime.fromtimestamp(float(link['updated'])).strftime('%Y-%m-%d %H:%M'), - 'archive_org': link['latest']['archive_org'] or 'https://web.archive.org/save/{}'.format(link['url']), - 'wget': link['latest']['wget'] or link['domain'], + 'archive_org': link['latest'].get('archive_org') or 'https://web.archive.org/save/{}'.format(link['url']), + 'wget': link['latest'].get('wget') or link['domain'], })) chmod_file(path)