forked from solderpunk/AV-98
fix crash when feedparser is crashing on a bad RSS
This commit is contained in:
parent
339acef720
commit
9a7e88d01b
|
@ -4,6 +4,7 @@
|
|||
- offpunk/netcache: fix IPv6 as an URL (bug #40)
|
||||
- ansicat: display empty files (instead of opening them with xdg-open)
|
||||
- fix escape sequence warning in python 3.12 (by Étienne Mollier) (Debian #1064209)
|
||||
- ansicat : fix crash when feedparser is crashing on bad RSS
|
||||
|
||||
## 2.2 - February 13th 2023
|
||||
- cache folder is now configurable through $OFFPUNK_CACHE_PATH environment variable (by prx)
|
||||
|
|
|
@ -877,10 +877,15 @@ class FeedRenderer(GemtextRenderer):
|
|||
return "application/rss+xml"
|
||||
def is_valid(self):
|
||||
if _DO_FEED:
|
||||
parsed = feedparser.parse(self.body)
|
||||
try:
|
||||
parsed = feedparser.parse(self.body)
|
||||
except:
|
||||
parsed = False
|
||||
else:
|
||||
return False
|
||||
if parsed.bozo:
|
||||
if not parsed:
|
||||
return False
|
||||
elif parsed.bozo:
|
||||
return False
|
||||
else:
|
||||
#If no content, then fallback to HTML
|
||||
|
|
Loading…
Reference in New Issue