Pages

Youtube Video Download

You can Download Video from youtube. NEW!!!


// ==UserScript==
// @name Download Video from YouTube
// @description adds a link to download flv from YouTube
// @include *youtube.com/*v=*
// ==/UserScript==

//
// By IE7pro Team
// Ported from http://userscripts.org/scripts/show/3982
// and from http://userscripts.org/scripts/show/4037
//

(function() {
function in2html(txt)
{
if (!txt) return '';
var txthtml = txt.replace(/&/g,'&').replace(//g,'>');
return(txthtml);
}

function get_videourl()
{
var scriptmedia=new Array();

scriptmedia=document.getElementsByTagName('SCRIPT');
for(i=0;i
source=scriptmedia[i].text.match(/video_id=\S+&.+&t=.+&/i);
if (source!=null)
{
return in2html(String(source).replace(/(video_id=.+)&l=.+(&t=.+)&/i,'http:\/\/www.youtube.com\/get_video?$1$2'));
}
}
return "";
}

//get video url from page source
var videourl = get_videourl();
//insert before the vidFacetsDiv
var elm = document.getElementById("watch-video-details-inner");
if(!elm) return;
var elm_parent = elm.parentNode;

var div = document.createElement("div");

elm_parent.insertBefore(div, elm);

div.innerHTML = '
';

})();

0 comments:

Post a Comment