// ==UserScript== // @name YouTube™ Ultimate Downloader v12.3 👑🌍 — Desktop & Mobile | Shorts, Videos & Music 🔥 - AdBlock 🛡️🚫 // @name:pt-BR YouTube™ Ultimate Downloader v12.3 👑🌍 — PC & Celular | Shorts, Vídeos & Música 🔥 - AdBlock 🛡️🚫 // @description Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:pt-BR Adiciona um botão flutuante para baixar vídeos, Shorts e músicas do YouTube em alta qualidade, com bloqueio de anúncios integrado para uma experiência rápida e suave. // @description:ar Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:bg Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:cs Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:da Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:de Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:el Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:eo Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:es Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:fi Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:fr Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:fr-CA Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:he Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:hu Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:id Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:it Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:ja Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:ko Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:nb Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:nl Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:pl Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:ro Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:ru Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:sk Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:sr Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:sv Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:th Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:tr Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:uk Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:ug Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:vi Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:zh-CN Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @description:zh-TW Adds a floating button to download YouTube videos, Shorts, and music in high quality, with built-in ad blocking for a fast and smooth experience. // @namespace https://greasyfork.org/users/152924 // @homepageURL https://greasyfork.org/scripts/34613 // @supportURL https://greasyfork.org/scripts/34613/feedback // @author Punisher // @version 12.3 RTM // @date 2026-03-11 // @icon https://iili.io/fOyuFFS.png // @compatible chrome // @compatible firefox // @compatible opera // @compatible safari // @compatible edge // @compatible brave // @license CC-BY-NC-ND-4.0 // @match https://*.youtube.com/* // @match https://music.youtube.com/* // @grant GM_addStyle // @run-at document-idle // @downloadURL none // ==/UserScript== (function () { "use strict"; let video; let ytPlayerBooting = true; setTimeout(() => { ytPlayerBooting = false; }, 1500); const floatBtnID = "ytPunisherBtn"; const btnColor = "#575656"; const MultiURL = [ {name: "Download 1", baseURL: "//y2mate.bet/watch?v=", useEncoder: false}, {name: "Download 2", baseURL: "//saveanyyoutube.com/watch?v=", useEncoder: false}, {name: "Download 3", baseURL: "//studiokitchen.ca/convert/?id=", useEncoder: false}, {name: "Download 4", baseURL: "//ssyoutube.is/convert/?videoId=", useEncoder: false}, {name: "Download 5", baseURL: "//yt1s.media/convert/?videoId=", useEncoder: false}, {name: "Download 6", baseURL: "//a2zyoutube.com/watch?v=", useEncoder: false}, ]; const cssSelectorArr=[".video-ads",".ytp-ad-module",".ytp-ad-player-overlay",".ytp-ad-overlay-container",".ytp-ad-overlay-slot",".ytp-ad-image-overlay",".ytp-ad-text-overlay",".ytp-ad-progress",".ytp-ad-button",".ytp-ad-click-target",".ytp-ad-preview-container",".ytp-ad-survey",".ytp-ad-skip-button",".ytp-ad-skip-button-modern",".ytp-ad-skip-button-container",".ad-showing",".ad-interrupting","#player-ads","#masthead-ad",".ytp-featured-product",".ytp-suggested-action","ytd-companion-ad-renderer","ytm-companion-ad-renderer","ytd-display-ad-renderer","ytd-ad-slot-renderer","ytd-in-feed-ad-layout-renderer","ytd-banner-promo-renderer","ytd-promoted-video-renderer","ytd-promoted-sparkles-web-renderer","ytd-search-pyv-renderer","ytd-sponsor-message-renderer","ytd-engagement-panel-section-list-renderer[target-id='engagement-panel-ads']","ytd-rich-item-renderer:has(ytd-ad-slot-renderer)","ytd-rich-section-renderer:has(ytd-ad-slot-renderer)","#related ytd-ad-slot-renderer","#secondary ytd-ad-slot-renderer","ytd-shorts-ad-renderer","#shorts-player ytd-ad-slot-renderer","ytd-reel-video-renderer ytd-ad-slot-renderer","lazy-list > ad-slot-renderer","tp-yt-paper-dialog:has(yt-mealbar-promo-renderer)","ytd-rich-grid-renderer ytd-ad-slot-renderer","[class*='ad-container']","[class*='ads-']","[class*='ad-slot']","[class*='ad-unit']","[class*='ad-banner']","[id*='ad-container']","[id*='ad-slot']","[data-ad-slot]","[data-ad-type]","[data-ad-format]",".ytd-ad-slot-renderer",".ytd-display-ad-renderer","ytd-video-masthead-ad","ytd-carousel-ad-renderer","[class*='promo']","[id*='promo']","[class*='ytp-ad']","[class^='ytp-ad']","[id^='ad-']","[class^='ad-']"]; const checkRunFlag = id => { if (document.getElementById(id)) return true; const style = document.createElement("style"); style.id = id; (document.head || document.body).appendChild(style); return false; }; const generateRemoveADCssText = arr => arr.map(s => `${s}{display:none!important}`).join(" "); const getVideoID = url => { try { const match = /(?:youtube\.com\/(?:watch\?v=|shorts\/)|youtu\.be\/)([0-9A-Za-z_-]{11})/.exec(url); return match?.[1] || null; } catch { return null; } }; const getVideoDom = () => video = document.querySelector(".ad-showing video") || document.querySelector("video"); const playAfterAd = () => { if (video && video.paused && video.currentTime < 1) video.play(); }; const generateRemoveADHTMLElement = id => { if (checkRunFlag(id)) return; const style = document.createElement("style"); style.appendChild(document.createTextNode(generateRemoveADCssText(cssSelectorArr))); (document.head || document.body).appendChild(style); }; const closeOverlay = () => { document.querySelectorAll("ytd-popup-container a[href='/premium']").forEach(el => el.closest("ytd-popup-container")?.remove()); document.querySelectorAll("tp-yt-iron-overlay-backdrop").forEach(el => { el.className = ""; el.removeAttribute("opened"); }); }; const nativeTouch=function(){ if(typeof Touch==='undefined'||typeof TouchEvent==='undefined'){this.click();return;} const t=new Touch({identifier:Date.now(),target:this,clientX:0,clientY:0}); this.dispatchEvent(new TouchEvent("touchstart",{bubbles:true,cancelable:true,touches:[t],targetTouches:[t],changedTouches:[t]})); this.dispatchEvent(new TouchEvent("touchend",{bubbles:true,cancelable:true,touches:[],targetTouches:[],changedTouches:[t]})); }; const skipAd = () => { if (!video) return; const player = document.querySelector(".html5-video-player"), isAd = player && player.classList.contains("ad-showing"); const btn = document.querySelector(".ytp-ad-skip-button,.ytp-skip-ad-button,.ytp-ad-skip-button-modern"), overlay = document.querySelector(".ytp-ad-player-overlay,.video-ads"); if (isAd) { video.muted = true; if (btn) { btn.click(); nativeTouch.call(btn); } if (video.duration) video.currentTime = video.duration; } if (!isAd && video.muted) video.muted = false; }; const removePlayerAD = (id) => { if (checkRunFlag(id)) return; const obs = new MutationObserver(() => { getVideoDom(); closeOverlay(); if (ytPlayerBooting) return; skipAd(); playAfterAd(); }); obs.observe(document.body, {childList: true, subtree: true}); }; function addFloatButton() { if (document.getElementById(floatBtnID)) return; const wrapper = document.createElement("div"); wrapper.id = floatBtnID; const mainBtn = document.createElement("button"); mainBtn.className = "punisher-main"; const menu = document.createElement("div"); menu.className = "punisher-menu"; function updateMenuSide() { const rect = wrapper.getBoundingClientRect(); const middle = window.innerWidth / 2; menu.classList.remove("left", "right"); if (rect.left > middle) menu.classList.add("left"); else menu.classList.add("right"); } MultiURL.forEach((link) => { const btn = document.createElement("button"); btn.textContent = link.name; btn.onclick = () => { const vid = getVideoID(location.href); if (!vid) return; const finalParam = link.useEncoder ? encodeURIComponent(location.href) : vid; window.open(link.baseURL + finalParam, "_blank"); menu.classList.remove("show"); }; menu.appendChild(btn); }); wrapper.appendChild(mainBtn); wrapper.appendChild(menu); let dragging = false, ox = 0, oy = 0; const limit = (x, y) => ({ x: Math.max(0, Math.min(x, innerWidth - wrapper.offsetWidth)), y: Math.max(0, Math.min(y, innerHeight - wrapper.offsetHeight)), }); const start = (x, y) => { dragging = true; const r = wrapper.getBoundingClientRect(); ox = x - r.left; oy = y - r.top; wrapper.style.cursor = "grabbing"; }; const move = (x, y) => { if (!dragging) return; const p = limit(x - ox, y - oy); wrapper.style.left = p.x + "px"; wrapper.style.top = p.y + "px"; wrapper.style.right = wrapper.style.bottom = "auto"; updateMenuSide(); }; const end = () => { dragging = false; wrapper.style.cursor = "grab"; }; mainBtn.onclick = (e) => { e.stopPropagation(); updateMenuSide(); menu.classList.toggle("show"); }; document.addEventListener("click", (e) => { if (!wrapper.contains(e.target)) menu.classList.remove("show"); }); wrapper.addEventListener("mousedown", e => start(e.clientX, e.clientY)); document.addEventListener("mousemove", e => move(e.clientX, e.clientY)); document.addEventListener("mouseup", end); wrapper.addEventListener("touchstart", e => start(e.touches[0].clientX, e.touches[0].clientY), { passive: true }); document.addEventListener("touchmove", e => move(e.touches[0].clientX, e.touches[0].clientY), { passive: true }); document.addEventListener("touchend", end); document.body.appendChild(wrapper); let hideTimer; function isFullscreen() { return document.fullscreenElement || document.webkitFullscreenElement; } function showButton() { wrapper.style.opacity = "1"; clearTimeout(hideTimer); if (isFullscreen()) { hideTimer = setTimeout(() => { wrapper.style.opacity = "0"; }, 3000); } } document.addEventListener("fullscreenchange", showButton); document.addEventListener("webkitfullscreenchange", showButton); document.addEventListener("mousemove", showButton); document.addEventListener("touchstart", showButton); showButton(); } GM_addStyle(`#${floatBtnID}{position:fixed;top:70%;right:20px;transform:translateY(-50%);z-index:9999;transition:opacity .3s ease} .punisher-main{background:${btnColor} url("https://iili.io/fObpSDv.png") no-repeat center;background-size:65%;width:60px;height:60px;border-radius:50%;border:none;box-shadow:0 6px 12px rgba(0,0,0,.3);cursor:pointer} .punisher-menu{display:none;flex-direction:column;position:absolute;top:50%;transform:translateY(-50%);background:#1f1f1f;border-radius:8px;overflow:hidden;min-width:110px} .punisher-menu.show{display:flex} .punisher-menu.left{right:70px} .punisher-menu.right{left:70px} .punisher-menu button{background:#2c2c2c;border:none;color:#fff;padding:8px 12px;cursor:pointer} .punisher-menu button:hover{background:#3a3a3a}`); generateRemoveADHTMLElement("yt-remove-ad-css"); removePlayerAD("yt-remove-player-ad"); const update = () => { addFloatButton(); }; let lastURL = location.href; let intervalDelay = 800; let urlChecker = null; function startURLMonitor() { if (urlChecker) clearInterval(urlChecker); urlChecker = setInterval(() => { if (document.hidden) return; const currentURL = location.href; if (currentURL !== lastURL) { lastURL = currentURL; update(); } }, intervalDelay); } document.addEventListener("visibilitychange", () => { intervalDelay = document.hidden ? 3000 : 800; startURLMonitor(); }); startURLMonitor(); let updateScheduled = false; const domObserver = new MutationObserver((mutations) => { if (updateScheduled) return; for (const m of mutations) { if (m.addedNodes && m.addedNodes.length) { updateScheduled = true; requestAnimationFrame(() => { update(); updateScheduled = false; }); break; } } }); domObserver.observe(document.body, {childList: true, subtree: true}); update(); })();