PDA

View Full Version : Youtube stopped working


rodejo16
2008-10-24, 20:38
Does anyone still have a working Youtube script or plugin?

I noticed today that it seems no longer be possible to construct the URL of the flv file out of the swf file.

Youtube has changed the redirected URL. This URL does no longer contain the &t parameter.

Please let me know if someone has a working solution.

Rodejo

rwparris2
2008-10-24, 21:11
this is slightly modified from something voinage did at some point. it still seems to be working using &t
def getFlv(url):
p=re.compile('http://www.youtube.com/watch\?v=(.*)')
match=p.findall(url)
for code in match:
print 'code='+code
req = urllib2.Request('http://www.youtube.com/watch?v='+code)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14')
response = urllib2.urlopen(req)
link=response.read()
response.close()
p=re.compile('"t": "(.+?)"')
match=p.findall(link)
for blah in match:
linkage="http://www.youtube.com/get_video?video_id="+code+"&t="+blah+"&fmt=18"
return linkage

rodejo16
2008-10-24, 23:06
Thanks for your information and quick reply.

I solved it and Youtube is working again.

Rodejo.