YouTube Min Views Filter

10.000 izlenmenin altındaki videoları gizler

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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 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 });

})();