From cd0a860f5f05390a9499f9f95d5c682dc776208c Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 7 Jul 2019 10:28:20 +0100 Subject: [PATCH] support rss/atom feeds that have no feed title --- modules/rss.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/rss.py b/modules/rss.py index d2aa60a4..a91e4aaf 100644 --- a/modules/rss.py +++ b/modules/rss.py @@ -12,7 +12,9 @@ def _format_entry(feed_title, entry): link = entry.get("link", None) link = " - %s" % link if link else "" - return "%s: %s%s%s" % (feed_title, title, author, link) + feed_title_str = "%s: " % feed_title if feed_title else "" + + return "%s%s%s%s" % (feed_title_str, title, author, link) @utils.export("botset", utils.IntSetting("rss-interval", "Interval (in seconds) between RSS polls", example="120")) @@ -47,7 +49,7 @@ class Module(ModuleManager.BaseModule): [url, str(e)]) continue - feed_title = feed["feed"]["title"] + feed_title = feed["feed"].get("title", None) entry_formatted = {} for server, channel in channels: