Created
February 26, 2013 03:01
-
-
Save tpeng/5035495 to your computer and use it in GitHub Desktop.
download from videolectures.net
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
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