Created
March 14, 2011 06:38
-
-
Save jharjono/868847 to your computer and use it in GitHub Desktop.
Python script to help grab all PyCon 2011 Videos
This file contains 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 | |
# List all source video URLs for Pycon 2011 Videos | |
# easy_install bliptv.reader | |
from bliptv.reader import Show | |
def list_episodes_url(page): | |
urls = [] | |
for episode in page.episodes: | |
enclosure = episode.enclosures.get('video/mp4', None) | |
if enclosure: | |
urls.append(enclosure.url) | |
return filter(lambda url: "2011" in url, urls) | |
if __name__ == "__main__": | |
show = Show('pycon') | |
talks = [] | |
page = show.episodes.pages[1] | |
talks += list_episodes_url(page) | |
while page.next: | |
page = page.next | |
talks += list_episodes_url(page) | |
# print all the urls | |
for talk in talks: | |
print talk | |
# Now you can wget each url or just urllib.urlretrieve it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment