mirror of
https://github.com/maubot/rss.git
synced 2025-01-07 05:48:05 -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:
|
def get_date(entry: Any) -> datetime:
|
||||||
try:
|
try:
|
||||||
return datetime.fromtimestamp(mktime(entry["published_parsed"]))
|
return datetime.fromtimestamp(mktime(entry["published_parsed"]))
|
||||||
except (KeyError, TypeError):
|
except (KeyError, TypeError, ValueError):
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
return datetime.fromtimestamp(mktime(entry["date_parsed"]))
|
return datetime.fromtimestamp(mktime(entry["date_parsed"]))
|
||||||
except (KeyError, TypeError):
|
except (KeyError, TypeError, ValueError):
|
||||||
pass
|
pass
|
||||||
return datetime.now()
|
return datetime.now()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user