Youtube DL

Replaces the Youtube download buttons with ones that download the video without premium.

  1. // ==UserScript==
  2. // @name Youtube DL
  3. // @version 0.2
  4. // @description Replaces the Youtube download buttons with ones that download the video without premium.
  5. // @author Riley Campbell
  6. // @namespace https://hacker-point.com
  7. // @match https://*.youtube.com/*
  8. // @license https://opensource.org/license/bsd-3-clause/
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. function recreateNode(el) {
  15. var newEl = el.cloneNode(false);
  16. while (el.hasChildNodes()) newEl.appendChild(el.firstChild);
  17. return newEl
  18. }
  19.  
  20. setInterval(()=>{
  21. var dropDownDownload = document.querySelectorAll('tp-yt-paper-item[class*="ytd-menu-service-item-download-renderer"]')[0]
  22. var newdropDownDownload = recreateNode(dropDownDownload);
  23. newdropDownDownload.setAttribute('onclick', "window.open('https://api.hacker-point.com/ytdlp/?url=' + location.href, '_blank')")
  24. dropDownDownload.parentNode.replaceChild(newdropDownDownload, dropDownDownload)
  25. }, 200)
  26.  
  27. setInterval(()=>{
  28. var downloadButton = document.querySelectorAll('button[class="yt-spec-button-shape-next yt-spec-button-shape-next--tonal yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m yt-spec-button-shape-next--icon-leading "][aria-label="Download"]')[0]
  29. var newDownloadButton = recreateNode(downloadButton);
  30. newDownloadButton.setAttribute('onclick', "window.open('https://api.hacker-point.com/ytdlp/?url=' + location.href, '_blank')")
  31. downloadButton.parentNode.replaceChild(newDownloadButton, downloadButton)
  32. }, 200)
  33. })();