搜书小组(404吧)-主页 帖子过滤器

通过编辑代码管理黑/白名单(无界面)

// ==UserScript==
// @name         搜书小组(404吧)-主页 帖子过滤器
// @namespace    https://gf.qytechs.cn/zh-CN/users/1441970-%E5%8D%97%E7%AB%B9
// @version      1.1
// @description  通过编辑代码管理黑/白名单(无界面)
// @author       南竹
// @match        https://404ku.com/*
// @match        https://404zu.org/*
// @match        https://404zu.net/*
// @license      MIT
// @grant        none
// ==/UserScript==


(function() {
    'use strict';

    // ======================================
    // 用户配置区 (直接修改以下数组)
    // ======================================

    // 黑名单:包含这些词的帖子将被隐藏
    const BLACKLIST = [
        'NTR', '绿文', '绿帽', '深绿', '绿母', '绿妈',
        '加绿', '改绿', '绿改', '纯绿','越异界当绿帽王爷','纯绿AA','纯绿AA','纯绿AA','纯绿AA','纯绿AA','纯绿AA','纯绿AA','纯绿AA','纯绿AA',
        '绿黑', '黑绿', '媚黑', '黑人','纯绿AA','纯绿AA','纯绿AA','纯绿AA','纯绿AA','纯绿AA','纯绿AA','纯绿AA','纯绿AA','纯绿AA',
        '黑鬼', '倪哥', '绿爱之高贵美艳', '为了指挥官夺冠,成为其他对手', '逆子难防','夜色皇后', '世子之我家娘子们', '17岁的种马体育生',
        '纯绿AA','母一去兮不复还', '母蚀:我无能为力', '议员长妈妈被', '美人篇', '浴房篇', '册母为后2', '黑爹',
        '世子之我家娘子们','夜色皇后', '世子之我家娘子们', '克鲁鲁,被背刺的', '纯绿AA'];

    // 白名单:包含这些词的帖子即使命中黑名单也会保留
    const WHITELIST = [
        '无绿', '非绿文'
    ];

    // ======================================
    // 核心过滤逻辑 (无需修改)
    // ======================================

    function filterTitles() {
        document.querySelectorAll(`
            ul.category_newlist li a,
            .replaybox li a,
            .hottiebox li a,
            .goodtiebox li a
        `).forEach(titleLink => {
            const text = titleLink.textContent.toLowerCase();

            const hasBlack = BLACKLIST.some(kw =>
                text.includes(kw.toLowerCase())
            );
            const hasWhite = WHITELIST.some(w =>
                text.includes(w.toLowerCase())
            );

            if (hasBlack && !hasWhite) {
                titleLink.closest('li').style.display = 'none';
            }
        });
    }

    // ======================================
    // 动态加载监听
    // ======================================

    new MutationObserver(() => {
        setTimeout(filterTitles, 300);
    }).observe(document.body, {
        childList: true,
        subtree: true
    });

    // 初始执行
    window.addEventListener('load', () => {
        setTimeout(filterTitles, 1500);
    });
})();

QingJ © 2025

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