🎬 YouTube 视频下载|HD/2K/4K超清🔥|Video & 🎵Audio 📥

📥 Download YouTube 4K/2K/1080P in one click🔥 | ⚡ Super fast & free🆓 | 🎬 Video + 🎵 Audio | No watermark✅ No sign-up

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         🎬 YouTube 视频下载|HD/2K/4K超清🔥|Video & 🎵Audio 📥
// @name:ar      🎬 تحميل YouTube | جودة HD/2K/4K🔥 | فيديو & 🎵صوت 📥
// @name:bg      🎬 YouTube Изтегляне | HD/2K/4K🔥 | Видео & 🎵Аудио 📥
// @name:cs      🎬 YouTube Stahovač | HD/2K/4K🔥 | Video & 🎵Audio 📥
// @name:da      🎬 YouTube Downloader | HD/2K/4K🔥 | Video & 🎵Lyd 📥
// @name:de      🎬 YouTube Downloader | HD/2K/4K🔥 | Video & 🎵Audio 📥
// @name:el      🎬 YouTube Λήψη | HD/2K/4K🔥 | Βίντεο & 🎵Ήχος 📥
// @name:en      🎬 YouTube Downloader | HD/2K/4K🔥 | Video & 🎵Audio 📥
// @name:eo      🎬 YouTube Elŝutilo | HD/2K/4K🔥 | Video & 🎵Aŭdio 📥
// @name:es      🎬 Descargador YouTube | HD/2K/4K🔥 | Video & 🎵Audio 📥
// @name:es-419  🎬 Descargador YouTube | HD/2K/4K🔥 | Video & 🎵Audio 📥
// @name:fi      🎬 YouTube Lataaja | HD/2K/4K🔥 | Video & 🎵Ääni 📥
// @name:fr      🎬 Téléchargeur YouTube | HD/2K/4K🔥 | Vidéo & 🎵Audio 📥
// @name:fr-CA   🎬 Téléchargeur YouTube | HD/2K/4K🔥 | Vidéo & 🎵Audio 📥
// @name:he      🎬 הורדת YouTube | HD/2K/4K🔥 | וידאו & 🎵אודיו 📥
// @name:hr      🎬 YouTube Preuzimač | HD/2K/4K🔥 | Video & 🎵Audio 📥
// @name:hu      🎬 YouTube Letöltő | HD/2K/4K🔥 | Videó & 🎵Hang 📥
// @name:id      🎬 Pengunduh YouTube | HD/2K/4K🔥 | Video & 🎵Audio 📥
// @name:it      🎬 Scaricatore YouTube | HD/2K/4K🔥 | Video & 🎵Audio 📥
// @name:ja      🎬 YouTube動画ダウンローダー|HD/2K/4K🔥|動画 & 🎵音声 📥
// @name:ka      🎬 YouTube ჩამოტვირთვა | HD/2K/4K🔥 | ვიდეო & 🎵აუდიო 📥
// @name:ko      🎬 YouTube 동영상 다운로더 | HD/2K/4K🔥 | 동영상 & 🎵오디오 📥
// @name:nb      🎬 YouTube Nedlaster | HD/2K/4K🔥 | Video & 🎵Lyd 📥
// @name:nl      🎬 YouTube Downloader | HD/2K/4K🔥 | Video & 🎵Audio 📥
// @name:pl      🎬 YouTube Pobieracz | HD/2K/4K🔥 | Wideo & 🎵Audio 📥
// @name:pt-BR   🎬 Baixador YouTube | HD/2K/4K🔥 | Vídeo & 🎵Áudio 📥
// @name:ro      🎬 Descărcător YouTube | HD/2K/4K🔥 | Video & 🎵Audio 📥
// @name:ru      🎬 Загрузчик YouTube | HD/2K/4K🔥 | Видео & 🎵Аудио 📥
// @name:sv      🎬 YouTube Nedladdare | HD/2K/4K🔥 | Video & 🎵Ljud 📥
// @name:th      🎬 โหลดวิดีโอ YouTube | HD/2K/4K🔥 | วิดีโอ & 🎵เสียง 📥
// @name:tr      🎬 YouTube İndirici | HD/2K/4K🔥 | Video & 🎵Ses 📥
// @name:uk      🎬 Завантажувач YouTube | HD/2K/4K🔥 | Відео & 🎵Аудіо 📥
// @name:ug      🎬 YouTube سىنئالغۇ چۈشۈرگۈچ | HD/2K/4K🔥 | سىنئالغۇ & 🎵ئاۋاز 📥
// @name:vi      🎬 Tải Video YouTube | HD/2K/4K🔥 | Video & 🎵Âm Thanh 📥
// @namespace    SaveAnyYouTube
// @version      1.0.1
// @author       saveanyyoutube
// @description         📥 Download YouTube 4K/2K/1080P in one click🔥 | ⚡ Super fast & free🆓 | 🎬 Video + 🎵 Audio | No watermark✅ No sign-up
// @description:ar      📥 حمّل YouTube بجودة 4K/2K/1080P بنقرة واحدة🔥 | ⚡ سريع ومجاني🆓 | 🎬 فيديو + 🎵 صوت | بدون علامة مائية✅ بدون تسجيل
// @description:bg      📥 Изтегли YouTube 4K/2K/1080P с едно кликване🔥 | ⚡ Бърз и безплатен🆓 | 🎬 Видео + 🎵 Аудио | Без воден знак✅ Без регистрация
// @description:cs      📥 Stahuj YouTube 4K/2K/1080P jedním kliknutím🔥 | ⚡ Rychlý a zdarma🆓 | 🎬 Video + 🎵 Audio | Bez vodoznaku✅ Bez registrace
// @description:da      📥 Download YouTube 4K/2K/1080P med ét klik🔥 | ⚡ Lynhurtigt og gratis🆓 | 🎬 Video + 🎵 Lyd | Intet vandmærke✅ Ingen registrering
// @description:de      📥 YouTube 4K/2K/1080P mit einem Klick herunterladen🔥 | ⚡ Superschnell & kostenlos🆓 | 🎬 Video + 🎵 Audio | Kein Wasserzeichen✅ Keine Registrierung
// @description:el      📥 Κατέβασε YouTube 4K/2K/1080P με ένα κλικ🔥 | ⚡ Γρήγορο & δωρεάν🆓 | 🎬 Βίντεο + 🎵 Ήχος | Χωρίς υδατογράφημα✅ Χωρίς εγγραφή
// @description:en      📥 Download YouTube 4K/2K/1080P in one click🔥 | ⚡ Super fast & free🆓 | 🎬 Video + 🎵 Audio | No watermark✅ No sign-up
// @description:eo      📥 Elŝutu YouTube 4K/2K/1080P per unu klakon🔥 | ⚡ Rapida & senpaga🆓 | 🎬 Video + 🎵 Aŭdio | Sen akvomarko✅ Sen registrado
// @description:es      📥 Descarga YouTube 4K/2K/1080P con un clic🔥 | ⚡ Súper rápido y gratis🆓 | 🎬 Video + 🎵 Audio | Sin marca de agua✅ Sin registro
// @description:es-419  📥 Descarga YouTube 4K/2K/1080P con un clic🔥 | ⚡ Súper rápido y gratis🆓 | 🎬 Video + 🎵 Audio | Sin marca de agua✅ Sin registro
// @description:fi      📥 Lataa YouTube 4K/2K/1080P yhdellä klikkauksella🔥 | ⚡ Nopea ja ilmainen🆓 | 🎬 Video + 🎵 Ääni | Ei vesileimaa✅ Ei rekisteröitymistä
// @description:fr      📥 Télécharge YouTube 4K/2K/1080P en un clic🔥 | ⚡ Ultra rapide & gratuit🆓 | 🎬 Vidéo + 🎵 Audio | Sans filigrane✅ Sans inscription
// @description:fr-CA   📥 Télécharge YouTube 4K/2K/1080P en un clic🔥 | ⚡ Ultra rapide & gratuit🆓 | 🎬 Vidéo + 🎵 Audio | Sans filigrane✅ Sans inscription
// @description:he      📥 הורד YouTube ב-4K/2K/1080P בלחיצה אחת🔥 | ⚡ מהיר וחינמי🆓 | 🎬 וידאו + 🎵 אודיו | ללא סימן מים✅ ללא הרשמה
// @description:hr      📥 Preuzmi YouTube 4K/2K/1080P jednim klikom🔥 | ⚡ Brz i besplatan🆓 | 🎬 Video + 🎵 Audio | Bez vodenog žiga✅ Bez registracije
// @description:hu      📥 Töltsd le YouTube 4K/2K/1080P videókat egy kattintással🔥 | ⚡ Gyors & ingyenes🆓 | 🎬 Videó + 🎵 Hang | Nincs vízjel✅ Nincs regisztráció
// @description:id      📥 Unduh YouTube 4K/2K/1080P dengan satu klik🔥 | ⚡ Cepat & gratis🆓 | 🎬 Video + 🎵 Audio | Tanpa watermark✅ Tanpa registrasi
// @description:it      📥 Scarica YouTube 4K/2K/1080P con un clic🔥 | ⚡ Veloce & gratuito🆓 | 🎬 Video + 🎵 Audio | Senza filigrana✅ Senza registrazione
// @description:ja      📥 YouTube 4K/2K/1080P動画をワンクリックでDL🔥 | ⚡ 超高速・完全無料🆓 | 🎬 動画 + 🎵 音声 | 透かしなし✅ 登録不要
// @description:ka      📥 ჩამოტვირთე YouTube 4K/2K/1080P ერთი კლიკით🔥 | ⚡ სწრაფი & უფასო🆓 | 🎬 ვიდეო + 🎵 აუდიო | წყლის ნიშნის გარეშე✅ რეგისტრაციის გარეშე
// @description:ko      📥 YouTube 4K/2K/1080P 영상을 원클릭 다운로드🔥 | ⚡ 초고속 무료🆓 | 🎬 동영상 + 🎵 오디오 | 워터마크 없음✅ 가입 불필요
// @description:nb      📥 Last ned YouTube 4K/2K/1080P med ett klikk🔥 | ⚡ Lynrask & gratis🆓 | 🎬 Video + 🎵 Lyd | Inget vannmerke✅ Ingen registrering
// @description:nl      📥 Download YouTube 4K/2K/1080P met één klik🔥 | ⚡ Snel & gratis🆓 | 🎬 Video + 🎵 Audio | Geen watermerk✅ Geen registratie
// @description:pl      📥 Pobierz YouTube 4K/2K/1080P jednym kliknięciem🔥 | ⚡ Szybki & darmowy🆓 | 🎬 Wideo + 🎵 Audio | Bez znaku wodnego✅ Bez rejestracji
// @description:pt-BR   📥 Baixe YouTube 4K/2K/1080P com um clique🔥 | ⚡ Super rápido & grátis🆓 | 🎬 Vídeo + 🎵 Áudio | Sem marca d'água✅ Sem cadastro
// @description:ro      📥 Descarcă YouTube 4K/2K/1080P cu un singur clic🔥 | ⚡ Rapid & gratuit🆓 | 🎬 Video + 🎵 Audio | Fără filigran✅ Fără înregistrare
// @description:ru      📥 Скачай YouTube 4K/2K/1080P одним кликом🔥 | ⚡ Быстро & бесплатно🆓 | 🎬 Видео + 🎵 Аудио | Без водяного знака✅ Без регистрации
// @description:sv      📥 Ladda ner YouTube 4K/2K/1080P med ett klick🔥 | ⚡ Blixtsnabb & gratis🆓 | 🎬 Video + 🎵 Ljud | Inget vattenstämpel✅ Ingen registrering
// @description:th      📥 ดาวน์โหลด YouTube 4K/2K/1080P ด้วยคลิกเดียว🔥 | ⚡ เร็ว & ฟรี🆓 | 🎬 วิดีโอ + 🎵 เสียง | ไม่มีลายน้ำ✅ ไม่ต้องลงทะเบียน
// @description:tr      📥 YouTube'u 4K/2K/1080P tek tıkla indir🔥 | ⚡ Süper hızlı & ücretsiz🆓 | 🎬 Video + 🎵 Ses | Filigran yok✅ Kayıt gerekmez
// @description:uk      📥 Завантаж YouTube 4K/2K/1080P одним кліком🔥 | ⚡ Швидко & безкоштовно🆓 | 🎬 Відео + 🎵 Аудіо | Без водяного знака✅ Без реєстрації
// @description:ug      📥 YouTube نى 4K/2K/1080P تا بىر بېسىش بىلەن چۈشۈرۈڭ🔥 | ⚡ تېز & ھەقسىز🆓 | 🎬 سىنئالغۇ + 🎵 ئاۋاز | سۇ بەلگىسى يوق✅ تىزىملىتىش تەلەپ قىلىنمايدۇ
// @description:vi      📥 Tải YouTube 4K/2K/1080P chỉ một cú nhấp🔥 | ⚡ Siêu nhanh & miễn phí🆓 | 🎬 Video + 🎵 Âm thanh | Không watermark✅ Không đăng ký
// @include      https://*.youtube.com/*
// @noframes
// @license      MIT
// @run-at       document-start
// @grant        GM_openInTab
// @grant        GM_addStyle
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        unsafeWindow
// @grant        GM_download
// ==/UserScript==

