mirror of
https://github.com/maubot/rss.git
synced 2025-01-05 13:00:50 -05:00
Handle ValueError in get_date. Fixes #11
This commit is contained in:
parent
4e3b9ef416
commit
4532e1bb4f
@ -135,11 +135,11 @@ class RSSBot(Plugin):
|
||||
def get_date(entry: Any) -> datetime:
|
||||
try:
|
||||
return datetime.fromtimestamp(mktime(entry["published_parsed"]))
|
||||
except (KeyError, TypeError):
|
||||
except (KeyError, TypeError, ValueError):
|
||||
pass
|
||||
try:
|
||||
return datetime.fromtimestamp(mktime(entry["date_parsed"]))
|
||||
except (KeyError, TypeError):
|
||||
except (KeyError, TypeError, ValueError):
|
||||
pass
|
||||
return datetime.now()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user