Greasy Fork is available in English.

Youtube Video Converter | MP3,MP4

made by doktoburu

Ekde 2021/04/18. Vidu La ĝisdata versio.

// ==UserScript==
// @name         Youtube Video Converter | MP3,MP4
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  made by doktoburu
// @author       doktoburu
// @match        *://www.youtube.com/*
// @icon         https://www.google.com/s2/favicons?domain=youtube.com
// @grant        none
// ==/UserScript==

(function () {
    function urlCut(url) {
        var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
        var match = String(url).match(regExp);
        return match && match[7].length == 11 ? match[7] : false;
    }

    function createButton() {
        var convertButton = document.createElement("div");
        var downloadText = document.createElement("p");
        convertButton.id = "esmanur";
        convertButton.style.padding = "16px";
        convertButton.style.position = "fixed";
        convertButton.style.backgroundColor = "red";
        convertButton.style.zIndex = "10000";
        convertButton.style.top = "91vh";
        convertButton.style.right = "2vw";
        convertButton.style.transition = "all 0.6s";
        convertButton.style.borderRadius = "16px";
        convertButton.style.boxShadow = "rgba(0, 0, 0, 0.35) 0px 5px 15px";
        convertButton.style.cursor = "pointer";
        downloadText.textContent = "DOWNLOAD";
        downloadText.style.color = "white";
        downloadText.style.fontSize = "25px";

        convertButton.onmouseover = function () {
            convertButton.style.backgroundColor = "darkRed";
        };
        convertButton.onmouseleave = function () {
            convertButton.style.backgroundColor = "red";
        };

        convertButton.onclick = function () {
            window.open("https://www.y2mate.com/youtube/" + urlCut(document.URL), "_blank");
        };

        document.body.appendChild(convertButton);
        convertButton.appendChild(downloadText);
    }
    createButton();
})();