Download Youtube Videos

By Binny V A Last update Nov 30, 2008 — Installed 27,980 times. Daily Installs: 17, 13, 4, 4, 9, 6, 6, 7, 9, 5, 5, 11, 10, 0, 10, 3, 11, 12, 10, 8, 7, 8, 4, 10, 3, 6, 1, 9, 17, 0, 3, 7

There are 1 previous version of this script.

// ==UserScript==
// @name          Download Youtube Videos
// @description	  Adds a link to download the FLV file under every video in Youtube. Make sure that you name the video file 'something.flv'(The extension must be 'flv')
// @namespace     http://www.openjs.com/
// @include       http://youtube.com/*
// @include       http://*.youtube.com/*

//by Binny V A (http://www.openjs.com/)
// ==/UserScript==

(function() {
	var swfArgs = unsafeWindow.swfArgs;
	if (swfArgs) {
		var keys = ["video_id", "sk", "t"];
		var params = keys.map(function(k) { return k + "=" + swfArgs[k]; }).join("&");
		
		//Create the link
		var link = document.createElement('a');
		link.href= "http://www.youtube.com/get_video?" + params;
		var txt = document.createTextNode("Download this Video");
		link.appendChild(txt);
		document.getElementById('watch-player-div').appendChild(link);
	}
})();