#!/usr/bin/python import subprocess,sys,string # Grab the videos using mencoder. Do it one at a time using 'call' instead of 'popen' def strip(url): newurl = "mms"+url[url.find(":"):] print newurl vidname = url[url.rfind("/")+1:url.rfind("?")] print "mencoder %s -ovc copy -oac copy -o %s.avi" % (newurl,vidname) p1 = subprocess.call(["mencoder", newurl, "-ovc","copy","-oac","copy","-o", ("%s.avi" % (vidname,))]) # Download links that are stored in a file, one link per line def downloadClass(filename): f = open(filename, 'r') for url in f: url = string.rstrip(url, '\n') strip(url) downloadClass('filenamehere')