mirror of
https://github.com/maubot/rss.git
synced 2025-02-18 13:54:08 -05:00
Ignore non-problematic feed parsing errors
This commit is contained in:
parent
2079504e39
commit
21a65bc189
@ -199,7 +199,8 @@ class RSSBot(Plugin):
|
||||
headers = {"Content-Location": feed.url, **resp.headers, "Content-Encoding": "identity"}
|
||||
parsed_data = feedparser.parse(content, response_headers=headers)
|
||||
if parsed_data.bozo:
|
||||
raise ValueError("Feed is not valid")
|
||||
if not isinstance(parsed_data.bozo_exception, feedparser.ThingsNobodyCaresAboutButMe):
|
||||
raise parsed_data.bozo_exception
|
||||
feed = Feed(id=feed.id, url=feed.url, title=parsed_data.get("title", feed.url),
|
||||
subtitle=parsed_data.get("description", ""), link=parsed_data.get("link", ""),
|
||||
subscriptions=feed.subscriptions)
|
||||
|
Loading…
x
Reference in New Issue
Block a user