BanZhu

第一版主去除广告,图片变字

当前为 2024-08-03 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         BanZhu
// @namespace    http://tampermonkey.net/
// @version      1.1.4
// @description  第一版主去除广告,图片变字
// @author       Current__
// @match        https://www.banzhu77777.com/*
// @match        https://www.banzhu88888.com/*
// @match        https://www.banzhu99999.com/*
// @grant        GM_addStyle
// @grant        GM_setValue
// @grant        GM_getValue
// @license      AGPL-3.0-or-later
// @run-at       document-start
// ==/UserScript==
const map = new Map([
  ["7074467222", "逼"],
  ["0678663477", "情"],
  ["3043454467", "日"],
  ["2276251664", "嫩"],
  ["0486110525", "水"],
  ["0923672614", "死"],
  ["5318824731", "妈"],
  ["2965616717", "爱"],
  ["2063259833", "色"],
  ["6197424834", "中"],
  ["5260398634", "指"],
  ["0473556214", "含"],
  ["0146287633", "露"],
  ["8478694653", "主"],
  ["9134848937", "做"],
  ["2173857009", "高"],
  ["1082275499", "合"],
  ["3296363576", "欲"],
  ["1040782805", "奸"],
  ["2471389451", "湿"],
  ["7051993783", "硬"],
  ["2174754224", "暴"],
  ["4436421269", "党"],
  ["6514831790", "血"],
  ["0026372214", "丝"],
  ["6281647881", "流"],
  ["1947937898", "粉"],
  ["4538628495", "挤"],
  ["6281647881", "流"],
  ["5229950952", "肉"],
  ["9860153795", "麻"],
  ["5110754259", "吸"],
  ["4740869798", "操"],
  ["2525826615", "狗"],
  ["3089649511", "宫"],
  ["1218400718", "虐"],
  ["8997927012", "灭"],
  ["9720548295", "杜"],
  ["7508904751", "帮"],
  ["7228562021", "纪"],
  ["5969522288", "亲"],
  ["6855685283", "摇"],
  ["5732450242", "母"],
  ["5329628684", "辱"],
  ["5265224411", "干"],
  ["5245263419", "轮"],
  ["2158558763", "幼"],
  ["2811411890", "亡"],
  ["9829762678", "妇"],
  ["5105645092", "温"],
  ["2548022544", "奴"],
  ["8666880661", "凌"],
  ["5946892177", "淫"],
  ["5758773674", "棍"],
  ["4017050851", "交"],
  ["2293535402", "兽"],
  ["8087788059", "国"],
  ["4933790542", "枪"],
  ["4766000693", "精"],
  ["9173059916", "毒"],
  ["2090369734", "熟"],
  ["9763512263", "美"],
  ["9821815185", "裸"],
  ["9925956069", "处"],
  ["2444947917", "性"],
  ["7051410763", "马"],
  ["7618693335", "呻"],
  ["0975893408", "吟"],
  ["0092238155", "阴"],
  ["5213317466", "具"],
  ["2633701054", "棒"],
  ["5736430795", "内"],
  ["0783213298", "丁"],
  ["5429058065", "弟"],
  ["8261828414", "肛"],
  ["2761875847", "胸"],
  ["0720742117", "乳"],
  ["6050660618", "屁"],
  ["9928120606", "腿"],
  ["8954155954", "炮"],
  ["2769203094", "未"],
  ["6259252852", "杀"],
  ["0423651377", "插"],
  ["3746262645", "舔"],
  ["6768988724", "鸡"],
  ["9308659858", "射"],
  ["0961296593", "弹"],
  ["9572021917", "尿"],
  ["4006928252", "吞"],
  ["6789528781", "学"],
  ["3342690501", "舌"],
  ["0551722925", "唇"],
  ["8280163404", "蛋"],
  ["8861933232", "婊"],
  ["0813524594", "妓"],
  ["5318162318", "贱"],
  ["4808579862", "臀"],
  ["7130632296", "席"],
  ["6378369235", "胡"],
  ["5910985788", "足"],
  ["1810002091", "九"],
  ["1063785572", "搞"],
  ["3382216428", "义"],
  ["5004143384", "乱"],
  ["5518664754", "骚"],
  ["0756494362", "偷"],
  ["5366734122", "共"],
  ["8698737337", "奶"],
  ["0050897572", "涛"],
  ["1801354585", "勃"],
  ["0519063805", "秽"],
  ["4481675898", "缝"],
  ["0551252288", "龟"],
  ["4488426878", "缝"],
  ["2553168545", "穴"],
  ["9636759436", "药"],
  ["6534003186", "蜜"],
  ["8993789017", "洞"],
  ["4668655063", "潮"],
  ["4472054519", "咪"],
  ["1607055014", "酸"],
  ["6560841485", "伦"],
  ["2781961287", "厥"],
  ["8926554707", "炸"],
]);
(function () {
  "use strict";

  // 监听DOM元素的添加事件
  const observer = new MutationObserver((mutations) => {
    mutations.forEach((mutation) => {
      mutation.addedNodes.forEach((node) => {
        if (node.nodeType !== Node.ELEMENT_NODE) return;
        if (node.tagName === "SCRIPT") {
          handleScriptNode(node);
        } else if (node.tagName === "IMG") {
          handleImageNode(node);
        }
      });
    });
  });

  function handleImageNode(node) {
    const src_match = node.src.match(/\/(\d+)\.png$/);
    if (node.dataset.cfsrc != undefined) {
      var cf_src_match = node.dataset.cfsrc.match(/\/(\d+)\.png$/);
    }
    if (src_match) {
      var key = src_match[1];
    } else if (cf_src_match) {
      key = cf_src_match[1];
    }
    if (map.has(key)) {
      const textNode = document.createTextNode(map.get(key));
      node.parentNode.replaceChild(textNode, node);
    } else {
      console.log(node);
      console.log(key);
    }
  }

  function handleScriptNode(node) {
    const scriptSrc = node.getAttribute("src");
    if (
      scriptSrc &&
      (scriptSrc.includes("htmlk") || scriptSrc.includes("cdn.js"))
    ) {
      node.parentNode.removeChild(node);
    }
  }

  // 配置并开始观察DOM
  observer.observe(document, { childList: true, subtree: true });
})();