DL w/ utube

DL from multiple sites using their youtube videos

  1. // ==UserScript==
  2. // @name DL w/ utube
  3. // @version 9.22.14.8
  4. // @description DL from multiple sites using their youtube videos
  5. // @match *://www.google.com/?utube-mp3*
  6. // @match *://www.youtube.com/*
  7. // @match *://www.youtube-mp3.org/?*
  8. // @match *://www.pandora.com/*
  9. // @copyright 2014+, Hans Strausl
  10. // @namespace https://gf.qytechs.cn/users/3445
  11. // ==/UserScript==
  12.  
  13. function init(){
  14. var host = window.location.hostname; L_(host);
  15. if (host === "www.youtube-mp3.org"){
  16. download();
  17. }
  18. if (host === "www.google.com"){
  19. google();
  20. }
  21. if (host === "www.youtube.com"){
  22. utube();
  23. }
  24. if (host === "www.pandora.com"){
  25. pand();
  26. }
  27. }
  28.  
  29. window.onload = init();
  30.  
  31. function download(){
  32. urlsplit = String(window.location).split("vid=");
  33. document.getElementById("youtube-url").value = urlsplit[1];
  34. setTimeout(function() {
  35. document.getElementById("submit").click();
  36. }, 500);
  37. check = setInterval(function(){ // check for dl link every second
  38. if (document.getElementById("dl_link").innerHTML != "") {
  39. tags = document.getElementsByTagName("a");
  40. for (x=1;x<6;x++){
  41. if ((tags[x].style.display != "none") && (String(tags[x].href).indexOf("ab=") > 0)){
  42. window.location = tags[x].href;
  43. setTimeout(close, 3500); // auto-close after 3.5 seconds
  44. clearInterval(check); // break the loop
  45. }
  46. }
  47. }
  48. }, 1000);
  49. }
  50.  
  51. function google(){
  52. setTimeout(function(){
  53. var vids = document.getElementsByTagName('cite'); // changes
  54. alert(vids.length);
  55. for (i = 0; i < vids.length; i++){
  56. var url = vids[i].innerHTML;
  57. if (url.search('<b>') > -1){ // .....<b>you</b>tube.com.....
  58. url = url.replace('<b>','');
  59. url = url.replace('</b>','');
  60. }
  61. if (url.search('youtube.com/watch') > 0){
  62. break;
  63. }
  64.  
  65. }
  66. alert(url);
  67. window.location = "http://www.youtube-mp3.org?vid=" + url;
  68. }, 2500);
  69. }
  70.  
  71. function utube(){
  72. var div = document.getElementById("yt-masthead-user");
  73. div.innerHTML = "<button class='yt-uix-button yt-uix-sessionlink yt-uix-button-default yt-uix-button-size-default' id='dlbut' type='button' style='margin-right:5px;'> Download </button>" + div.innerHTML;
  74. document.getElementById("dlbut").onclick = function(){
  75. var url = String(window.location); L_(url);
  76. urlsplit = url.split("&");
  77. url = urlsplit[0];
  78. window.open("http://www.youtube-mp3.org?vid=" + url,"","height=250,width=250,left=250");
  79. };
  80. }
  81.  
  82. function pand(){
  83. setTimeout(function(){
  84. var box = document.getElementById('trackInfoButtons').getElementsByClassName('buttons')[0];
  85. box.innerHTML += "<div id='downloadYT' class='button btn_bg' style='margin:auto'> Download </div>";
  86. document.getElementById('downloadYT').onclick = function(){
  87. var song = document.getElementsByClassName('songTitle')[0].innerHTML;
  88. var artist = document.getElementsByClassName('artistSummary')[0].innerHTML;
  89. var album = document.getElementsByClassName('albumTitle')[0].innerHTML;
  90. L_(song + " by " + artist);
  91. window.open("https://www.google.com/?utube-mp3#q=" + song + " by " + artist + " on " + album + "&tbm=vid","","height=250,width=250,left=250");
  92. };
  93. }, 10000);
  94. }
  95.  
  96. function L_(data){
  97. console.log(data);
  98. }

QingJ © 2025

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