diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-09-28 10:33:05 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-09-28 10:33:05 +0200 |
commit | 0c90ac01d2fd503905f1601959002c89146fc7f7 (patch) | |
tree | cdf354232f6618e591687179d63dde14bf9e183d /src/web/lib/article_utils.py | |
parent | test (diff) | |
download | newspipe-0c90ac01d2fd503905f1601959002c89146fc7f7.tar.gz newspipe-0c90ac01d2fd503905f1601959002c89146fc7f7.tar.bz2 newspipe-0c90ac01d2fd503905f1601959002c89146fc7f7.zip |
test
Diffstat (limited to 'src/web/lib/article_utils.py')
-rw-r--r-- | src/web/lib/article_utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/web/lib/article_utils.py b/src/web/lib/article_utils.py index b5b9f246..71e83880 100644 --- a/src/web/lib/article_utils.py +++ b/src/web/lib/article_utils.py @@ -26,8 +26,12 @@ def extract_id(entry, keys=[('link', 'link'), ('published', 'date'), if entry_key in entry and pyagg_key not in ids: ids[pyagg_key] = entry[entry_key] if 'date' in pyagg_key: - ids[pyagg_key] = dateutil.parser.parse(ids[pyagg_key])\ + try: + ids[pyagg_key] = dateutil.parser.parse(ids[pyagg_key])\ .isoformat() + except ValueError as e: + print("extract_id: " + str(e)) + ids[pyagg_key] = datetime.now().isoformat() return ids |