firstProject

createButtonForDownloadYoutubeVideo

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey, Greasemonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals {tampermonkey_link:Tampermonkey}.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Userscripts.

Voor het installeren van scripts heb je een extensie nodig, zoals {tampermonkey_link:Tampermonkey}.

Voor het installeren van scripts heb je een gebruikersscriptbeheerder nodig.

(Ik heb al een user script manager, laat me het downloaden!)

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

(Ik heb al een beheerder - laat me doorgaan met de installatie!)

// ==UserScript==
// @name         firstProject
// @namespace    https://up.mewf.ru/
// @version      1.01
// @description  createButtonForDownloadYoutubeVideo
// @author       Klastor
// @match        https://www.youtube.com/*
// @grant        none
// ==/UserScript==
(function() {
        document.onreadystatechange = function(){
            if(document.readyState === 'complete'){
                let buttonLinks1 = window.document.location.href.replace("w.y", "w.ssy");
                let pictureIcon = document.createElement("img");
                let buttonText = document.createElement("p");
                let downloadButton = document.createElement("a");
                pictureIcon.src ="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGlkPSJGbGF0IiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHdpZHRoPSI1MTIiIGNsYXNzPSIiPjxnPjxyZWN0IGZpbGw9IiNmN2NjMzgiIGhlaWdodD0iMzM2IiByeD0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oPjxwYXRoIGQ9Im0yNDggMTYwaC0xNmE4IDggMCAwIDEgMC0xNmgxNmE4IDggMCAwIDEgMCAxNnoiIGRhdGEtb3JpZ2luYWw9IiNDM0M2QzciPjwvcGF0aD48L2c+PHBhdGggZD0ibTE4NC44NzkgNDIzLjk5NSA1NS4yOTMtNjQuNjExLTMxLjk5OC4zNTEtMS4wNTUtOTUuOTk0LTQ3Ljk5Ny41MjggMS4wNTUgOTUuOTk0LTMxLjk5OC4zNTF6IiBmaWxsPSIjZjc5NTM5IiBkYXRhLW9yaWdpbmFsPSIjRjc5NTM5IiBjbGFzcz0iYWN0aXZlLXBhdGgiIGRhdGEtb2xkX2NvbG9yPSIjZjc5NTM5IiBzdHlsZT0iZmlsbDojRTJEN0NEIj48L3BhdGg+PC9nPiA8L3N2Zz4=";
                pictureIcon.name = "icon";
                pictureIcon.alt = "download-icon";
                pictureIcon.style.objectFit = "contain";
                pictureIcon.style.height = "24px";
                pictureIcon.style.width = "24px";
                pictureIcon.style.borderRadius = "10px";
                buttonText.innerHTML = "скачать";
                buttonText.setAttribute("style","width: 65px;float:right;text-decoration: none;font-size: 1.3rem;font-weight: 500;display: block;overflow: hidden;text-overflow: ellipsis;white-space: nowrap; margin-left: 5px; padding-top: 7%; text-transform: uppercase;letter-spacing: -1px;color: #606060");
                downloadButton.href = buttonLinks1;
                downloadButton.target = "_blank";
                downloadButton.setAttribute('style', 'display: flex; flex-flow: wrap no wrap; text-decoration: none;');
                downloadButton.title = "Скачать видео";
                downloadButton.append(pictureIcon);
                downloadButton.append(buttonText);
                let parent = document.querySelector('#menu-container').insertAdjacentElement("beforeBegin", downloadButton);
                downloadButton.addEventListener('mouseover',()=>{
                    let buttonLinks2 = window.document.location.href.replace("w.y", "w.ssy");
                    downloadButton.href = buttonLinks2;
                })
    }
  }

        document.addEventListener("DOMContentLoaded", ()=>{
            setTimeout(location.reload, 5000);
});
})();