Skip to content

Instantly share code, notes, and snippets.

@tpeng
Created February 26, 2013 03:01
Show Gist options
  • Save tpeng/5035495 to your computer and use it in GitHub Desktop.
Save tpeng/5035495 to your computer and use it in GitHub Desktop.
download from videolectures.net
import re
import subprocess
from urllib2 import urlopen
url = 'http://videolectures.net/ecmlpkdd08_carlson_bief/'
re_flv = re.compile(r'(flv:[\w/]+)')
html = urlopen(url).read()
m = re.search(re_flv, html)
if m:
flv = m.group(1)
title = url.split('http://videolectures.net/')[1]
title = title.replace('/', '')
p = subprocess.Popen(['rtmpdump', '-r', 'rtmp://oxy.videolectures.net/video',
'-y', flv, '-a', 'video', '-o', '%s.flv' %title])
output = p.communicate()[0]
print output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment