Live Video Downloader

I wrote a python program that downloaded the live videos we did as they were being broadcasted for archive purposes. All of the actual work is done by a program called mplayer, but my program makes sure that it keeps trying to get the stream until 10pm.

import datetime
import os, time

#loop until 10pm
while datetime.datetime.now().time() < datetime.time(22): 
    filename = datetime.datetime.now().strftime('%y-%m-%d-%H-%M.wmv')
    stream = 'mms://win91va.audiovideoweb.com/va91winlive2090'
    os.system('mplayer -dumpstream -dumpfile %s %s' % (filename, stream))
    #pause 2 seconds
    time.sleep(2)
Advertisements