max / إحصائيات قناة يوتيوب

// ==UserScript==
// @name         YouTube 频道数据查询助手
// @namespace    https://tenzaa.com/
// @version      1.0.0
// @description  [2026 最新] 查看 Social Blade 上的 YouTube 频道统计数据。
// @author       classccai
// @match        *://*.youtube.com/*
// @icon         https://tenzaa.com/favicon.ico
// @run-at       document-end
// @grant        none
// @license      MIT
// @name:af         YouTube-kanaalstatistiek
// @description:af    Kry Social Blade-statistiek vir enige YouTube-kanaal.
// @name:am         YouTube ቻናል ስታቲስቲክስ
// @description:am    ለማንኛውም የ YouTube ቻናል የ Social Blade ስታቲስቲክስን ያግኙ።
// @name:ar         إحصائيات قناة يوتيوب
// @description:ar    احصل على إحصائيات Social Blade لأي قناة يوتيوب.
// @name:as         ইউটিউব চেনেলৰ পৰিসংখ্যা
// @description:as    যিকোনো ইউটিউব চেনেলৰ বাবে Social Blade পৰিসংখ্যা লাভ কৰক।
// @name:az         YouTube Kanal Statistikası
// @description:az    Hər hansı bir YouTube kanalı üçün Social Blade statistikasına giriş əldə edin.
// @name:be         Статыстыка YouTube канала
// @description:be    Атрымлівайце доступ да статыстыкі Social Blade для любога канала YouTube.
// @name:bg         Статистика на YouTube канал
// @description:bg    Получете достъп до статистиката на Social Blade за всеки канал в YouTube.
// @name:bn         ইউটিউব চ্যানেল পরিসংখ্যান
// @description:bn    যেকোনো ইউটিউব চ্যানেলের জন্য Social Blade পরিসংখ্যান পান।
// @name:bs         Statistika YouTube kanala
// @description:bs    Dobijte pristup statistici Social Blade za bilo koji YouTube kanal.
// @name:ca         Estadístiques del canal de YouTube
// @description:ca    Obtingueu accés a les estadístiques de Social Blade per a qualsevol canal de YouTube.
// @name:cs         Statistiky YouTube kanálu
// @description:cs    Získejte přístup ke statistikám Social Blade pro jakýkoli kanál YouTube.
// @name:da         YouTube-kanalstatistik
// @description:da    Få adgang til Social Blade-statistikker for enhver YouTube-kanal.
// @name:de         YouTube-Kanalstatistik
// @description:de    Erhalten Sie Zugriff auf Social Blade-Statistiken für jeden YouTube-Kanal.
// @name:dz         ཡུ་ཊུབ་རྒྱུ་ལམ་གྱི་གནས་ཐོ།
// @description:dz    ཡུ་ཊུབ་རྒྱུ་ལམ་གང་རུང་གི་དོན་ལུ་ Social Blade གནས་ཐོ་ཚུ་ཐོབ་ཚུགས།
// @name:el         Στατιστικά καναλιού YouTube
// @description:el    Αποκτήστε πρόσβαση στα στατιστικά του Social Blade για οποιοδήποτε κανάλι YouTube.
// @name:en         YouTube Channel Stats
// @description:en    Get Social Blade statistics for any YouTube channel.
// @name:eo         Statistikoj de Jutuba kanalo
// @description:eo    Akiru aliron al statistikoj de Social Blade por iu ajn Jutuba kanalo.
// @name:es         Estadísticas de canales de YouTube
// @description:es    Obtenga acceso a las estadísticas de Social Blade para cualquier canal de YouTube.
// @name:et         YouTube kanali statistika
// @description:et    Hankige juurdepääs Social Blade'i statistikale mis tahes YouTube'i kanali kohta.
// @name:eu         YouTube kanalen estatistikak
// @description:eu    Lortu Social Blade-ren estatistiketarako sarbidea edozein YouTube kanaletan.
// @name:fa         آمار کانال یوتیوب
// @description:fa    دسترسی به آمار Social Blade برای هر کانال یوتیوب داشته باشید.
// @name:fi         YouTube-kanavan tilastot
// @description:fi    Pääse käsiksi Social Bladen tilastoihin mille tahansa YouTube-kanavalle.
// @name:fil        Stats ng Channel sa YouTube
// @description:fil   Makakuha ng access sa mga istatistika ng Social Blade para sa anumage channel sa YouTube.
// @name:fr         Statistiques de chaîne YouTube
// @description:fr    Accédez aux statistiques de Social Blade pour n'importe quelle chaîne YouTube.
// @name:ga         Staitisticí Cainéal YouTube
// @description:ga    Faigh rochtain ar staitisticí Social Blade le haghaidh aon chainéal YouTube.
// @name:gl         Estadísticas da canle de YouTube
// @description:gl    Obtén acceso ás estatísticas de Social Blade para calquera canle de YouTube.
// @name:gu         યુટ્યુબ ચેનલ સ્ટેટસ
// @description:gu    કોઈપણ યુટ્યુબ ચેનલ માટે સોશિયલ બ્લેડ આંકડાઓની ઍક્સેસ મેળવો.
// @name:ha         Kididdigar Tashar YouTube
// @description:ha    Samu damar shiga kididdigar Social Blade ga kowace tashar YouTube.
// @name:hi         YouTube चैनल आँकड़े
// @description:hi    किसी भी YouTube चैनल के लिए सोशल ब्लेड आँकड़ों तक पहुँच प्राप्त करें।
// @name:hr         Statistika YouTube kanala
// @description:hr    Dobijte pristup statistici Social Blade za bilo koji YouTube kanal.
// @name:hu         YouTube csatorna statisztikák
// @description:hu    Hozzáférést kap a Social Blade statisztikákhoz bármely YouTube csatornához.
// @name:hy         YouTube ալիքի վիճակագրություն
// @description:hy    Ստացեք մուտք դեպի Social Blade վիճակագրություն ցանկացած YouTube ալիքի համար։
// @name:id         Statistik Saluran YouTube
// @description:id    Dapatkan akses ke statistik Social Blade untuk saluran YouTube apa pun.
// @name:ig         Ndekọ ọwa YouTube
// @description:ig    Nweta ohere na nyocha Social Blade maka ọwa YouTube ọ bụla.
// @name:is         Tölfræði YouTube rásar
// @description:is    Fáðu aðgang að Social Blade tölfræði fyrir hvaða YouTube rás sem er.
// @name:it         Statistiche del canale YouTube
// @description:it    Ottieni accesso alle statistiche di Social Blade per qualsiasi canale YouTube.
// @name:iw         סטטיסטיקות ערוץ יוטיוב
// @description:iw    קבל גישה לסטטיסטיקות של Social Blade עבור כל ערוץ יוטיוב.
// @name:ja         YouTube チャンネル統計
// @description:ja    YouTube チャンネルの Social Blade 統計にアクセスします。
// @name:jv         Statistik Saluran YouTube
// @description:jv    Entuk akses menyang statistik Social Blade kanggo saluran YouTube apa wae.
// @name:ka         YouTube არხის სტატისტიკა
// @description:ka    მიიღეთ წვდომა Social Blade-ის სტატისტიკაზე ნებისმიერი YouTube არხისთვის.
// @name:kk         YouTube арнасының статистикасы
// @description:kk    Кез келген YouTube арнасы үшін Social Blade статистикасына қол жеткізіңіз.
// @name:km         ស្ថិតិឆានែល YouTube
// @description:km    ទទួលបានការចូលប្រើស្ថិតិ Social Blade សម្រាប់ឆានែល YouTube ណាមួយ។
// @name:kn         YouTube ಚಾನಲ್ ಅಂಕಿಅಂಶಗಳು
// @description:kn    ಯಾವುದೇ YouTube ಚಾನಲ್‌ಗಾಗಿ ಸೋಶಿಯಲ್ ಬ್ಲೇಡ್ ಅಂಕಿಅಂಶಗಳಿಗೆ ಪ್ರವೇಶ ಪಡೆಯಿರಿ.
// @name:ko         유튜브 채널 통계
// @description:ko    모든 유튜브 채널의 Social Blade 통계에 액세스하세요.
// @name:ky         YouTube каналынын статистикасы
// @description:ky    Каалаган YouTube каналы үчүн Social Blade статистикасына жетиңиз.
// @name:lo         ສະຖິຕິຊ່ອງ YouTube
// @description:lo    ເຂົ້າເຖິງສະຖິຕິ Social Blade ສໍາລັບຊ່ອງ YouTube ໃດກໍ່ໄດ້.
// @name:lt         „YouTube“ kanalo statistika
// @description:lt    Gaukite prieigą prie „Social Blade“ statistikos bet kuriame „YouTube“ kanale.
// @name:lv         YouTube kanāla statistika
// @description:lv    Iegūstiet piekļuvi Social Blade statistikai jebkuram YouTube kanālam.
// @name:mg         Statistikan'ny fantsona YouTube
// @description:mg    Mahazoa fidirana amin'ny statistika Social Blade ho an'ny fantsona YouTube rehetra.
// @name:mk         Статистика на YouTube канал
// @description:mk    Добијте пристап до статистиката на Social Blade за кој било YouTube канал.
// @name:ml         യൂട്യൂബ് ചാനൽ സ്ഥിതിവിവരക്കണക്കുകൾ
// @description:ml    ഏതെങ്കിലും യൂട്യൂബ് ചാനലിനായുള്ള സോഷ്യൽ ബ്ലേഡ് സ്ഥിതിവിവരക്കണക്കുകളിലേക്ക് പ്രവേശനം നേടുക.
// @name:mn         YouTube сувгийн статистик
// @description:mn    Дурын YouTube сувгийн Social Blade статистикт нэвтэрнэ үү.
// @name:mr         यूट्यूब चॅनल आकडेवारी
// @description:mr    कोणत्याही यूट्यूब चॅनेलसाठी सोशल ब्लेड आकडेवारीवर प्रवेश मिळवा.
// @name:ms         Statistik Saluran YouTube
// @description:ms    Dapatkan akses ke statistik Social Blade untuk mana-mana saluran YouTube.
// @name:mt         Statistika tal-Kanal tal-YouTube
// @description:mt    Ikseb aċċess għall-istatistika ta' Social Blade għal kwalunkwe kanal tal-YouTube.
// @name:my         YouTube ချန်နယ် ကိန်းဂဏန်းများ
// @description:my    မည်သည့် YouTube ချန်နယ်အတွက်မဆို Social Blade ကိန်းဂဏန်းများကို ရယူပါ။
// @name:ne         युट्युब च्यानल तथ्याङ्क
// @description:ne    कुनै पनि युट्युब च्यानलको लागि सोशल ब्लेड तथ्याङ्कहरूमा पहुँच प्राप्त गर्नुहोस्।
// @name:nl         YouTube-kanaalstatistieken
// @description:nl    Krijg toegang tot Social Blade-statistieken voor elk YouTube-kanaal.
// @name:no         YouTube-kanalstatistikk
// @description:no    Få tilgang til Social Blade-statistikk for enhver YouTube-kanal.
// @name:om         Istaatistiika Tashar YouTube
// @description:om    Tashar YouTube kamiyyuu qulqullina Social Blade isaa arguuf.
// @name:or         ୟୁଟ୍ୟୁବ୍ ଚ୍ୟାନେଲ୍ ପରିସଂଖ୍ୟାନ
// @description:or    ଯେକୌଣସି ୟୁଟ୍ୟୁବ୍ ଚ୍ୟାନେଲ୍ ପାଇଁ ସୋସିଆଲ୍ ବ୍ଲେଡ୍ ପରିସଂଖ୍ୟାନ ପ୍ରାପ୍ତ କରନ୍ତୁ |
// @name:pa         ਯੂਟਿਊਬ ਚੈਨਲ ਅੰਕੜੇ
// @description:pa    ਕਿਸੇ ਵੀ ਯੂਟਿਊਬ ਚੈਨਲ ਲਈ ਸੋਸ਼ਲ ਬਲੇਡ ਅੰਕੜਿਆਂ ਤੱਕ ਪਹੁੰਚ ਪ੍ਰਾਪਤ ਕਰੋ।
// @name:pl         Statystyki kanału YouTube
// @description:pl    Uzyskaj dostęp do statystyk Social Blade dla dowolnego kanału YouTube.
// @name:ps         د یوټیوب چینل احصایې
// @description:ps    د هر یوټیوب چینل لپاره د Social Blade احصایو ته لاسرسی ومومئ.
// @name:pt         Estatísticas do canal do YouTube
// @description:pt    Obtenha acesso às estatísticas do Social Blade para qualquer canal do YouTube.
// @name:ro         Statistici canal YouTube
// @description:ro    Obțineți acces la statisticile Social Blade pentru orice canal YouTube.
// @name:ru         Статистика YouTube канала
// @description:ru    Получите доступ к статистике Social Blade для любого канала YouTube.
// @name:rw         Imibare y'umuyoboro wa YouTube
// @description:rw    Bona uburyo bwo kureba imibare ya Social Blade kuri buri muyoboro wa YouTube.
// @name:si         යූටියුබ් නාලිකා සංඛ්‍යාලේඛන
// @description:si    ඕනෑම යූටියුබ් නාලිකාවක් සඳහා Social Blade සංඛ්‍යාලේඛන වෙත ප්‍රවේශයක් ලබා ගන්න.
// @name:sk         Štatistiky kanála YouTube
// @description:sk    Získajte prístup k štatistikám Social Blade pre akýkoľvek kanál YouTube.
// @name:sl         Statistika YouTube kanala
// @description:sl    Pridobite dostop do statistike Social Blade za kateri koli kanal YouTube.
// @name:sn         Nhamba dzeYouTube Channel
// @description:sn    Wana mukana wekuona nhamba dze Social Blade kune chero YouTube channel.
// @name:so         Xogta Kanaalka YouTube
// @description:so    Hel xogta Social Blade ee kanaal kasta oo YouTube ah.
// @name:sq         Statistikat e kanalit YouTube
// @description:sq    Merrni akses në statistikat e Social Blade për çdo kanal YouTube.
// @name:sr         Statistika YouTube kanala
// @description:sr    Dobijte pristup statistici Social Blade za bilo koji YouTube kanal.
// @name:st         Lipalo tsa kanale ea YouTube
// @description:st    Fumana lipalo tsa Social Blade bakeng sa kanale efe kapa efe ea YouTube.
// @name:sv         YouTube-kanalstatistik
// @description:sv    Få tillgång til Social Blade-statistik för valfri YouTube-kanal.
// @name:sw         Statistik za Kituo cha YouTube
// @description:sw    Pata ufikiaji wa takwimu za Social Blade kwa kituo chochote cha YouTube.
// @name:ta         யூடியூப் சேனல் புள்ளிவிவரங்கள்
// @description:ta    எந்தவொரு யூடியூப் சேனலுக்கும் சோஷியல் பிளேட் புள்ளிவிவரங்களைப் பெறுங்கள்.
// @name:te         యూట్యూబ్ ఛానెల్ గణాంకాలు
// @description:te    ఏదైనా యూట్యూబ్ ఛానెల్ కోసం సోషల్ బ్లేడ్ గణాంకాలను పొందండి.
// @name:tg         Омори канали YouTube
// @description:tg    Дастрасӣ ба омори Social Blade барои ҳар як канали YouTube пайдо кунед.
// @name:th         สถิติช่อง YouTube
// @description:th    เข้าถึงสถิติ Social Blade สำหรับช่อง YouTube ใดก็ได้
// @name:ti         ስታቲስቲክስ ቻናል ዩቲዩብ
// @description:ti    ንዝኾነ ቻናል ዩቲዩብ ናይ Social Blade ስታቲስቲክስ ርኸብ።
// @name:tk         YouTube kanal statistikasy
// @description:tk    Islendik YouTube kanaly üçin Social Blade statistikasyna giriň.
// @name:tr         YouTube Kanal İstatistikleri
// @description:tr    Herhangi bir YouTube kanalı için Social Blade istatistiklerine erişim sağlayın.
// @name:ug         YouTube قانىلى ستاتىستىكىسى
// @description:ug    ھەر قانداق YouTube قانىلى ئۈچۈن Social Blade ستاتىستىكىسىغا ئېرىشىڭ.
// @name:uk         Статистика YouTube каналу
// @description:uk    Отримуйте доступ да статистики Social Blade для будь-якого каналу YouTube.
// @name:ur         یوٹیوب چینل کے اعدادوشمار
// @description:ur    کسی بھی یوٹیوب چینل کے لیے سوشل بلیڈ کے اعدادوشمار تک رسائی حاصل کریں۔
// @name:uz         YouTube kanali statistikasi
// @description:uz    Istalgan YouTube kanali uchun Social Blade statistikasiga kirish imkoniyatiga ega bo'ling.
// @name:vi         Thống kê kênh YouTube
// @description:vi    Truy cập vào số liệu thống kê của Social Blade cho bất kỳ kênh YouTube nào.
// @name:yo         Awọn iṣiro ikanni YouTube
// @description:yo    Gba iwọle si awọn iṣiro Social Blade fun eyikeyi ikanni YouTube.
// @name:zh-CN      YouTube 频道数据查询助手
// @description:zh-CN 查看 Social Blade 上的 YouTube 频道统计数据。
// @name:zh-HK      YouTube 頻道數據查詢助手
// @description:zh-HK 查看 Social Blade 上的 YouTube 頻道統計數據。
// @name:zh-TW      YouTube 頻道數據查詢助手
// @description:zh-TW 查看 Social Blade 上的 YouTube 頻道統計數據。
// @name:zu         Izibalo zesiteshi se-YouTube
// @description:zu    Thola ukufleleleka kuzibalo ze-Social Blade kunoma isiphi isiteshi se-YouTube.
// ==/UserScript==

