Skip to content

Instantly share code, notes, and snippets.

@fitzgeraldsteele
Created November 24, 2009 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitzgeraldsteele/242232 to your computer and use it in GitHub Desktop.
Save fitzgeraldsteele/242232 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
''' Downloads all enclosed mp3s from http://yearofmixtapes.blogspot.com '''
import subprocess
import feedparser # http://feedparser.org
d = feedparser.parse("http://feeds.feedburner.com/myyearofmixtapes")
enclosures = [x.enclosures[0] for x in d.entries if x.enclosures]
mp3_urls = [m['href'] for m in enclosures if m['type'] == 'audio/mpeg']
for mp3 in mp3_urls:
try:
print "Fetching " + mp3
subprocess.call(['wget',mp3])
except Exception:
print "error fetching " + mp3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment