Podcast plugin unable to parse a feed that has non-enclosure entries

Bug #426792 reported by ben.mckenzie
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
Low
Dustin Spicuzza

Bug Description

Version of Exaile: current development source
OS: Gentoo Linux

Behavior: A podcast feed has entries that do not have an mp3 associated with them. An example of such a feed is here:

http://feeds2.feedburner.com/AllGamesConsidered

(Note: The feed cannot be parsed unless the SVN version of feedparser is used in the plugin, per bug#426775.)

Error produced:

Traceback (most recent call last):
  File "/home/benm/Projects/Exaile/exaile/data/plugins/podcasts/__init__.py", line 168, in _parse_podcast
    tr.set_loc(e['enclosures'][0].href)
IndexError: list index out of range

Because there's no enclosure on a non-media feed, the podcast plugin returns an empty list that errors out when reading the podcast.

Expected behavior: The feed should at least load all available media episodes and not error out.

Quick, non-good hack:

A try/except message can get past the non-media feeds, allowing Exaile to ignore the portions that have no media. I'm unsure how to check for a list that has no entries in it, because it's not showing up as 'None'. Attached is a quick hack, which will skip over the feed if it is unable to read a media file.

Related branches

Revision history for this message
ben.mckenzie (ben-k-mckenzie) wrote :

The patch here should get everything working on podcast feeds that have null-media entries.

reacocard (reacocard)
Changed in exaile:
assignee: nobody → Adam Olsen (arolsen)
importance: Undecided → Low
milestone: none → 0.3.1
Revision history for this message
ben.mckenzie (ben-k-mckenzie) wrote :

Sorry for all the posting. I actually found a better way of patching it up using an "if" statement rather than a "try/except" statement, and wanted to get it posted for anybody that needed it.

Revision history for this message
Steve Dodier-Lazaro (sidi) wrote : Re: [Bug 426792] Re: Podcast plugin unable to parse a feed that has non-enclosure entries

Thanks for your report and patches, Ben. The person managing the podcast
plugin is quite busy at the moment, so it might take time before you get
feedback on this bug, but be sure that your effort is appreciated.

Revision history for this message
ben.mckenzie (ben-k-mckenzie) wrote :

That's fine. I noticed you all were busy, and I was worried someone might do the try/except patch on their own, which could cause bigger problems.

Keep up the good work!

Revision history for this message
Jason Miller (aidenn0) wrote :

Ben: Will your patch work in the case where e is not empty, but contains no enclosures? I had fixed this independently locally with the attached patch

Revision history for this message
Dustin Spicuzza (dustin-virtualroadside) wrote :

Sorry about the delay, not sure why this was never fixed. Committed to trunk in r4449.

Changed in exaile:
milestone: 0.3.1 → 3.4.0
status: New → Fix Committed
Changed in exaile:
assignee: Adam Olsen (arolsen) → Dustin Spicuzza (dustin-virtualroadside)
Changed in exaile:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.