python traceback when RSS feed has no items

Issue #15 resolved
Tiger! P created an issue

I got the following error:

[WARNING ] 22:26:34 logger:67 YaRSS2.rssfeed_scheduler:116: An exception was thrown by the RSS update handler. Please report this bug!
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/yarss2/rssfeed_scheduler.py", line 112, in rssfeed_update_handler_safe
    return self.rssfeed_update_handler(rssfeed_key=rssfeed_key, subscription_key=subscription_key)
  File "build/bdist.linux-x86_64/egg/yarss2/rssfeed_scheduler.py", line 130, in rssfeed_update_handler
    subscription_key=subscription_key)
  File "build/bdist.linux-x86_64/egg/yarss2/rssfeed_handling.py", line 274, in fetch_feed_torrents
    self.fetch_feed(subscription_data, rssfeed_data, fetch_data)
  File "build/bdist.linux-x86_64/egg/yarss2/rssfeed_handling.py", line 314, in fetch_feed
    rssfeed_parsed = self.get_rssfeed_parsed(rssfeed_data, site_cookies_dict=fetch_data["site_cookies_dict"])
  File "build/bdist.linux-x86_64/egg/yarss2/rssfeed_handling.py", line 142, in get_rssfeed_parsed
    rssfeeds_dict[key] = self._new_rssfeeds_dict_item(item['title'], link=link, published_datetime=dt)
  File "build/bdist.linux-x86_64/egg/yarss2/lib/feedparser/feedparser.py", line 354, in __getitem__
    return dict.__getitem__(self, key)
KeyError: 'title'

On a rss feed that contains the following

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Example.com</title>
    <link>http://www.example.com/rss/download_queue</link>
    <description>Torrents for download queue</description>
    <language>en-us</language>
    <ttl>15</ttl>
    <item></item>
  </channel>
</rss>

Comments (1)

  1. Log in to comment