(function() {
    'use strict';

    const i18n = {
        "af": "Statistiek", "am": "ስታቲስቲክስ", "ar": "الإحصائيات", "as": "পৰিসংখ্যা", "az": "Statistika",
        "be": "Статыстыка", "bg": "Статистика", "bn": "পরিসংখ্যান", "bs": "Statistika", "ca": "Estadístiques",
        "cs": "Statistiky", "da": "Statistik", "de": "Statistiken", "dz": "གནས་ཐོ།", "el": "Στατιστικά",
        "en": "Stats", "en-GB": "Stats", "en-US": "Stats", "eo": "Statistikoj", "es": "Estadísticas",
        "es-419": "Estadísticas", "es-US": "Estadísticas", "et": "Statistika", "eu": "Estatistikak", "fa": "آمار",
        "fi": "Tilastot", "fil": "Stats", "fr": "Stats", "fr-CA": "Stats", "ga": "Staitisticí",
        "gl": "Estadísticas", "gn": "Estadística", "gu": "આંકડા", "ha": "Kididdiga", "hi": "आँकड़े",
        "hr": "Statistika", "hu": "Statisztikák", "hy": "Վիճակագրություն", "id": "Statistik", "ig": "Ndekọ",
        "is": "Tölfræði", "it": "Statistiche", "iw": "סטטיסטיקה", "ja": "統計", "jv": "Statistik",
        "ka": "სტატისტიკა", "kk": "Статистика", "km": "ស្ថិតិ", "kn": "ಅಂಕಿಅಂಶ", "ko": "통계",
        "ky": "Статистика", "lo": "ສະຖິຕິ", "lt": "Statistika", "lv": "Statistika", "mg": "Statistika",
        "mk": "Статистика", "ml": "സ്ഥിതിവിവരക്കණക്കുകൾ", "mn": "Статистик", "mr": "आकडेवारी", "ms": "Statistik",
        "mt": "Statistika", "my": "ကိန်းဂဏန်း", "ne": "तथ्याङ्क", "nl": "Statistieken", "no": "Statistikk",
        "om": "Istaatistiika", "or": "ପରିସଂଖ୍ୟାନ", "pa": "ਅੰਕੜੇ", "pl": "Statystyki", "ps": "احصایې",
        "pt": "Estatísticas", "pt-BR": "Estatísticas", "pt-PT": "Estatísticas", "ro": "Statistici", "ru": "Статистика",
        "rw": "Imibare", "si": "සංඛ්‍යාලේඛන", "sk": "Štatistiky", "sl": "Statistika", "sn": "Nhamba",
        "so": "Xogta", "sq": "Statistikat", "sr": "Statistika", "sr-Latn": "Statistika", "st": "Lipalo",
        "sv": "Statistik", "sw": "Statistik", "ta": "புள்ளிவிவரம்", "te": "గణాంకాలు", "tg": "Омор",
        "th": "สถิติ", "ti": "ስታቲስቲክስ", "tk": "Statistika", "tr": "İstatistik", "ug": "ستاتىستىكا",
        "uk": "Статистика", "ur": "اعدادوشمار", "uz": "Statistika", "vi": "Thống kê", "yo": "Awọn iṣiro",
        "zh-CN": "频道数据", "zh-HK": "頻道數據", "zh-TW": "頻道數據", "zu": "Izibalo"
    };

    const userLang = navigator.language || 'en';
    const langCode = i18n[userLang] ? userLang : (i18n[userLang.split('-')[0]] ? userLang.split('-')[0] : 'en');
    const labelText = i18n[langCode] || 'Stats';

    function inject() {
        let handle = '';
        const channelLink = document.querySelector('ytd-video-owner-renderer a.yt-simple-endpoint, yt-formatted-string.ytd-channel-name a');
        if (channelLink) {
            const href = channelLink.getAttribute('href');
            if (href) handle = href.split('/').pop().replace('@', '');
        } else if (window.location.pathname.includes('@')) {
            handle = window.location.pathname.split('/')[1].replace('@', '');
        }

        const sbUrl = handle && handle !== 'watch' ?
                      `https://socialblade.com/youtube/handle/${handle}` :
                      `https://socialblade.com/search`;

        let existingBtn = document.getElementById('tenzaa-sb-global-btn');
        if (existingBtn) {
            existingBtn.href = sbUrl;
            return;
        }

        const actionRow = document.querySelector('#top-level-buttons-computed') ||
                          document.querySelector('ytd-menu-renderer #top-level-buttons-renderer') ||
                          document.querySelector('ytd-subscribe-button-renderer');

        if (actionRow) {
            const btn = document.createElement('a');
            btn.id = 'tenzaa-sb-global-btn';
            btn.href = sbUrl;
            btn.target = '_blank';

            Object.assign(btn.style, {
                backgroundColor: '#065fd4',
                color: '#ffffff',
                padding: '6px 16px',
                borderRadius: '18px',
                textDecoration: 'none',
                fontSize: '13px',
                fontWeight: 'bold',
                marginLeft: '10px',
                display: 'inline-flex',
                alignItems: 'center',
                zIndex: '9999',
                fontFamily: 'Roboto, Arial, sans-serif',
                whiteSpace: 'nowrap',
                transition: 'background 0.3s'
            });

            btn.onmouseover = () => { btn.style.backgroundColor = '#0056b3'; };
            btn.onmouseout = () => { btn.style.backgroundColor = '#065fd4'; };

            const svgNS = "http://www.w3.org/2000/svg";
            const svg = document.createElementNS(svgNS, "svg");
            svg.setAttribute("width", "16");
            svg.setAttribute("height", "16");
            svg.setAttribute("viewBox", "0 0 24 24");
            svg.style.marginRight = "6px";
            svg.style.fill = "white";

            const path = document.createElementNS(svgNS, "path");
            path.setAttribute("d", "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z");
            svg.appendChild(path);

            const span = document.createElement('span');
            span.textContent = labelText;

            btn.appendChild(svg);
            btn.appendChild(span);

            actionRow.prepend(btn);
        }
    }

    setInterval(inject, 2000);
    window.addEventListener('yt-navigate-finish', inject);
    inject();
})();