Created
December 16, 2012 00:27
-
-
Save GeorgeErickson/4301406 to your computer and use it in GitHub Desktop.
Shitty script to download 7.012 lectures at 2x speed
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/python | |
# shitty script to download bio lectures so I can watch them at 2x speed. | |
# Requires rtmpdump (http://rtmpdump.mplayerhq.hu/). Can install via homebrew | |
import subprocess | |
LECTURES = { | |
'dec': [3,5,7,10,12], | |
'nov': [2,5,7,9,14,16,19,21,26,30], | |
'oct': [3,5,10,12,15,17,19,22,24,26], | |
'sept': [5,7,10,12,14,17,19,24,26,28], | |
} | |
def get_video_by_date(month, day): | |
server_filename = "mp4:2013f/mit-7.012-lec-mit-26100-2012%s%02d-1000.f4v" % (month, day) | |
local_filename = "%s%02d.flv" % (month, day) | |
p = subprocess.Popen(["rtmpdump", | |
"-r", "rtmp://flashsvr2.amps.ms.mit.edu:1935/7.012?ovpfv=1.1", | |
"-a", "7.012?ovpfv=1.1", | |
"-f", "LNX 10,1,82,76", | |
"-W", "http://amps-web.amps.ms.mit.edu/public/courses/7/7.012/2012f/L01/AkamaiFlashPlayer.swf", | |
"-y", server_filename, | |
"-o", local_filename]) | |
p.communicate() | |
if __name__ == "__main__": | |
for month, day_list in LECTURES.items(): | |
for day in day_list: | |
get_video_by_date(month, day) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment