Greasy Fork is available in English.

YouTube Downloader Converter MP3

A download button will be added to YouTube videos that allow you to download the video in MP3-format. No java required!

  1. // ==UserScript==
  2. // @name YouTube Downloader Converter MP3
  3. // @description A download button will be added to YouTube videos that allow you to download the video in MP3-format. No java required!
  4. // @include http://*youtube.*/*watch*
  5. // @include https://*youtube.*/*watch*
  6. // @version 1.4.0
  7. // @namespace https://greasyfork.org/users/31593
  8. // ==/UserScript==
  9.  
  10. // ==ChangeLog==
  11. // @history 1.4.0 Server upgrade
  12. // @history 1.3.1 Quick tweak
  13. // @history 1.3.0 Compatible with the latest update
  14. // @history 1.2.2 Server update
  15. // @history 1.2.1 Server update
  16. // @history 1.11 Server edit
  17. // @history 1.00 Initial release.
  18. // ==/ChangeLog==
  19.  
  20.  
  21.  
  22. function addbutton(){
  23. console.log("dasd");
  24. if (window.location.href.match(/youtube.com/i)) {
  25. var DIV = document.createElement('span');
  26. //DIV.innerHTML = '';
  27. DIV.appendChild(document.createTextNode(''));
  28. DIV.style.cssFloat = "";
  29. var divp = document.getElementById("watch7-user-header");
  30. if (divp)
  31. divp.appendChild(DIV);
  32.  
  33. var url = encodeURIComponent(window.location);
  34.  
  35.  
  36. var INAU = document.createElement('input');
  37. INAU.setAttribute('type','button');
  38. INAU.setAttribute('name','INAU');
  39. INAU.setAttribute('value','Download');
  40. INAU.setAttribute('class','yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip');
  41. INAU.style.borderLeft = "";
  42. INAU.style.marginRight = "";
  43. INAU.style.marginLeft = "";
  44. INAU.style.borderRadius = "0 3px 3px 0";
  45. DIV.appendChild(INAU);
  46. INAU.addEventListener('click', function(){window.open("http://www.mp3convert.me/index.php?url=" + url + ""); self.focus();}, false);
  47. }
  48. }
  49.  
  50.  
  51. if (window.location.href.match(/youtube.com/i)) {
  52. var DIV = document.createElement('span');
  53. //DIV.innerHTML = '';
  54. DIV.appendChild(document.createTextNode(''));
  55. DIV.style.cssFloat = "";
  56. var divp = document.getElementById("watch7-user-header");
  57. if (divp)
  58. divp.appendChild(DIV);
  59.  
  60. var url = encodeURIComponent(window.location);
  61.  
  62.  
  63. var INAU = document.createElement('input');
  64. INAU.setAttribute('type','button');
  65. INAU.setAttribute('name','INAU');
  66. INAU.setAttribute('value','Download');
  67. INAU.setAttribute('class','yt-uix-tooltip-reverse yt-uix-button yt-uix-button-default yt-uix-tooltip');
  68. INAU.style.borderLeft = "";
  69. INAU.style.marginRight = "";
  70. INAU.style.marginLeft = "";
  71. INAU.style.borderRadius = "0 3px 3px 0";
  72. DIV.appendChild(INAU);
  73. INAU.addEventListener('click', function(){window.open("http://www.mp3convert.me/index.php?url=" + url + ""); self.focus();}, false);
  74.  
  75. var prevHash = window.location.href;
  76. //console.log(window.location.href);
  77. //console.log(prevHash);
  78. window.setInterval(function () {
  79. //console.log("setlocati:" + window.location.href);
  80. //console.log("sethash:" + prevHash);
  81. if (window.location.href != prevHash) {
  82. prevHash = window.location.href;
  83. //console.log("hrefdiff");
  84. addbutton();
  85. }
  86. }, 2000);
  87. }