Skip to content

Instantly share code, notes, and snippets.

@miratcan
Created March 12, 2012 22:12
Show Gist options
  • Save miratcan/2025029 to your computer and use it in GitHub Desktop.
Save miratcan/2025029 to your computer and use it in GitHub Desktop.
downloads coursera videos.
import urllib2
from BeautifulSoup import BeautifulSoup
from subprocess import call
for id in range(19, 54):
page = urllib2.urlopen("https://www.coursera.org/modelthinking/lecture/preview_view?lecture_id=%s" % id)
soup = BeautifulSoup(page)
video_tag = soup.find("source", attrs={'type': "video/ogg"})
call(["wget", "%s" % video_tag['src']])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment