Youtube Shorts Garbage Remover

Hides elements based on like count conditions. Removes the trash tier garbage youtube shorts shovelled down your throat.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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 Shorts Garbage Remover
// @namespace    http://tampermonkey.net/
// @version      1.66
// @description  Hides elements based on like count conditions. Removes the trash tier garbage youtube shorts shovelled down your throat.
// @author       psyda#0001
// @match        *://www.youtube.com/*
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    function modifyVideos() {
        var videos = document.querySelectorAll('ytd-reel-video-renderer[is-active]');
        videos.forEach(function(video) {
            var titleContainer = video.querySelector('h2.title');
            var likes = video.querySelector('ytd-toggle-button-renderer#like-button span[role="text"]');

            if (titleContainer && likes) {
                var titleText = titleContainer.textContent.trim();
                var likeText = likes.textContent.trim();

                if (titleText !== '' && likeText.match(/k|m|b/i)) {
                    likes.style.color = 'green'; // Make the like count text green
                    if ((likeText == "like") || (likeText == "Like")){
                        video.remove(); // Remove the video if it doesn't meet the criteria
                    }
                } else {
                    video.remove(); // Remove the video if it doesn't meet the criteria
                }
            }
        });
    }

    // Check every 1000 milliseconds (1 second)
    setInterval(modifyVideos, 1000);
})();