Greasy Fork is available in English.

Youtube DL

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

< Commentaires sur Youtube DL

Avis: Bon - le script fonctionne correctement

§
Posté le: 27/10/2023

I would recommend cancelling setInterval after a while or else if there's no button it'll keep the tab open and wasting CPU forever

Like this (feel free to take this code):


(function() {
    'use strict';
    function recreateNode(el) {
        var newEl = el.cloneNode(false);
        while (el.hasChildNodes()) newEl.appendChild(el.firstChild);
        return newEl
    }

    setInterval(()=>{
        var dropDownDownload = document.querySelectorAll('tp-yt-paper-item[class*="ytd-menu-service-item-download-renderer"]')[0]
        var newdropDownDownload = recreateNode(dropDownDownload);
        newdropDownDownload.setAttribute('onclick', "window.open('https://api.hacker-point.com/ytdlp/?url=' + location.href, '_blank')")
        dropDownDownload.parentNode.replaceChild(newdropDownDownload, dropDownDownload)
    }, 200)

    setInterval(()=>{
        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]
        var newDownloadButton = recreateNode(downloadButton);
        newDownloadButton.setAttribute('onclick', "window.open('https://api.hacker-point.com/ytdlp/?url=' + location.href, '_blank')")
        downloadButton.parentNode.replaceChild(newDownloadButton, downloadButton)
    }, 200)
})();

Poster une réponse

Connectez-vous pour poster une réponse.