YouTube Download

On youtube press F2 to download youtube videos.

当前为 2015-04-16 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name YouTube Download
  3. // @namespace http://your.homepage/
  4. // @version 2.8
  5. // @description On youtube press F2 to download youtube videos.
  6. // @author Henry Harris
  7. // @match https://www.youtube.com/*
  8. // @match http://catchvideo.net/*
  9. // @grant none
  10. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
  11. // @run-at document-end
  12. // ==/UserScript==
  13.  
  14.  
  15.  
  16.  
  17.  
  18. $(document).ready ( function(){
  19. // -----------------------Runs on YOUTUBE--------------------------------------------------------------
  20. if(window.location.href.indexOf("you") > -1) {
  21. if ($('#section-list').length > 0) {
  22. alert('Press F2 while watching a video to download it.');
  23. }
  24. }
  25. // --------------------------RUNS ON KEEPVID TO DOWNLOAD VIDEO--------------------------------------------
  26. if(window.location.href.indexOf("catch") > -1) {
  27. /*var iDiv = document.createElement('div');
  28.  
  29. iDiv.id = 'block';
  30. iDiv.className = 'block';
  31. document.getElementsByTagName('body')[0].appendChild(iDiv);
  32. iDiv.height = window.height();
  33. iDiv.width = window.width();
  34. $(iDiv).css({
  35. position: 'fixed',
  36. top: 0,
  37. right: 0,
  38. bottom: 0,
  39. left: 0,
  40. zIndex: 999
  41. });*/
  42.  
  43.  
  44.  
  45. if(!$('#javaUserWarning').is(':visible')) {
  46. //document.getElementById("checkboxDisableJava1").checked = true;
  47. //var url = document.URL;
  48. //var hash = url.substring(url.indexOf('?')+1);
  49. // var textbox = document.getElementById("home_search_q");
  50. // textbox.value = hash;
  51. //$('#home_search_submit').click();
  52. setTimeout(function(){
  53. //$("#grab1").click();
  54. //var href = $( "a span:first-child" ).attr('href');
  55. //var firstspan = $('a.btn green:first');
  56. //var href = $( "#firstspan" ).attr('href');
  57. var els = document.getElementsByClassName('btn green');
  58. //alert("JS: " + els[0].innerHTML); // hello1
  59. var href = els[0].href
  60. window.location = href
  61. setTimeout(function(){
  62. window.close();
  63. }, 2000);
  64. }, 11000);
  65.  
  66. } else {
  67. alert("Please check disable java applet and retry.");
  68. }
  69. }
  70. });
  71.  
  72. // -----------------------Runs on YOUTUBE--------------------------------------------------------------
  73. $(document).keydown(function (e) {
  74. if (e.keyCode == 113) {
  75. //window.open("http://keepvid.com/?url=" + document.URL)
  76. var a = document.createElement("a");
  77. a.href = "http://catchvideo.net/?url=" + document.URL;
  78. var evt = document.createEvent("MouseEvents");
  79. evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, true, false, false, false, 0, null);
  80. a.dispatchEvent(evt);
  81. }
  82. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址