mirror of
https://github.com/maubot/rss.git
synced 2025-04-28 02:46:20 -04: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"}
|
headers = {"Content-Location": feed.url, **resp.headers, "Content-Encoding": "identity"}
|
||||||
parsed_data = feedparser.parse(content, response_headers=headers)
|
parsed_data = feedparser.parse(content, response_headers=headers)
|
||||||
if parsed_data.bozo:
|
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),
|
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", ""),
|
subtitle=parsed_data.get("description", ""), link=parsed_data.get("link", ""),
|
||||||
subscriptions=feed.subscriptions)
|
subscriptions=feed.subscriptions)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user