// ==UserScript== // @name Save YouTube as File // @namespace http://yadorigi.seesaa.net/ // @author cuckoo // @include http://www.youtube.*/* // @include http://youtube.*/* // @description Save YouTube videos as FLV file. // ==/UserScript== // generate download url var video_url = "http://youtube.com/get_video?video_id="+location.href.split("=")[1]+document.getElementById("interactDiv").innerHTML.match(/&t=[^"]+/); // add download link var download_link = document.createElement("div"); download_link.innerHTML = '

Save as File Save as File
'; var elements_div = document.getElementsByTagName('div'); for(var i = 0; i < elements_div.length; i++) { var classNames = elements_div[i].className.split(' '); for(var j = 0; j < classNames.length; j++) { if (classNames[j] == "actionsDiv") { elements_div[i].insertBefore(download_link, elements_div[i].firstChild); return; } } }