Audio/video stream recording forums

Free Tutorials: How to Capture Streaming Video and Audio
Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > Video stream recording
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 02-02-2010, 12:16 AM
any ANONYMOUS forum user any ANONYMOUS forum user is offline
any user of the forum who preferred to post anonymously
 
Join Date: Jan 2010
Posts: 325
any ANONYMOUS forum user is on a distinguished road
Default

Downloading YouTube videos with JavaScript


I used the following javascript for downloading youtube videos:

Code:
javascript:window.open('http://youtube.com/get_video?video_id='+window.location.href.split('?')[1].match(/v=([^(&|$)]*)/)[1]+'&t='+document.getElementById('movie_player').src.match(/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
Reply With Quote
  #2  
Old 02-02-2010, 12:51 AM
any ANONYMOUS forum user any ANONYMOUS forum user is offline
any user of the forum who preferred to post anonymously
 
Join Date: Jan 2010
Posts: 325
any ANONYMOUS forum user is on a distinguished road
Default

Re: Downloading YouTube videos with JavaScript


Try the following bookmarklet
Code:
javascript:(function(){if(document.getElementById('download-youtube-video'))return;var%20args=null,video_title=null,video_id=null,video_hash=null;var%20download_code=new%20Array();var%20fmt_labels={'18':'standard%20MP4','22':'HD%20720p','37':'HD%201080p'};try{args=yt.getConfig('SWF_ARGS');video_title=yt.getConfig('VIDEO_TITLE')}catch(e){}if(args){var%20fmt_url_map=unescape(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_url_map.split(',');var%20format;for(var%20i=0;i%3Cformats.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)return;var%20div_embed=document.getElementById('watch-embed-div');if(div_embed){var%20div_download=document.createElement('div');div_download.innerHTML='%3Cbr%20/%3E%3Cspan%20id=\'download-youtube-video\'%3EDownload:%20'+download_code.join('%20|%20')+'%3C/span%3E';div_embed.appendChild(div_download)}})();void(0)
Reply With Quote
  #3  
Old 02-02-2010, 12:56 AM
Stream Recorder Stream Recorder is online now
Stream recording guru
 
Join Date: Nov 2005
Posts: 4,739
Stream Recorder is just really niceStream Recorder is just really niceStream Recorder is just really niceStream Recorder is just really nice
Default

Re: Downloading YouTube videos with JavaScript


The following bookmarklet works for me in Google Chrome:
Code:
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'];
Reply With Quote
  #4  
Old 02-02-2010, 12:59 AM
any ANONYMOUS forum user any ANONYMOUS forum user is offline
any user of the forum who preferred to post anonymously
 
Join Date: Jan 2010
Posts: 325
any ANONYMOUS forum user is on a distinguished road
Default

Re: Downloading YouTube videos with JavaScript


And here is another working bookmarklet
Code:
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:
Code:
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(fmt_url_map.indexOf('|')+1, fmt_url_map.indexOf(',')))}else window.location.assign(fmt_url_map.substring(fmt_url_map.indexOf('|')+1));
Reply With Quote
Reply Post New Thread


Tags: , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
YouTube video downloaders: How to Record/Capture/Download flash videos from YouTube Stream Recorder Video stream recording 16 01-11-2010 01:14 PM
(Mac OS) How to download YouTube videos, upload videos to YouTube, play .FLV files ella Video stream recording 0 02-01-2009 07:52 PM
The best web-browser plug-in for downloading YouTube videos any ANONYMOUS forum user Video stream recording 2 01-03-2009 02:26 PM
Freeware YouTube converters - Converting YouTube videos to other audio/video formats Stream Recorder Converting audio/video files 1 02-19-2008 07:52 AM


All times are GMT -6. The time now is 02:17 AM.


Powered by All-streaming-media.com; 2006-2009