manolomartinez / greg

A command-line podcast aggregator
GNU General Public License v3.0
297 stars 37 forks source link

podcast url causes KeyError: 'type' #30

Closed ghost closed 9 years ago

ghost commented 9 years ago

Sorry for posting so many issues, :smile:

I just added this podcast URL: http://www.hellointernet.fm/podcast?format=rss

On greg sync I see the following error:

Checking Hello Internet...
Traceback (most recent call last):
  File "/usr/local/bin/greg", line 11, in <module>
    sys.exit(main())
 File "/usr/local/lib/python3.4/dist-packages/greg/gregparser.py", line 112, in main
    args.func(vars(args))
  File "/usr/local/lib/python3.4/dist-packages/greg/greg.py", line 793, in sync
    download_entry(feed, entry)
  File "/usr/local/lib/python3.4/dist-packages/greg/greg.py", line 557, in download_entry
    if any([mimetype in enclosure["type"] for mimetype in feed.mime]):
  File "/usr/local/lib/python3.4/dist-packages/greg/greg.py", line 557, in <listcomp>
    if any([mimetype in enclosure["type"] for mimetype in feed.mime]):
  File "/usr/local/lib/python3.4/dist-packages/feedparser.py", line 357, in __getitem__
    return dict.__getitem__(self, key)
KeyError: 'type'

I think maybe is the question mark in the podcast url causing an issue? Or maybe it's a malformed feed... I'll check it inside a feed validator.

ghost commented 9 years ago

Ok I ran it through http://podba.se/validate and it's a Squarespace podcast feed, and apparently they are just barely proper feeds and cause all sorts of problems: https://answers.squarespace.com/questions/66291/how-can-we-get-squarespace-to-actually-support-podcasting - that's a bummer.

manolomartinez commented 9 years ago

I will take a look at it anyway, see if there's something I can do.

ghost commented 9 years ago

ok thank you!!