YouTube Min Views Filter

10.000 izlenmenin altındaki videoları gizler

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         YouTube Min Views Filter
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  10.000 izlenmenin altındaki videoları gizler
// @author       Sefa AVAN
// @license      MIT
// @match        http://*.youtube.com/*
// @match        http://youtube.com/*
// @match        https://*.youtube.com/*
// @match        https://youtube.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const MIN_VIEWS = 10000; // Bu değeri değiştirebilirsiniz

    function parseViews(text) {
        text = text.replace(/\s/g,'');
        if (text.includes('B')) return parseFloat(text.replace('B','').replace(',','.')) * 1000;
        if (text.includes('Mn')) return parseFloat(text.replace('Mn','').replace(',','.')) * 1000000;
        return parseInt(text.replace(/[^0-9]/g,'')) || 0;
    }

    function filterVideos() {
        const videos = Array.from(document.querySelectorAll('ytd-rich-item-renderer, ytd-video-renderer, ytd-grid-video-renderer'));
        videos.forEach(v => {
            const viewSpan = Array.from(v.querySelectorAll('span')).find(span => span.innerText.includes('görüntüleme'));
            if (!viewSpan) return;
            const views = parseViews(viewSpan.innerText);
            v.style.display = (views >= MIN_VIEWS) ? '' : 'none';
        });
    }

    // İlk filtreleme
    filterVideos();

    // Yeni videolar yüklendikçe filtre uygula
    const observer = new MutationObserver(() => {
        filterVideos();
    });
    observer.observe(document.body, { childList: true, subtree: true });

})();