// YouTube.com Video File (flv) Downloader
// version 1.0 
// Copyright (c) 2006, Ronald Lachenal
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
// Sun Jan  1 03:52:45 PHT 2006
// 
// ==UserScript==
// @name          Youtube.com Video Download 
// @description	  Download Flash Videos from YouTube.com to .FLV files
// @include       http://youtube.com/*
// ==/UserScript==


(function(){
	  URI = document.location;
	  VideoID = URI.toString().split("v=")[1].split("&")[0];
		DownloadLink = "http://youtube.com/get_video.php?video_id=" + VideoID
	  if (VideoID != -1) { 
		  ContentBlock = document.getElementById("flashcontent");
		  ContentBlockParent = ContentBlock.parentNode;
		  
			NewDiv = document.createElement("div");
			ContentBlockParent.insertBefore(NewDiv, ContentBlock);
			NewDiv.innerHTML = "<div style=\"font-size: 12px; font-weight: bold; text-align: center; padding-bottom: 10px;\"><a href=\""+DownloadLink+"\">Download This Video (rename to .flv)</a></div>";
	 }
	}
)();

