aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--newspipe/lib/article_utils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/newspipe/lib/article_utils.py b/newspipe/lib/article_utils.py
index 0490d4d7..7e1b2a36 100644
--- a/newspipe/lib/article_utils.py
+++ b/newspipe/lib/article_utils.py
@@ -2,6 +2,7 @@ import html
import logging
import re
from datetime import datetime, timezone
+from dateutil.parser._parser import ParserError
from enum import Enum
from urllib.parse import SplitResult, urlsplit, urlunsplit
@@ -47,6 +48,8 @@ async def construct_article(entry, feed, fields=None, fetch=True):
article["date"] = dateutil.parser.parse(entry[date_key]).astimezone(
timezone.utc
)
+ except ParserError:
+ logger.exception("Error when parsing date {}".format(entry[date_key]))
except Exception as e:
logger.exception(e)
else:
bgstack15