Hide RR or Not Live Streams on Twitch ASMR

Hides streams containing "RR", "!RR", "(no live)", "Not live", "RERUN", "ReRun", or similar variants in the full title on Twitch's ASMR page.

目前为 2025-03-09 提交的版本。查看 最新版本

// ==UserScript==
// @name        Hide RR or Not Live Streams on Twitch ASMR
// @match       *://www.twitch.tv/directory/category/asmr
// @grant       none
// @version     1.0
// @author      Nanu
// @description Hides streams containing "RR", "!RR", "(no live)", "Not live", "RERUN", "ReRun", or similar variants in the full title on Twitch's ASMR page.
// @license MIT
// @namespace https://gf.qytechs.cn/users/1444078
// ==/UserScript==

(function() {
    'use strict';

    // Enhanced regex to detect "RR", "!RR", "(no live)", "Not live", "RERUN", "ReRun", etc.
    const reRunPattern = /(\b|!|\W)(rr|rerun|re-run|повтор)\b|\(no live\)|not live|💗\s*rerun|💕\s*rerun|❤️‍🔥\s*rerun/i;

    // Function to hide streams matching the pattern
    function hideReRunStreams() {
        // Select all stream title elements
        document.querySelectorAll('h3.CoreText-sc-1txzju1-0').forEach(titleElement => {
            // Get the full title from the `title` attribute or visible text
            const fullTitle = titleElement.getAttribute('title') || titleElement.textContent;

            // Check if the full title matches the pattern
            if (reRunPattern.test(fullTitle)) {
                // Hide the stream (the stream container is the closest <article> with the specific class)
                const streamCard = titleElement.closest('article.Layout-sc-1xcs6mc-0.jivRFd');
                if (streamCard) {
                    // Find the main container wrapping the <article>
                    const parentContainer = streamCard.closest('div[data-target]');
                    if (parentContainer) {
                        parentContainer.style.display = 'none'; // Hide the main container
                    }
                }
            }
        });
    }

    // Run the function initially
    hideReRunStreams();

    // Observe page changes to apply the filter dynamically
    const observer = new MutationObserver(hideReRunStreams);
    observer.observe(document.body, { childList: true, subtree: true });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址