(function() {
    'use strict';

    const i18n = {
        'zh': {
            downloadText: 'Free Download',
            error: {
                addNormalButton: '添加普通下载按钮时出错:',
                addShortsButton: '添加Shorts下载按钮时出错:'
            }
        },
        'en': {
            downloadText: 'Free Download',
            error: {
                addNormalButton: 'Error adding normal download button:',
                addShortsButton: 'Error adding Shorts download button:'
            }
        },
        'ja': {
            downloadText: '無料ダウンロード',
            error: {
                addNormalButton: '通常ダウンロードボタンの追加エラー:',
                addShortsButton: 'Shortsダウンロードボタンの追加エラー:'
            }
        },
        'es': {
            downloadText: 'Descarga Gratis',
            error: {
                addNormalButton: 'Error al agregar botón de descarga normal:',
                addShortsButton: 'Error al agregar botón de descarga Shorts:'
            }
        },
        'pt': {
            downloadText: 'Download Grátis',
            error: {
                addNormalButton: 'Erro ao adicionar botão de download normal:',
                addShortsButton: 'Erro ao adicionar botão de download Shorts:'
            }
        }
    };

    GM_addStyle(`
        .youhou-download-btn {
            background: rgb(242, 242, 242);
            border: none;
            border-radius: 18px;
            color: #0f0f0f;
            padding: 0 16px;
            height: 36px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            white-space: nowrap;
            margin-right: 8px;
        }
        .youhou-download-btn:hover {
            background: rgb(230, 230, 230);
        }
    `);

    function waitForElement(selector, callback, maxTries = 10) {
        let tries = 0;

        function check() {
            const element = document.querySelector(selector);
            if (element) {
                callback(element);
                return;
            }

            tries++;
            if (tries < maxTries) {
                setTimeout(check, 1000);
            }
        }

        check();
    }

    function createDownloadButton() {
        if (document.querySelector('.youhou-download-btn')) {
            return;
        }

        const downloadButton = document.createElement('button');
        downloadButton.className = 'youhou-download-btn';
        downloadButton.textContent = i18n['zh'].downloadText;

        downloadButton.addEventListener('click', function() {
            const videoUrl = window.location.href;
            const downloadDomains = ['saveanyyoutube.com'];
            const randomDomain = downloadDomains[Math.floor(Math.random() * downloadDomains.length)];
            const newUrl = videoUrl.replace('youtube.com', randomDomain);
            window.open(newUrl, '_blank');
        });

        return downloadButton;
    }

    function tryAddButton() {
        waitForElement('#top-level-buttons-computed', (topLevelButtons) => {
            if (document.querySelector('.youhou-download-btn')) return;

            const downloadButton = createDownloadButton();
            if (!downloadButton) return;

            topLevelButtons.insertAdjacentElement('beforebegin', downloadButton);
        });
    }

    document.addEventListener('yt-navigate-finish', function() {
        if (window.location.pathname.includes('/watch')) {
            setTimeout(tryAddButton, 1000);
        }
    });

    if (window.location.pathname.includes('/watch')) {
        setTimeout(tryAddButton, 1000);
    }

})();