Created
November 24, 2009 21:22
-
-
Save fitzgeraldsteele/242232 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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