All the current tutorials on making your own youtube video downloader are outdated. The whole token insertion from video info does not work, and neither does using the javas
As of today 15/06/2012 is really simple; but you have to be watch for future changes. Here it is (in Javascript)
try{
var urls = document.body.innerHTML.match(/"url_encoded_fmt_stream_map": "url=([^"]+)/)[1]
urls = decodeURIComponent(urls).replace(/\\u0026/g,'&')
urls = urls.replace(/&quality.+?(?=,url)/g,'');;
urls = urls.split(',url=')
// urls is an array of all the possible qualities
// To download one you could use something like:
// document.location = urls[0]
// The first one is usually in the highest quality available
} catch(e){
console.error("Youtube may have changed its API")
}