any ANONYMOUS forum user
02-02-2010, 12:16 AM
I used the following javascript for downloading youtube videos:
javascript:window.open('http://youtube.com/get_video?video_id='+window.location.href.split('? ')[1].match(/v=([^(&|$)]*)/)[1]+'&t='+document.getElementById('movie_player').src.ma tch(/t=([^(&|$)]*)/)[1]);
It worked like a charm, but for whatever reason I can't use it any longer. Is there any update to this script? Or is it my browser to blame
any ANONYMOUS forum user
02-02-2010, 12:51 AM
Try the following bookmarklet
javascript:(function(){if(document.getElementById( 'download-youtube-video'))return;var%20args=null,video_title=null,vi deo_id=null,video_hash=null;var%20download_code=ne w%20Array();var%20fmt_labels={'18':'standard%20MP4 ','22':'HD%20720p','37':'HD%201080p'};try{args=yt. getConfig('SWF_ARGS');video_title=yt.getConfig('VI DEO_TITLE')}catch(e){}if(args){var%20fmt_url_map=u nescape(args['fmt_url_map']);if(fmt_url_map=='')return;video_id=args['video_id'];video_hash=args['t'];video_title=video_title.replace(/[%22\'\?\\\/\:\*%3C%3E]/g,'');var%20fmt=new%20Array();var%20formats=fmt_ur l_map.split(',');var%20format;for(var%20i=0;i%3Cfo rmats.length;i++){var%20format_elems=formats[i].split('|');fmt[format_elems[0]]=unescape(format_elems[1])}for(format%20in%20fmt_labels){if(fmt[format]!=null){download_code.push('%3Ca%20href=\''+(fmt[format]+'&title='+video_title)+'\'%3E'+fmt_labels[format]+'%3C/a%3E')}else%20if(format=='18'){download_code.push( '%3Ca%20href=\'http://www.youtube.com/get_video?fmt=18&video_id='+video_id+'&t='+video_hash+'\'%3E'+fmt_labels[format]+'%3C/a%3E')}}}if(video_id==null||video_hash==null)retur n;var%20div_embed=document.getElementById('watch-embed-div');if(div_embed){var%20div_download=document.cr eateElement('div');div_download.innerHTML='%3Cbr%2 0/%3E%3Cspan%20id=\'download-youtube-video\'%3EDownload:%20'+download_code.join('%20|%2 0')+'%3C/span%3E';div_embed.appendChild(div_download)}})(); void(0)
Stream Recorder
02-02-2010, 12:56 AM
The following bookmarklet works for me in Google Chrome:
javascript:window.location.href = 'http://youtube.com/get_video?video_id=' + yt.getConfig("SWF_ARGS")['video_id'] + "&sk=" + yt.getConfig("SWF_ARGS")['sk'] + '&t=' + yt.getConfig("SWF_ARGS")['t'];
any ANONYMOUS forum user
02-02-2010, 12:59 AM
And here is another working bookmarklet
javascript:var fmt=35;var success=0;var fmt_url_map = unescape(yt.getConfig("SWF_ARGS")['fmt_url_map']);var fmt_url_a = fmt_url_map.split(',');for(idx in fmt_url_a){fmt_url_a[idx]=fmt_url_a[idx].split('|');if(fmt_url_a[idx][0]==fmt){window.location.assign(fmt_url_a[idx][1]);success=1;break;}}if(success==0){var err_msg = "Video available in these formats:\n";for(idx in fmt_url_a){switch(fmt_url_a[idx][0]){case '5':err_msg+=".flv FLV1-320x240 MP3-22k-mono fmt=5\n";break;case '18':err_msg+=".mp4 H264-480x360 AAC-44k-st fmt=18\n";break;case '22':err_msg+=".mp4 H264-1280x720 AAC-44k-st fmt=22\n";break;case '34':err_msg+=".flv H264-320x240 AAC-22k-st fmt=34\n";break;case '35':err_msg+=".flv H264-480x368 AAC-44k-st fmt=35\n";break;case '37':err_msg+=".mp4 H264-1920x1080 AAC-44k-st fmt=37\n";break;default:err_msg+="unknown format fmt="+fmt_url_a[idx][0]+"\n";};};alert(err_msg);};
If the video doesn't have the requested fmt version a popup will display available fmt for download. You can replace the value of the variable fmt to download the version you want.
The highest quality version is usually first in the list so the following bookmarklet will download the highest quality video file:
javascript:var fmt_url_map = unescape(yt.getConfig("SWF_ARGS")['fmt_url_map']);if(fmt_url_map.indexOf(',') != -1){window.location.assign(fmt_url_map.substring(fm t_url_map.indexOf('|')+1, fmt_url_map.indexOf(',')))}else window.location.assign(fmt_url_map.substring(fmt_u rl_map.indexOf('|')+1));
vBulletin® , Copyright ©2000-2025, Jelsoft Enterprises Ltd.