// ==UserScript== // @name YouTube Download // @namespace http://your.homepage/ // @version 2.9 // @description On youtube press F2 to download youtube videos. // @author Henry Harris // @match https://www.youtube.com/* // @match http://catchvideo.net/* // @grant none // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js // @run-at document-end // @downloadURL none // ==/UserScript== $(document).ready ( function(){ // -----------------------Runs on YOUTUBE-------------------------------------------------------------- if(window.location.href.indexOf("you") > -1) { if ($('#section-list').length > 0) { alert('Press F2 while watching a video to download it.'); } } // --------------------------RUNS ON KEEPVID TO DOWNLOAD VIDEO-------------------------------------------- if(window.location.href.indexOf("catch") > -1) { /*var iDiv = document.createElement('div'); iDiv.id = 'block'; iDiv.className = 'block'; document.getElementsByTagName('body')[0].appendChild(iDiv); iDiv.height = window.height(); iDiv.width = window.width(); $(iDiv).css({ position: 'fixed', top: 0, right: 0, bottom: 0, left: 0, zIndex: 999 });*/ if(!$('#javaUserWarning').is(':visible')) { setInterval(function(){ if ($(".thumb")[0]){ var els = document.getElementsByClassName('btn green'); var href = els[0].href window.location = href setTimeout(function(){ window.close(); }, 2000); } else { //alert("test"); } }, 3000); //document.getElementById("checkboxDisableJava1").checked = true; } else { alert("Please check disable java applet and retry."); } } }); // -----------------------Runs on YOUTUBE-------------------------------------------------------------- $(document).keydown(function (e) { if (e.keyCode == 113) { //window.open("http://keepvid.com/?url=" + document.URL) var a = document.createElement("a"); a.href = "http://catchvideo.net/?url=" + document.URL; var evt = document.createEvent("MouseEvents"); evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, true, false, false, false, 0, null); a.dispatchEvent(evt); } });