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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s