How can you get the flv file from the youtube page, for example: www.youtube.com/watch? v = T8YCSJpF4g4 ... Any ideas?
So far I have tried:
import urllib import os import sys page=urllib.urlopen('http://www.youtube.com/watch?v=FuLDIgfPae8') result = page.read() #result=open("test.html").read() print result startindex = result.index("var swfArgs") result = result[startindex:] endindex=result.index("};") result=result[:endindex] result = result.split(",") get={} print result def download(url,output): """Copy the contents of a file from a given URL to a local file.""" webFile = urllib.urlretrieve(url,output+".flv") for line in result: if "video_id" in line or "\"t\"" in line : v,vnum = line.replace("\"","").split(":") get[v.strip()]=vnum.strip() dload = "http://www.youtube.com/get_video?video_id=%s&t=%s" % ( get['video_id'],get['t']) try : download(dload,get['video_id']) except Exception,e: print "Error: ",e
but this gives me an error:
startindex = result.index("var swfArgs") ValueError: substring not found
and im not sure how to fix this error.
@icktoofay
How would I respond to all these requests ?:

Please help, this is killing me.
source share