YouTube™ Multi Downloader v8.9 🌐🚀💯 - YTMP3-Convert.com (NO ADS & NEW LAYOUT FOR YT! 🚫🤩)

This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!

目前為 2024-09-04 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name YouTube™ Multi Downloader v8.9 🌐🚀💯 - YTMP3-Convert.com (NO ADS & NEW LAYOUT FOR YT! 🚫🤩)
// @name:pt-BR YouTube™ Multi Downloader v8.9 🌐🚀💯 - YTMP3-Convert.com (SEM ANÚNCIOS & NOVO LAYOUT PARA YT! 🚫🤩)
// @description This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:pt-BR Esse script adiciona um botão de download, uma maneira mais rápida de baixar áudio e vídeo do YouTube e com qualidade garantida. Este site é muito simples, rápido e eficaz para baixar! Melhor de todos!
// @description:ar This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:bg This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:cs This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:da This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:de This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:el This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:eo This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:es This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:fi This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:fr This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:fr-CA This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:he This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:hu This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:id This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:it This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:ja This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:ko This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:nb This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:nl This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:pl This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:ro This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:ru This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:sk This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:sr This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:sv This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:th This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:tr This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:uk This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:ug This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:vi This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:zh-CN This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @description:zh-TW This script adds a download button, a faster way to download audio and video from YouTube with guaranteed quality. This site is very simple, fast and effective to download! Best of all!
// @namespace https://greasyfork.org/users/152924
// @homepageURL https://greasyfork.org/scripts/34613
// @supportURL https://greasyfork.org/scripts/34613/feedback
// @author Punisher
// @version 8.9
// @date 2024-09-03
// @icon https://i.imgur.com/InuDDVK.png
// @compatible chrome
// @compatible firefox
// @compatible opera
// @compatible safari
// @compatible edge
// @license CC-BY-NC-ND-4.0
// @match https://*.youtube.com/*
// @grant GM_addStyle
// @run-at document-idle
// ==/UserScript==

(function() {
    const punisherYT = "https://ytmp3-convert.com/?url=";
    const tubeID = "dwnldBtn";
    const currentButton = "#owner";
    const addClick = `
        #${tubeID} {
            background-color: #F1F1F1;
            color: #FF0000;
            border: 1px solid;
            border-color: rgba(255,255,255,0.2);;
            margin-left: 8px;
            padding: 0 16px;
            border-radius: 18px;
            font-size: 14px;
            font-family: Roboto, Noto, sans-serif;
            font-weight: 500;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            height: 36px;
            line-height: normal;
        }
        #${tubeID}:hover {
            background-color: #D9D9D9;
            color: #FF0000;
            border-color: #F1F1F1;
        }
    `;
    GM_addStyle(addClick);

    function inspectPg(selector) {
        return new Promise(resolve => {
            if (document.querySelector(selector)) {
                return resolve(document.querySelector(selector));
            }
            const observer = new MutationObserver(mutations => {
                if (document.querySelector(selector)) {
                    resolve(document.querySelector(selector));
                    observer.disconnect();
                }
            });
            observer.observe(document.body, { childList: true, subtree: true });
        });
    }

    function addButton() {
        inspectPg(currentButton).then((btnContainer) => {
            if (!btnContainer) {
                return;
            }
            if (document.querySelector(`#${tubeID}`)) {
            } else {
                const downloadBtn = document.createElement('a');
                downloadBtn.href = `${punisherYT + decodeURIComponent(window.location.href)}`;
                downloadBtn.target = '_blank';
                downloadBtn.id = tubeID;
                downloadBtn.innerText = 'Download';
                btnContainer.appendChild(downloadBtn);
            }
        });
    }

    function pageLoad() {
        inspectPg(`#${tubeID}`).then((btn) => {
            if (!btn) {
                return;
            }
            btn.href = punisherYT + decodeURIComponent(window.location.href);
        });
    }

    let buttonSet = false;
    function checkButton() {
        if (window.location.pathname === '/watch' && !buttonSet) {
            addButton();
            buttonSet = true;
            setTimeout(pageLoad, 2000);
        }
    }
    window.addEventListener("yt-navigate-finish", () => {
        buttonSet = false;
        checkButton();
    });
    checkButton();
})();