views:

42

answers:

1

Welcome,

I'm looking for youtube api what allow me to download youtube video in highest possible format.

Few years ago this job was more simple because url had information about quality like "fmt=22" or "fmt=6" right now we are live in future and that information is embed in player.

Now it's more complex... google use cache servers and get_video doesn't work.

Look for example: http://www.youtube.com/watch?v=XIz-MmKeoCs (it's just example with HD don't comment music)

Right now i'm using old PHPtube class (2007 year). phpclasses.org/browse/package/3966.html It allow only to download file in lowest quality via flv.

My question is, anyone have class what allow download in highest possible ?

I give video ID -> XIz-MmKeoCs It should check what quality is possible for download. Right now i don't have any idea how get it...

And give download link. (of course i know about security used by IP, and want download file on my server using file_contents) but i got trouble only with getting that download link.

I will be great for any help...

A: 

If you pull a video page, parse it and look for &fmt_url_map= the stuff after here is a map of format id => download link. You have to do a little parsing of it but have a look and it's not that complicated.

The problem is that if you are developing this on your machine, it will work, but if you want to put it live it will not work as the download urls have some sort of signature that only applies for the machine that pulled the video page, which in this case will not match with your local machine.

jmoz