B站大杂烩成分指示器(极简版)

自动标注成分,原:A畜3畜野狗大杂烩指示器·改,极简版,无倾向性(太nt除外eg伪史论者),侵删

// ==UserScript==
// @name         B站大杂烩成分指示器(极简版)
// @name:en      Bilibili_Agent_Simple
// @version      v1.1.0
// @update       cake
// @author       trychen,miayoshi,TenSin,klxf,hmjz100,xulaupuz,
// @license      GPLv3
// @description  自动标注成分,原:A畜3畜野狗大杂烩指示器·改,极简版,无倾向性(太nt除外eg伪史论者),侵删
// @description:en  Automatic labeling of ingredients, original: A livestock 3 animal wild dog hodgepodge indicator change, simply, no tendency,  if invasion else deletion
// @match        https://www.bilibili.com/video/*
// @match        https://www.bilibili.com/read/*
// @match        https://www.bilibili.com/opus/*
// @match        https://www.bilibili.com/bangumi/
// @match        https://t.bilibili.com/*
// @match        https://space.bilibili.com/*
// @match        https://www.bilibili.com/judgement/*
// @icon          https://static.hdslb.com/images/favicon.ico
// @match        https://www.bilibili.com/v/topic/detail/*
// @icon         https://static.hdslb.com/images/favicon.ico
// @connect      bilibili.com
// @grant             GM_setValue
// @grant             GM_getValue
// @grant             GM_xmlhttpRequest
// @grant             GM.xmlHttpRequest
// @grant             GM_registerMenuCommand
// @grant             GM_getResourceText
// @require           https://unpkg.com/jquery@3.6.0/dist/jquery.min.js
// @require           https://unpkg.com/sweetalert2@11/dist/sweetalert2.min.js
// @resource Swal     https://unpkg.com/sweetalert2@11/dist/sweetalert2.min.css
// @resource SwalDark https://unpkg.com/@sweetalert2/theme-dark@5/dark.min.css
// @namespace https://greasyfork.org/users/1110013
// ==/UserScript==

$(function BiliChecker() {
	// 是否在控制台显示错误消息
	let debug = false;
	/* 注释~
	在这里配置要检查的成分,或者直接拉黑(使用指定UID评论的人会被直接添加标签)。
	假设你要直接给指定UID添加一个标签的话,就这样写:blacklist: [1234567890,0987654321]
	*/
	const checkers = [
        {
			displayName: "抽奖",
			displayIcon: "🎁",
			keywords: ["互动抽奖", "转发本条动态"],
		}
		,

        {
            displayName: "",
            displayIcon: "@600w_600h_1c_1s.webp",
            keywords: [""],
            followings: []
        }
        ,

        {
            displayName: "地平论者",//你没事吧
            displayIcon: "https://i0.hdslb.com/bfs/face/051056a87a1cbdc56cce513714aa2a3ad6490c98.jpg@600w_600h_1c_1s.webp",
            keywords: [""],
            followings: [
			    563479941,//天圆地方地球骗局
				1030963504,//平坦的陆地
				//待续
				]
        }
        ,
        {
            displayName: "伪史论者",  //难绷,直接一滴血原则
            displayIcon: "https://shufa.supfree.net/k/104074.gif",
            keywords: ["神都俗人","周楚山","何新","河清"],
            followings: [
				167541240,//神都俗人
				351610385,//周楚山
				386840843,//阿波罗登月造假,原名:数学名师汇
				310877780,//何新老家伙——伪史论亚圣
				1761823456,//河清
				387542456,//驰豹_
				1543803026,//云影方寸
				2123823309,//老Q
				3546387329321268,//栖梧辨史
				3546597122116354,//老丁说文     
				3493091193391214,//孔言史语
				385959641,//历史集结号
				634980447,//我所认知的历史
				2031292544,//老雪文史
				1162474667,//程咬金说明朝故事
				5262093,//时空盒
				49623845,//范宇平LALIN先生
				668180012,//东哥说文史
				1604012612,//生民无疆
				30929648,//碎尘凡星
				2059646713,//朱恪远
				1091922158,//通利明堂
				687708004,//谈史有料
				527239433,//诸葛小叭
				522474063,//崔哥侃
				480768335,//陈成诚_1644
				53069167,//六艺伏羲
				235467006,//布衣老朱
				//待续
			]
        }
        ,
		        {
            displayName: "电哥",
            displayIcon: "https://i1.hdslb.com/bfs/face/c277af542ef1ad8657dab6cff68c2744a842724c.jpg@600w_600h_1c_1s.webp",
            keywords: ["电哥"],
            followings: [2053632613,1526687911,436361773,603781744]
        }
        ,
		{
            displayName: "七哥",
            displayIcon: "https://i1.hdslb.com/bfs/face/d862ad470125a518ddbaab50d88ffb8332de9e3d.jpg@240w_240h_1c_1s.webp",
            keywords: ["七哥"],
            followings: [323397658,3546588567833451,3546688025266313,626116668,1908575732,650014862,37948129,698056492,77701536,416952165]
        }
		,
        {
            displayName: "阿甘",
            displayIcon: "https://i1.hdslb.com/bfs/face/787bec68454f36ebfdc78bf828a88cfdee98df2e.jpg@600w_600h_1c_1s.webp",
            keywords: ["军情阿甘"],
            followings: [3546620310326128]
        }
        ,
        {
            displayName: "卢克文",
            displayIcon: "https://i0.hdslb.com/bfs/face/a8f3ef0a71de565c059c46fa95967058d4e8e37f.jpg@600w_600h_1c_1s.webp",
            keywords: ["卢克文"],
            followings: [438173577]
        }
        ,
        {
            displayName: "赛雷",
            displayIcon: "https://i1.hdslb.com/bfs/face/4eb764b8c6afc48ad1e7aaf84b0f58db3d4dbb3f.jpg@600w_600h_1c_1s.webp",
            keywords: ["赛雷"],
            followings: [26108626,151482404,510362725]
        }
        ,
        {
            displayName: "独夫之心",
            displayIcon: "https://i0.hdslb.com/bfs/face/ce1df7657719267a4ca8b95009cfa98ae28f5079.jpg@600w_600h_1c_1s.webp",
            keywords: ["独夫之心"],
            followings: [10850097]
        }
        ,
        {
            displayName: "小Q",
            displayIcon: "https://i0.hdslb.com/bfs/face/3b59fb5c73d1de935acab4447f3f000e1aa783f1.jpg@600w_600h_1c_1s.webp",
            keywords: ["小Q"],
            followings: [546189]
        }
        ,
        {
            displayName: "vv",
            displayIcon: "https://i2.hdslb.com/bfs/face/4cd3272c73227218ff18ff5273d7f2b94beabd4a.jpg@600w_600h_1c_1s.webp",
            keywords: ["维为"],
            followings: [1458767615]
        }
        ,
        {
            displayName: "荷兰人",
            displayIcon: "https://i0.hdslb.com/bfs/face/0339cce3092b22d20f6cd33edc041459fd86d9fe.jpg@600w_600h_1c_1s.webp",
            keywords: ["天空飞翔荷兰人","天空的荷兰人"],
            followings: [401861362,372383049]
        }
        ,
        {
            displayName: "新华社",
            displayIcon: "https://i1.hdslb.com/bfs/face/396b93a7f619882afa711879dbf2cb98a40e7367.jpg@600w_600h_1c_1s.webp",
            keywords: ["新华网","新华社"],
            followings: [473837611]
        }
        ,
        {
            displayName: "胡律师",
            displayIcon: "https://i2.hdslb.com/bfs/face/88424e8eaeb3466fc7cf93429651f59a70c38b4d.jpg@600w_600h_1c_1s.webp",
            keywords: ["胡律师"],
            followings: [8440892]
        }
        ,
        {
            displayName: "二流媒体",
            displayIcon: "https://i2.hdslb.com/bfs/face/19a041ba0e78ed43b7a3eab35edfc998eaa7db8e.jpg@600w_600h_1c_1s.webp",
            keywords: ["人民日报","人民网"],
            followings: [1131457022,33775467]
        }
        ,
		{
            displayName: "央视",
            displayIcon: "https://i1.hdslb.com/bfs/face/2dc9c34444ba9f8e891fdc98e6c331fa3c02d127.jpg@600w_600h_1c_1s.webp",
            keywords: ["央视"],
            followings: [456664753,222103174,433587902,451320374]
        }
		,
		{
            displayName: "黑神话",
            displayIcon: "https://i1.hdslb.com/bfs/face/5fdac7d9820175f5f0ae1b6c33968bb8f64cc82c.jpg@240w_240h_1c_1s.webp",
            keywords: ["黑神话"],
            followings: [642389251]
        }
		,
		{
            displayName: "老猫",
            displayIcon: "折腾的老猫",
            keywords: ["https://i2.hdslb.com/bfs/face/7c943a916e46c53170426f286c33bb3a116a483c.jpg@240w_240h_1c_1s.webp"],
            followings: [1175509358]
        }
		,
		{
            displayName: "户晨风",
            displayIcon: "https://i1.hdslb.com/bfs/face/06f1ead2473e5af54d4f6ae35ce2baf825d31414.jpg@240w_240h_1c_1s.webp",
            keywords: ["戶晨风","户晨风"],
            followings: [9047380,49869761]
        }
		,
		{
            displayName: "峰哥",
            displayIcon: "https://i2.hdslb.com/bfs/face/ae439693d6fd79a55b1b5f935ed6474ae6fba35b.jpg@240w_240h_1c_1s.webp",
            keywords: ["峰哥"],
            followings: [35847683,476655153,322296103]
        }
		,
		{
            displayName: "胜利文绉绉",
            displayIcon: "https://i0.hdslb.com/bfs/face/2235f4376c1cc61919bbf7972a8236b59ff50409.jpg@240w_240h_1c_1s.webp",
            keywords: ["胜利文绉绉"],
            followings: [12300996]
        }
		,
		{
            displayName: "环球",
            displayIcon: "https://i0.hdslb.com/bfs/face/c8a2502a53adf1b6d309171e15c167e73beaad44.jpg@240w_240h_1c_1s.webp",
            keywords: ["环球时报","环球网"],
            followings: [10303206,483787858]
        }
		,
		{
            displayName: "夹头",
            displayIcon: "https://i2.hdslb.com/bfs/face/0b542ee82fa15dd80a722053dfd679358d793a09.jpg@240w_240h_1c_1s.webp",
            keywords: ["司马南"],
            followings: [612492134]
        }
		,
		{
            displayName: "赵灵敏",
            displayIcon: "https://i1.hdslb.com/bfs/face/6d74df8b444250f534ff75068189d78bb246ed87.jpg@240w_240h_1c_1s.webp",
            keywords: ["赵灵敏"],
            followings: [488066419]
        }
		,
		{
            displayName: "极客小冷",
            displayIcon: "https://i0.hdslb.com/bfs/face/00c0713a09ded3f5e319ad8da2c964f784b16b8d.jpg@240w_240h_1c_1s.webp",
            keywords: ["极客小冷"],
            followings: [316410045]
        }
		,
		{
            displayName: "心医",
            displayIcon: "https://i1.hdslb.com/bfs/face/560914dab69fde91b1f493deab08431395cde9db.jpg@600w_600h_1c_1s.webp",
            keywords: ["心医","林霖"],
            followings: [1482025194,492808243,1671690277,3546613272284121,385421054,3494349717375890,3546610338367633]  //分身好多
        }
		,
		{
            displayName: "素材库",
            displayIcon: "https://i0.hdslb.com/bfs/face/7bbf5c68622f61a0d33d4beebaa9bbdbfccf235d.jpg@600w_600h_1c_1s.webp",
            keywords: ["虫类素材库"],
            followings: [1456398987]
        }
		,
		{
            displayName: "章北海",
            displayIcon: "https://i1.hdslb.com/bfs/face/645f6e958a0b6bf8d34a1ae396302cf112dd1a3c.jpg@600w_600h_1c_1s.webp",
            keywords: ["章北海official"],
            followings: [570064]
        }
		,
		{
            displayName: "MHY",
            displayIcon: "https://i2.hdslb.com/bfs/face/f7e24cfec824e0aaf67fdd62c960c13026768f70.jpg@600w_600h_1c_1s.webp",
            keywords: ["MHYY"],
            followings: [199676483]
        }
		,
		{
            displayName: "水东",
            displayIcon: "https://i0.hdslb.com/bfs/face/6d4403558d95515ca3e95e296b0648c7931bef32.jpg@600w_600h_1c_1s.webp",
            keywords: ["水东揭秘"],
            followings: [486404538]
        }
		,
        {
            displayName: "异化",
            displayIcon: "https://i1.hdslb.com/bfs/face/f586d7a72b4e1d891bd46abdb2614ead33b71435.jpg@600w_600h_1c_1s.webp",
            keywords: ["灵笼","艺画"],
            followings: [3494361474009190,14328316]
        }
        ,
        {
            displayName: "HOLO",
            displayIcon: "https://i1.hdslb.com/bfs/face/52f316ed4b89f48f3fea7cc165585c04c32f32df.jpg@600w_600h_1c_1s.webp",
            keywords: ["holo"],
            followings: [286700005]
        }
        ,
        {
            displayName: "饭-wyb",
            displayIcon: "https://i0.hdslb.com/bfs/face/3621591c438b83798cf32287837a10f16c1eb5a6.jpg@600w_600h_1c_1s.webp",
            keywords: ["YIBO-OFFICIAL"],
            followings: [688694784]
        }
        ,
        {
            displayName: "饭-exo",
            displayIcon: "https://i0.hdslb.com/bfs/face/b77988a74a83ade540857045781ad9485685554d.jpg@600w_600h_1c_1s.webp",
            keywords: ["EXO"],
            followings: [3493262484572295]
        }
        ,
        {
            displayName: "饭-zyx",
            displayIcon: "https://i1.hdslb.com/bfs/face/6fda05166cc55cdeed94475e2a944427f64ec7f4.jpg@600w_600h_1c_1s.webp",
            keywords: ["张艺兴"],
            followings: [161158015]
        }
        ,
        {
            displayName: "未明子",
            displayIcon: "https://i0.hdslb.com/bfs/face/71ad8ea7787e8acc85bd2a70b554150c35fc1e57.jpg@600w_600h_1c_1s.webp",
            keywords: ["未明子"],
            followings: [23191782]
        }
        ,
        {
            displayName: "蜗牛柯基",
            displayIcon: "https://i1.hdslb.com/bfs/face/939bc84b0ff28599c31e5b274ce70121268649b4.jpg@600w_600h_1c_1s.webp",
            keywords: ["蜗牛柯基weibo"],
            followings: [153890218]
        }
        ,
        {
            displayName: "观察者",
            displayIcon: "https://i0.hdslb.com/bfs/face/3d0dba3789065512f5217387ab135a093ae10c45.jpg@600w_600h_1c_1s.webp",
            keywords: ["观察者网","观视频工作室"],
            followings: [10330740,54992199,677410823,649926500]
        }
        ,
        {
            displayName: "共青团",
            displayIcon: "https://i1.hdslb.com/bfs/face/05725218e6cd8d0916da4f27ab56ca0957545c48.jpg@600w_600h_1c_1s.webp",
            keywords: ["共青团"],
            followings: [20165629]
        }
        ,
        {
            displayName: "孤烟暮蝉",
            displayIcon: "https://i2.hdslb.com/bfs/face/b6ef567cc83c4ab09b7682c729e85a145aa0b4e2.jpg@600w_600h_1c_1s.webp",
            keywords: ["孤烟暮蝉"],
            followings: [19248926]
        }
        ,
        {
            displayName: "白话频道",
            displayIcon: "https://i0.hdslb.com/bfs/face/59156298fd2f29265cb6496a6208ca3c4c8ee89a.jpg@600w_600h_1c_1s.webp",
            keywords: ["白话频道"],
            followings: [92241267]
        }
        ,
		{
            displayName: "阿吞啊",
            displayIcon: "https://i0.hdslb.com/bfs/face/3f4964d1015329a1a548be584a0261079045c7c5.jpg@600w_600h_1c_1s.webp",
            keywords: ["阿吞啊"],
            followings: [622986240]
        }
        ,
		{
            displayName: "俄罗斯",
            displayIcon: "https://i1.hdslb.com/bfs/face/d1a491998bc767ccc5cd914f336e83fb6fed3f82.jpg@600w_600h_1c_1s.webp",
            keywords: ["RT今日俄罗斯","俄罗斯卫星通讯社官网","RT娱乐"],
            followings: [501247999,1156910727,493270535539606,3493081961728612,1638603244,1208659620]
        }
        ,
		{
            displayName: "杰哥",
            displayIcon: "https://i1.hdslb.com/bfs/face/1799d75c67b9d1e447973610df9842a3fc5562ea.jpg@600w_600h_1c_1s.webp",
            keywords: ["鹏城杰森"],
            followings: [664086886]
        }
		,
		{
        displayName: "欧肯",
        displayIcon: "https://i2.hdslb.com/bfs/face/6333b48c19de82716cbfe9ab4b4dcef4f48f006d.jpg@600w_600h_1c_1s.webp",
        keywords: ["欧肯视线"],
        followings: [6859997]
        }
        ,
		{
            displayName: "尼禄",
            displayIcon: "https://i2.hdslb.com/bfs/face/5423011a2b2547003fe46d354e82f35c32e5d95e.jpg@600w_600h_1c_1s.webp",
            keywords: ["神皇尼禄","装甲尼禄","装甲NERO","傲慢尼禄","懒惰尼禄","愤怒尼禄"],
            followings: [335504294,1058667278,368081298,3546687668750650,3493121803421956]
        }
        ,
		{
            displayName: "马超",
            displayIcon: "https://i1.hdslb.com/bfs/face/1c56737dfc0deffffc31c78e0cefb0c3ecf7e000.jpg@600w_600h_1c_1s.webp",
            keywords: ["马督工","小黛晨读","睡前消息"],
            followings: [316568752,1556651916,59104725,64219557,2097311046]
        }
        ,
		{
            displayName: "¥3000",
            displayIcon: "https://i0.hdslb.com/bfs/face/8bb0b1ea83b892a1f396bd75849d60b61a49273f.jpg@600w_600h_1c_1s.webp",
            keywords: ["陈平眉山论剑"],
            followings: [526559715]
        }
        ,
				{
            displayName: "火星方阵",
            displayIcon: "https://i1.hdslb.com/bfs/face/8699bb487e1768f3990688eec7231ea7318d7bd2.jpg@600w_600h_1c_1s.webp",
            keywords: ["火星方阵"],
            followings: [649022917]
        }
        ,
        {
            displayName: "磊哥",
            displayIcon: "https://i1.hdslb.com/bfs/face/4897372932374c750fd3999e933885af1a1d0a93.jpg@600w_600h_1c_1s.webp",
            keywords: ["磊哥聊政经"],
            followings: [303981427]
        }
        ,
        {
            displayName: "金灿荣",
            displayIcon: "https://i2.hdslb.com/bfs/face/0bf6685ac1ef31832fe141416a98a4897f716195.jpg@600w_600h_1c_1s.webp",
            keywords: ["金灿荣"],
            followings: [1488338933]
        }
        ,
        {
            displayName: "圆脸",
            displayIcon: "https://i2.hdslb.com/bfs/face/f8f0fc4114bb06a87481abe12faa006a383cbe6d.jpg@600w_600h_1c_1s.webp",
            keywords: ["波士顿圆脸"],
            followings: [346563107]
        }
        ,
        {
            displayName: "王骁",
            displayIcon: "https://i0.hdslb.com/bfs/face/4b7f791af4dec3b9017c6fd9993dcd2087da3159.jpg@600w_600h_1c_1s.webp",
            keywords: ["王骁"],
            followings: [52165725,1140672573]
        }
        ,
        {
            displayName: "Lex",
            displayIcon: "https://i2.hdslb.com/bfs/face/27e06996840a7cb3ee0fee52f6b4616cd6567def.jpg@600w_600h_1c_1s.webp",
            keywords: ["LexBurner"],
            followings: [777536]
        }
        ,
        {
            displayName: "沈逸",
            displayIcon: "https://i2.hdslb.com/bfs/face/14633072e31671d939bd49bf2c2077f64929f9e8.jpg@600w_600h_1c_1s.webp",
            keywords: ["沈逸老师","沈逸"],
            followings: [648113003]
        }
        ,
        {
            displayName: "美食王刚",
            displayIcon: "https://i1.hdslb.com/bfs/face/1463fa4ea6bffd867dc257dca87248bb1d671cde.jpg@600w_600h_1c_1s.webp",
            keywords: ["美食作家王刚R","王刚"],
            followings: [290526283]
        }
        ,
        {
            displayName: "大漠叔叔",
            displayIcon: "https://i2.hdslb.com/bfs/face/bd405797f0d4d6305b76caafff66c98ae1062a35.jpg@600w_600h_1c_1s.webp",
            keywords: ["大漠叔叔",""],
            followings: [67141499]
        }
        ,
        {
            displayName: "哈米伦的弄笛者",
            displayIcon: "https://i1.hdslb.com/bfs/face/0909d7649e770b94d4f4cfd5628ee68206018ae4.jpg@600w_600h_1c_1s.webp",
            keywords: ["哈米伦的弄笛者",""],
            followings: [11742550]
        }
        ,
        {
            displayName: "A",
            displayIcon: "https://i2.hdslb.com/bfs/face/43b21998da8e7e210340333f46d4e2ae7ec046eb.jpg@240w_240h_1c_1s.jpg",
            keywords: ["想到晚的瞬间","晚晚","嘉晚饭","乃贝","贝极星空间站","乃琳夸夸群","顶碗人","皇珈骑士","贝极星","乃宝","嘉心糖的手账本","嘉心糖","拉姐","然然","asoul","A-SOUL","水母","来点然能量","奶淇琳","珈乐","贝拉拉的717片星空"],
            followings: [703007996,672342685,672328094,672353429,672346917,351609538]
        }
        ,
        {
            displayName: "塔",
            displayIcon: "https://i1.hdslb.com/bfs/face/4907464999fbf2f2a6f9cc8b7352fceb6b3bfec3.jpg@240w_240h_1c_1s.jpg",
            keywords: ["谢谢喵","taffy","雏草姬"],
            followings: [1265680561]
        }
        ,
        {
            displayName: "莲宝",
            displayIcon: "https://i0.hdslb.com/bfs/face/ced15dc126348dc42bd5c8eefdd1de5e48bdd8e6.jpg@240w_240h_1c_1s.jpg",
            keywords: ["東雪蓮Official","东雪莲","莲宝"],
            followings: [1437582453]
        }
        ,
        {
            displayName: "T",
            displayIcon: "https://i0.hdslb.com/bfs/face/6be92dec2240b0593a40d2c696b37aa75c704ff6.jpg@240w_240h_1c_1s.jpg",
            keywords: ["小星星","瞳宝","瞳子","瞳瞳","瞳星结","星瞳"],
            followings: [401315430,2122506217]
        }
        ,
        {
            displayName: "梓",
            displayIcon: "https://i2.hdslb.com/bfs/face/ba9ce36ef60a53e24a97f54429e62bdb951530a0.jpg@240w_240h_1c_1s.jpg",
            keywords: ["阿梓从小就很可爱","阿梓","小孩梓","达达","AME"],
            followings: [7706705]
        }
        ,
        {
            displayName: "小米",
            displayIcon: "https://i0.hdslb.com/bfs/face/77feb972004154b08ded4f1d388dbc1058fad2d9.jpg@600w_600h_1c_1s.webp",
            keywords: ["小米"],
            followings: [1476167907]
        }
        ,
        {
            displayName: "华为",
            displayIcon: "https://i2.hdslb.com/bfs/face/d09290cd18c3e048ca0b2eefa3647a487ed11b77.jpg@600w_600h_1c_1s.webp",
            keywords: ["华为"],
            followings: [102999485,578227337,439499363]
        }
        ,
        {
            displayName: "荣耀",
            displayIcon: "https://i0.hdslb.com/bfs/face/0cdc6b649da44ea38e71591b0297d47d86844f0e.jpg@600w_600h_1c_1s.webp",
            keywords: ["荣耀手机"],
            followings: [99748932]
        }
        ,
		{
			displayName: "",
			displayIcon: "https://i0.hdslb.com/bfs/face/d2a95376140fb1e5efbcbed70ef62891a3e5284f.jpg@100w_100h.webp",
			keywords: ["互动抽奖 #原神", "#原神", "#米哈游#", "#miHoYo#", "原神", "芙宁娜", "白术", "赛诺", "神里绫人", "神里绫华", "夏洛蒂", "珊瑚宫", "九条裟罗", "班尼特", "夜阑", "那维莱特", "枫原万叶", "万叶", "钟离", "纳西妲", "香菱", "八重神子", "久岐忍", "菲谢尔", "艾尔海森", "胡桃", "林尼", "达达利亚", "提纳里", "宵宫", "莫娜", "甘雨", "罗莎莉亚", "刻晴", "九条裟罗", "温迪", "阿贝多", "云堇", "芭芭拉", "可莉", "迪卢克", "烟绯", "重云", "雷泽", "凝光", "坎蒂丝", "辛焱"],
			followings: [401742377] // 原神官方号的 UID
		}
        ,
				{
			displayName: "",
			displayIcon: "https://cf.qq.com/favicon.ico",
			keywords: ["穿越火线"],
			followings: [
				315554376, // 穿越火线官方号的 UID
				204120111, // CF农哥吊打小怪兽
				1083400219, // cf孙某
				398597510, // CF教父
				456180476, // CF猫七
				33281681, // CF威廉I黑化版
				440017413, // 穿越火线兴兴
				474595618, // 穿越火线赛事
			]
		},
		{
			displayName: "",
			displayIcon: "https://dnf.qq.com/favicon.ico",
			keywords: ["地下城与勇士", "DNF"],
			followings: [
				102176172, // 地下城与勇士官方号的 UID
				90179837, // dnf老搬
				27253173, // DNF面码
				8233456, // DNF枪魂冰子
				332349, // DNF死兔子
				168090912, // 17173DNF官方
				353944511, // DNF手游假猪
				325314188
			]
		},
		{
			displayName: "",
			displayIcon: "https://pubg.qq.com/favicon.ico",
			keywords: ["绝地求生", "PUBG"],
			followings: [
				449704680, // 意识DT
				6528910, // 小贝的游戏食堂
				46708782, // 鲁大能
				50329485, // 吃鸡赛事
				552064023, // 吃鸡小表弟
			]
		},
		{
			displayName: "",
			displayIcon: "https://lol.qq.com/favicon.ico",
			keywords: ["英雄联盟", "LOL"],
			followings: [
				50329118, // 哔哩哔哩英雄联盟赛事官方号的 UID
				4895244, // LOL丶诺诺
				470840543, // LOL楠神李青
				178778949, // 英雄联盟
				50329220, // 哔哩哔哩LOL赛事直播
				302651406, // WBG英雄联盟分部
				652663378, // LOL小超梦
				23364027, // 英雄联盟-小白鸦
			]
		},
		{
			displayName: "",
			displayIcon: "https://i0.hdslb.com/bfs/face/c4cbdafecef76836b94f2ba8832d0a04d709a499.jpg@100w_100h.webp",
			keywords: ["第五人格", "#第五人格", "互动抽奖 #第五人格"],
			followings: [
				211005705, // 网易第五人格手游官方号的 UID
				105022844, // 第五人格赛事
				452627895, // 狼队电竞第五人格分部
				1385707562, // TE溯第五人格分部
			]
		},
		{
			displayName: "",
			displayIcon: "https://i0.hdslb.com/bfs/face/6afedb4d85ea6c4115f5548146dc8d7127886ca0.jpg@100w_100h.webp",
			keywords: ["蛋仔派对", "#蛋仔派对", "互动抽奖 #蛋仔派对"],
			followings: [
				1306451842, // 网易蛋仔派对官方号的 UID
			]
		},
        {
            displayName: "",
            displayIcon: "https://i2.hdslb.com/bfs/face/57b6e8c16b909a49bfc8d8394d946f908cabe728.jpg@240w_240h_1c_1s.jpg",
            keywords: ["互动抽奖 #崩坏星穹铁道","崩坏星穹铁道"],
            followings: [1340190821]
        }
        ,
        {
            displayName: "",
            displayIcon: "https://i0.hdslb.com/bfs/face/049b47e0e73fc5cc1564343bb0aeacce8ae8e6f8.jpg@240w_240h_1c_1s.jpg",
            keywords: ["互动抽奖 #绝区零","绝区零"],
            followings: [1636034895]
        }
        ,
		{
			displayName: "",
			displayIcon: "https://i0.hdslb.com/bfs/face/effbafff589a27f02148d15bca7e97031a31d772.jpg@100w_100h.webp",
			keywords: ["互动抽奖 #王者荣耀", "#王者荣耀", "王者荣耀"],
			followings: [
				57863910, // 王者荣耀
				392836434, // 哔哩哔哩王者荣耀赛事
			]
		},
				{
			displayName: "",
			displayIcon: "https://i0.hdslb.com/bfs/face/fe2e1a6e3dc702a6c91378e096ef37ca71bf4629.jpg@100w_100h.webp",
			keywords: ["互动抽奖 #三国杀", "#三国杀", "三国杀", "#2023三国杀"],
			followings: [1254932367] // 三国杀十周年官方号的 UID
		},
		{
			displayName: "",
			displayIcon: "https://i0.hdslb.com/bfs/face/c5578966c447a70edf831bbf7e522b7be6090fea.jpg@100w_100h.webp",
			keywords: ["我的世界", "minecraft", "#我的世界", "我的世界拜年祭", "MCBBS", "我的世界中文论坛", "MC玩家"],
			followings: [
				43310262, // 我的世界官方号的 UID
				39914211, // 我的世界中文论坛(MCBBS)官方号的 UID
			]
		},
		{
			displayName: "",
			displayIcon: "https://i0.hdslb.com/bfs/face/a7591e5e0278aafb76cc083b11ca5dd46f049420.jpg@100w_100h.webp",
			keywords: ["mnsj", "迷你世界", "miniworld", "#迷你世界", "迷你世界拜年祭"],
			followings: [
				470935187, // 迷你世界官方号的 UID
			]
		},
        {
            displayName: "",
            displayIcon: "https://i0.hdslb.com/bfs/face/89154378c06a5ed332c40c2ca56f50cd641c0c90.jpg@240w_240h_1c_1s.jpg",
            keywords: ["互动抽奖 #明日方舟","危机合约","《明日方舟》"],
            followings: [161775300]
        }
        ,
        {
            displayName: "",
            displayIcon: "https://i0.hdslb.com/bfs/face/764412727f7dda317f2fd7a6cbc5ab5abe71e8cc.jpg@600w_600h_1c_1s.webp",
            keywords: ["命运-冠位指定"],
            followings: [233108841]
        }
        ,
        {
            displayName: "",
            displayIcon: "https://i1.hdslb.com/bfs/face/063ffbf06d3115d94f6a5241500ee63c4cae9915.jpg@600w_600h_1c_1s.webp",
            keywords: ["战舰世界"],
            followings: [573693898]
        }
        ,
        {
            displayName: "",
            displayIcon: "https://i1.hdslb.com/bfs/face/b00fa47b1b1f6d929aca215c909928859993b5d4.jpg@600w_600h_1c_1s.webp",
            keywords: ["少女前线2","少前2"],
            followings: [697654195]
        }
        ,
		{
			displayName: "",
			displayIcon: "https://i0.hdslb.com/bfs/face/9859fc14160795f4a7700053342494b3c71945ce.jpg@100w_100h.webp",
			keywords: ["无期迷途", "#无期迷途"],
			followings: [647409444]
		}
		,
		{
			displayName: "",
			displayIcon: "https://i1.hdslb.com/bfs/face/f2635e09fe667d4ad29229c6ed0b5f4bdea09bd1.jpg@100w_100h.webp",
			keywords: ["蔚蓝档案"],
			followings: [3493265644980448,3493282386545566]
		}
		,
		{
			displayName: "",
			displayIcon: "https://i0.hdslb.com/bfs/face/e2a7e30399860cfa7c1ec5c958ab9e519290e181.jpg@100w_100h.webp",
			keywords: ["尘白禁区", "#尘白禁区"],
			followings: [1409863611,241036]
		}
		,
		{
			displayName: "",
			displayIcon: "https://i0.hdslb.com/bfs/face/5ec39858e751638ad389a5412696c7efbd31c7bf.jpg@100w_100h.webp",
			keywords: ["来自星尘", "#来自星尘"],
			followings: [1883857209]
		}
		,
		{
			displayName: "",
			displayIcon: "https://i2.hdslb.com/bfs/face/0abd6b9df304334a9388e968740b5b9b7d1a84be.jpg@100w_100h.webp",
			keywords: ["鸣潮"],
			followings: [1955897084]
		}
		,
		{
			displayName: "",
			displayIcon: "https://i2.hdslb.com/bfs/face/6a1936d5cb5b315311fedbf2d4793c4d404cac83.jpg@100w_100h.webp",
			keywords: ["重返未来1999", "#重返未来1999"],
			followings: [1197454103]
		}
		,
		{
			displayName: "",
			displayIcon: "https://i0.hdslb.com/bfs/face/1fd5b43d5f619e6df8c8adcf13c962a3e80ee971.jpg@100w_100h.webp",
			keywords: ["碧蓝航线", "#碧蓝航线", "#舰船新增#"],
			followings: [
				233114659, // 碧蓝航线官方号的 UID
			]
		}
		,
        {
            displayName: "",
            displayIcon: "https://i2.hdslb.com/bfs/face/667e4b1ca39300bff0672774f1980c02c2353b11.jpg@600w_600h_1c_1s.webp",
            keywords: ["少女前线","少前"],
            followings: [32472953]
        }
        ,
        {
            displayName: " 可🌟风纪委🌟能 ",
            displayIcon: "https://i2.hdslb.com/bfs/face/5c4677f2f5c6aa4aa3ee22c5744ddc5a11dde31c.jpg@600w_600h_1c_1s.webp",
            keywords: ["风纪委","风纪委员","#风纪委员会#","B站新风纪委建议反馈收集 #风纪委","B站新风纪委建议反馈收集 #","风纪委员会调研","风纪委员会众议观点的赞和踩改为同意与不同","风纪委员会众议观点的赞和踩改为同意与不同 #","#B站新风纪委建议反馈收集","风纪委员","焱缪-猫猫兔"],
        }
	]

	/*
	防止代码因其他原因被执行多次
	这段代码出自 Via轻插件,作者谷花泰
	*/
	let key = encodeURIComponent('(改)B站成分检测器:主代码');
	if (window[key]) return;
	window[key] = true;
	console.log("【(改)B站成分检测器】即时\n运行中...")

	// 创建样式
	addCheckerStyle();

	// 空间动态api
	const cardApiUrl = 'https://api.bilibili.com/x/web-interface/card?mid='
	const spaceApiUrl = 'https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/space?host_mid='
	const followingApiUrl = 'https://api.bilibili.com/x/relation/followings?vmid='
	
	const searchIcon = `<svg width="12" height="12" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.3451 15.2003C16.6377 15.4915 16.4752 15.772 16.1934 16.0632C16.15 16.1279 16.0958 16.1818 16.0525 16.2249C15.7707 16.473 15.4456 16.624 15.1854 16.3652L11.6848 12.8815C10.4709 13.8198 8.97529 14.3267 7.44714 14.3267C3.62134 14.3267 0.5 11.2314 0.5 7.41337C0.5 3.60616 3.6105 0.5 7.44714 0.5C11.2729 0.5 14.3943 3.59538 14.3943 7.41337C14.3943 8.98802 13.8524 10.5087 12.8661 11.7383L16.3451 15.2003ZM2.13647 7.4026C2.13647 10.3146 4.52083 12.6766 7.43624 12.6766C10.3517 12.6766 12.736 10.3146 12.736 7.4026C12.736 4.49058 10.3517 2.1286 7.43624 2.1286C4.50999 2.1286 2.13647 4.50136 2.13647 7.4026Z" fill="currentColor"></path></svg>`
	const checkButton = `<div class="composition-checkable"><div class="composition-badge-control"><a class="composition-name-control" title="点击查询用户成分">${searchIcon}</a></div></div>`
	const checked = {}
	const checking = {}
	let dom = ''

	// 2024版评论
	waitForKeyElements("div#info div#user-name[data-user-profile-id]", (element) => {
		if (element && element.length > 0) {
			let style = document.createElement("style");
			style.rel = 'stylesheet';
			style.innerHTML = addCheckerStyle(true)
			element.before(style)

			let button = $(checkButton)
			element.after(button)
			button.on('click', function () {
				checkComposition(element.attr("data-user-profile-id"), element, button.find(".composition-name-control"), element, '')
			})
			if (GM_getValue('Auto') === 'true') button.click()
		}
	});

	// 2024版 回复、纯@评论
	waitForKeyElements("p#contents a[data-user-profile-id]", (element) => {
		if (element && element.length > 0) {
			let style = document.createElement("style");
			style.rel = 'stylesheet';
			style.innerHTML = addCheckerStyle(true)
			element.before(style)

			let button = $(checkButton)
			element.after(button)
			button.on('click', function () {
				checkComposition(element.attr("data-user-profile-id"), element, button.find(".composition-name-control"), element, '')
			})
			if (GM_getValue('Auto') === 'true') button.click()
		}
	});

	// 2024版用户卡片
	waitForKeyElements("div#wrap div#view div#body div#title a#name", (element) => {
		if (element && element.length > 0 && element.parent().parent().find('a[href*="space.bilibili.com"]').attr('href').match(/space\.bilibili\.com\/(\d+)/)[1].length > 0) {
			let style = document.createElement("style");
			style.rel = 'stylesheet';
			style.innerHTML = addCheckerStyle(true)
			element.parent().parent().before(style)

			let button = $(checkButton)
			let initialText = element.text().trim();

			if (element.parent().parent().parent().find(".composition-checkable, .composition-checked"))
				element.parent().parent().parent().find(".composition-checkable, .composition-checked").remove()

			button.css({ "margin": "8px 5px" });
			button.on('click', function () {
				checkComposition(element.parent().parent().find('a[href*="space.bilibili.com"]').attr('href').match(/space\.bilibili\.com\/(\d+)/)[1], element, button.find(".composition-name-control"), element.parent().parent(), { "margin": "0 0 10px" })
			})
			element.parent().parent().after(button);
			if (GM_getValue('Auto') === 'true') button.click()

			const observer = new MutationObserver(mutations => {
				mutations.forEach(mutation => {
					if (mutation.type === 'childList' || mutation.type === 'characterData') {
						let button = $(checkButton)
						let currentText = element.text().trim();
						if (currentText === initialText) return;

						initialText = currentText;
						if (element.parent().parent().parent().find(".composition-checkable, .composition-checked"))
							element.parent().parent().parent().find(".composition-checkable, .composition-checked").remove();

						button.css({ "margin": "8px 5px" });
						button.off('click').on('click', function () {
							checkComposition(element.parent().parent().find('a[href*="space.bilibili.com"]').attr('href').match(/space\.bilibili\.com\/(\d+)/)[1], element, button.find(".composition-name-control"), element.parent().parent(), { "margin": "0 0 10px" });
						});

						element.parent().parent().after(button);
						if (GM_getValue('Auto') === 'true') button.click();
					}
				});
			});

			// 配置观察器
			observer.observe(element.get(0), {
				childList: true,
				subtree: true,
				characterData: true
			});

			// 清理观察器的函数
			element.data('observer', observer);
		}
	});

	// 2022版评论
	waitForKeyElements("div.content-warp div.user-info div.user-name[data-user-id]", (element) => {
		if (element && element.length > 0) {
			let button = $(checkButton)
			element.after(button)
			button.on('click', function () {
				checkComposition(element.attr("data-user-id"), element, button.find(".composition-name-control"), element, '')
			})
			if (GM_getValue('Auto') === 'true') button.click()
		}
	});

	// 2022版子评论
	waitForKeyElements("div > div.sub-user-info div.sub-user-name[data-user-id]", (element) => {
		if (element && element.length > 0) {
			let button = $(checkButton)
			element.after(button)
			button.on('click', function () {
				checkComposition(element.attr("data-user-id"), element, button.find(".composition-name-control"), element, '')
			})
			if (GM_getValue('Auto') === 'true') button.click()
		}
	});

	// 2022版含@的评论
	waitForKeyElements("span a.jump-link.user[data-user-id]", (element) => {
		if (element && element.length > 0) {
			let button = $(checkButton)
			element.after(button)
			button.on('click', function () {
				checkComposition(element.attr("data-user-id"), element, button.find(".composition-name-control"), element, '')
			})
			if (GM_getValue('Auto') === 'true') button.click()
		}
	});

	// 2022版用户卡片
	waitForKeyElements("div.user-card div.card-content div.card-user-info a.card-user-name", (element) => {
		if (element && element.length > 0 && element.parent().find('a[href*="space.bilibili.com"]').attr('href').match(/space\.bilibili\.com\/(\d+)/)[1].length > 0) {
			let button = $(checkButton)
			element.parent().parent().after(button);
			button.css({ "margin": "8px 5px" });
			button.on('click', function () {
				checkComposition(element.parent().find('a[href*="space.bilibili.com"]').attr('href').match(/space\.bilibili\.com\/(\d+)/)[1], element, button.find(".composition-name-control"), element.parent().parent(), { "margin": "0 0 10px" })
			})
			if (GM_getValue('Auto') === 'true') button.click()
		}
	});

	// 2022版动态用户卡片
	waitForKeyElements("div.bili-user-profile div.bili-user-profile-view div.bili-user-profile-view__info div.bili-user-profile-view__info__header a.bili-user-profile-view__info__uname", (element) => {
		if (element && element.length > 0 && element.parent().find('a[href*="space.bilibili.com"]').attr('href').match(/space\.bilibili\.com\/(\d+)/)[1].length > 0) {
			let button = $(checkButton)
			let initialText = element.text().trim();

			if (element.parent().parent().parent().parent().find(".composition-checkable, .composition-checked"))
				element.parent().parent().parent().parent().find(".composition-checkable, .composition-checked").remove()

			element.parent().parent().parent().after(button);
			button.css({ "margin": "8px 5px" });
			button.on('click', function () {
				checkComposition(element.parent().find('a[href*="space.bilibili.com"]').attr('href').match(/space\.bilibili\.com\/(\d+)/)[1], element, button.find(".composition-name-control"), element.parent().parent().parent(), { "margin": "0 0 10px" })
			})
			if (GM_getValue('Auto') === 'true') button.click()

			// 可能只会有一个元素,所以监听用户名刷新
			element.on('DOMSubtreeModified', function () {
				let button = $(checkButton)
				let currentText = $(this).text().trim();
				if (currentText === initialText) return;

				initialText = currentText;
				if (element.parent().parent().parent().parent().find(".composition-checkable, .composition-checked"))
					element.parent().parent().parent().parent().find(".composition-checkable, .composition-checked").remove()

				button.css({ "margin": "8px 5px" });
				button.off('click').on('click', function () {
					checkComposition(element.parent().find('a[href*="space.bilibili.com"]').attr('href').match(/space\.bilibili\.com\/(\d+)/)[1], element, button.find(".composition-name-control"), element.parent().parent().parent(), { "margin": "0 0 10px" })
				})

				element.parent().parent().parent().after(button);
				if (GM_getValue('Auto') === 'true') button.click()
			})
		}
	});

	// 旧版评论
	waitForKeyElements("div.reply-wrap > div > div.user a.name[data-usercard-mid]", (element) => {
		if (element && element.length > 0) {
			let button = $(checkButton)
			element.after(button)
			button.on('click', function () {
				checkComposition(element.attr("data-usercard-mid"), element, button.find(".composition-name-control"), element, '')
			})
			if (GM_getValue('Auto') === 'true') button.click()
		}
	});

	// 旧版用户卡片
	waitForKeyElements("div.user-card div.info p.user a.name", (element) => {
		if (element && element.length > 0 && element.parent().parent().parent().find("a.like").attr("mid")) {
			let button = $(checkButton)
			element.parent().parent().parent().find("div.btn-box").after(button);
			button.css({ "margin": "8px 5px" });
			button.on('click', function () {
				checkComposition(element.parent().parent().parent().find("a.like").attr("mid"), element, button.find(".composition-name-control"), element.parent().parent().parent().find("div.btn-box"), { "margin": "0 0 10px" })
			})
			if (GM_getValue('Auto') === 'true') button.click()
		}
	});

	// 用户中心 关注列表、粉丝列表
	waitForKeyElements("div.content a.title span.fans-name", (element) => {
		if (element && element.length > 0) {
			if (element.parent().parent().find('a[href*="space.bilibili.com"]').attr('href').match(/space\.bilibili\.com\/(\d+)/)[1].length > 0) {
				let button = $(checkButton)
				button.css({ "overflow": "hidden", "margin-bottom": "10px" });
				element.parent().after(button)
				button.on('click', function () {
					checkComposition(element.parent().parent().find('a[href*="space.bilibili.com"]').attr('href').match(/space\.bilibili\.com\/(\d+)/)[1], element, button.find(".composition-name-control"), element.parent(), { "overflow": "hidden", "margin-bottom": "10px" })
				})
				if (GM_getValue('Auto') === 'true') button.click()
			}
		}
	});

	// 旧版包含@的评论
	waitForKeyElements("div.reply-wrap > div > p.text a[data-usercard-mid]", (element) => {
		if (element && element.length > 0) {
			let button = $(checkButton)
			element.after(button)
			button.on('click', function () {
				checkComposition(element.attr("data-usercard-mid"), element, button.find(".composition-name-control"), element, '')
			})
			if (GM_getValue('Auto') === 'true') button.click()
		}
	});

	// 旧版 回复、纯@评论
	waitForKeyElements("span.text-con a[data-usercard-mid]", (element) => {
		if (element && element.length > 0) {
			let button = $(checkButton)
			element.after(button)
			button.on('click', function () {
				checkComposition(element.attr("data-usercard-mid"), element, button.find(".composition-name-control"), element, '')
			})
			if (GM_getValue('Auto') === 'true') button.click()
		}
	});
	

	// 添加标签
	function installComposition(rule, elemload, eleminst, elemcss) {
		let badge = $(`<div class="composition-checked"><div class="composition-badge">
			<a class="composition-name" title="点击查看已识别用户">${rule.displayName}</a>
			${rule.displayIcon ? (
				rule.displayIcon.match("https:") ? `<img referrer="no-referrer" referrerPolicy="no-referrer" src="${rule.displayIcon}" class="composition-icon">` :
					rule.displayIcon.match("data:") ? `<img referrer="no-referrer" referrerPolicy="no-referrer" src="${rule.displayIcon}" class="composition-icon">` :
						`<span class="composition-icon">${rule.displayIcon}</span>`
			) : ''}
			</div></div>`)
		badge.on('click', function () {
			showAllUser()
		})
		if (elemcss) badge.css(elemcss);
		if (eleminst) eleminst.after(badge);
		elemload.parent().parent().remove();
	}

	// 检查标签
	function checkComposition(id, element, elemload, eleminst, elemcss) {
		// 用户名称获取
		let eltx = element.text().trim()
		let name = eltx.charAt(0) == "@" ? eltx.substring(1) : eltx

		elemload.text('等待...')
		elemload.attr('title', '正在查询中,等下吧...')

		if (checked[id] != undefined) {
			let found = checked[id]
			if (found.length > 0) {
				for (let rule of found) {
					installComposition(rule, elemload, eleminst, elemcss)
				}
				console.log(`【(改)B站成分检测器】缓存\n检测到 ${name} ${id} 的成分为\n`, JSON.parse(JSON.stringify(found.map(it => { return { name: it.displayName, reason: it.reason, item: it.item, keyword: it.keyword, uid: it.uid, full: it.full } }))))
			} else {
				console.log(`【(改)B站成分检测器】缓存\n检测到 ${name} ${id} 的成分为 无`)
				elemload.text('无')
				elemload.attr('title', '点击查看已查询过的用户')
				elemload.on('click', function () {
					showAllUser()
				})
			}
		} else if (checking[id] != undefined) {
			if (checking[id].indexOf(element) < 0)
				checking[id].push({
					element: element,
					elemload: elemload,
					eleminst: eleminst,
					elemcss: elemcss,
				});
		} else {
			checking[id] = [{
				element: element,
				elemload: elemload,
				eleminst: eleminst,
				elemcss: elemcss
			}];
			detectComposition(id, name, true)
				.then((found) => {
					if (found.length > 0) {
						value = found.map(it => ({
							name: it.displayName,
							img: it.displayIcon,
							reason: it.reason,
							item: it.item,
							keyword: it.keyword,
							uid: it.uid,
							full: it.full
						}))
						dom += `
						<div style="margin-top: 25px">
							<span style="margin:0">${name}</span>
							<div id="tips" style="color: #fb7299;"><a href="https://space.bilibili.com/${id}/" target="_blank" style="color: #fb7299;">UID ${id}</a></div>
							`;
						for (let i = 0; i < value.length; i++) {
							let reason = value[i].keyword || value[i].uid
							let icon = value[i].img ? (
								value[i].img.match("https:") ? `<img referrer="no-referrer" referrerPolicy="no-referrer" src="${value[i].img}" class="composition-icon">` :
									value[i].img.match("data:") ? `<img referrer="no-referrer" referrerPolicy="no-referrer" src="${value[i].img}" class="composition-icon">` :
										`<span class="composition-icon">${value[i].img}</span>`
							) : ''
							dom += `
							<div style="margin-top: 10px;">
								<div class="composition-badge">
									<a class="composition-name">${value[i].name}</a>
									${icon}
								</div>
								<div style="margin-top: 8px;">
									<div class="composition-name">原因:${value[i].reason}</div>
									<div class="composition-name">匹配:${reason}</div>
								</div>
							</div>`;
						}
						dom += `</div>`

						let displayNameSet = new Set();
						found = found.filter(item => {
							if (displayNameSet.has(item.displayName)) {
								return false;
							} else {
								displayNameSet.add(item.displayName);
								return true;
							}
						});

						// 给所有用到的地方添加标签
						for (let elements of checking[id]) {
							if (found.length > 0) {
								for (let rule of found) {
									installComposition(rule, elements.elemload, elements.eleminst, elements.elemcss);
								}
							} else {
								elements.elemload.text('无');
								elements.elemload.attr('title', '点击查看已查询过的用户');
								elements.elemload.on('click', function () {
									showAllUser();
								});
							}
						}
					} else {
						for (let elements of checking[id]) {
							elements.elemload.text('无');
							elements.elemload.attr('title', '点击查看已查询过的用户');
							elements.elemload.on('click', function () {
								showAllUser();
							});
						}
					}
					delete checking[id];
					checked[id] = found
				})
				.catch((error) => {
					if (debug) console.error(`【(改)B站成分检测器】即时\n检测 ${name} ${id} 的成分失败`, error);
					for (let elements of checking[id]) {
						elements.elemload.text('重试')
						elements.elemload.attr('title', '点击重新查询此用户成分')
						elements.elemload.on('click', function () {
							checkComposition(id, elements.element, elements.elemload, elements.eleminst, elements.elemcss)
						})
					}
					delete checking[id];
				});
		}
	}
	dom = `<div id="Identified">
	<div id="tips">因判断关键词较为广泛,可能会出现误杀的现象</div>
	<div id="tips">脚本还在测试阶段,喜欢的话还请留下你的评论</div>
	<div id="tips">Ctrl+F 可以快速搜索</div>
	${dom}</div>`;
	function showAllUser() {
		Swal.fire({
			title: '已识别用户',
			html: dom,
			icon: 'info',
			heightAuto: false,
			scrollbarPadding: false,
			showCloseButton: true,
			confirmButtonText: '关闭'
		})
	}

	GM_registerMenuCommand("查看已检查的用户", () => {
		showAllUser();
	});
	GM_registerMenuCommand("手动输入 ID 检查", () => {
		uidChecker();
	});

	function request(option) {
		return new Promise((resolve, reject) => {
			let httpRequest = typeof GM_xmlhttpRequest !== "undefined" ? GM_xmlhttpRequest : GM.xmlHttpRequest;
			httpRequest({
				method: 'get',
				...option,
				onload: (response) => {
					let res = JSON.parse(response.responseText);
					resolve(res);
				},
				onerror: (error) => {
					reject(error);
				},
			});
		});
	}

	function setting(conf_name, tips) {
		if (GM_getValue(conf_name) === 'true') {
			GM_setValue(conf_name, 'false');
			message.info('<span>已禁用 ' + tips + '<br/>刷新后生效,点我将刷新页面。</span>');
		} else {
			GM_setValue(conf_name, 'true');
			message.info('<span>已启用 ' + tips + '<br/>刷新后生效,点我将刷新页面。</span>');
		}
	}

	function uidChecker() {
		Swal.fire({
			title: '成分检测',
			imageUrl: 'https://www.bilibili.com/favicon.ico',
			imageAlt: `哔哩哔哩 干杯~`,
			imageWidth: 40,
			imageHeight: 40,
			input: 'number',
			inputAttributes: {
				autocapitalize: 'off'
			},
			allowOutsideClick: false,
			showCloseButton: true,
			confirmButtonText: '确定并查询',
			showLoaderOnConfirm: true,
			heightAuto: false,
			scrollbarPadding: false,
			text: '请输入要查询的 UID 号码',
			preConfirm: (uid) => {
				return new Promise(async (resolve, reject) => {
					// 检查用户卡片
					try {
						if (!uid) throw new CodeError("请输入完整的用户 UID")
						let cardRequest = await request({
							url: cardApiUrl + uid,
							headers: {
								"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
								"referer": "https://www.bilibili.com",
								"cookies": {
									"buvid3": generateBuvid3(),
								},
							},
						});
						let cardContent = cardRequest;
						if (cardContent.code === 0) {
							let card = cardContent.data.card
							detectComposition(card.mid, card.name, true)
								.then((found) => {
									let result = {
										mid: card.mid,
										name: card.name,
										level: card.level_info.current_level,
										face: card.face,
										sign: card.sign ? card.sign : '',
										official_title: card.Official.title ? card.Official.title : '',
										official_desc: card.Official.desc ? card.Official.desc : '',
										official_role: card.Official.role !== 0 ? (
											card.Official.role === 1 ? '个人认证 - 知名UP主' : card.Official.role === 2 ? '个人认证 - 大V达人' : card.Official.role === 3 ? '机构认证 - 企业' : card.Official.role === 4 ? '机构认证 - 组织' : card.Official.role === 5 ? '机构认证 - 媒体' : card.Official.role === 6 ? '机构认证 - 政府' : card.Official.role === 7 ? '个人认证 - 高能主播' : card.Official.role === 9 ? '个人认证 - 社会知名人士' : '未知认证角色(' + card.Official.role + ')'
										) : '',
										official_type: card.Official.type !== -1 ? (
											card.Official.type === 0 ? 'UP主认证' : card.Official.type === 1 ? '机构认证' : '未知认证类型(' + card.Official.type + ')'
										) : '',
										vip: card.vip.vipType !== 0 ? (
											card.vip.vipType === 1 ? '月度大会员' : card.vip.vipType === 2 ? '年度大会员(或以上)' : '未知会员(' + card.vip.vipType + ')'
										) : '',
										found: found.map(it => ({
											name: it.displayName,
											img: it.displayIcon,
											reason: it.reason,
											item: it.item,
											keyword: it.keyword,
											uid: it.uid,
											full: it.full
										}))
									}
									resolve(result)
								})
								.catch(error => {
									throw error
								})
						} else {
							throw new CodeError(`获取用户信息失败,错误码:${cardContent.code}`)
						}
					} catch (error) {
						resolve(null);
						Swal.showValidationMessage(`失败: ${error}`)
					}
				})
			},
		}).then((result) => {
			if (result.value) {
				let info = result.value
				let value = result.value.found;
				let final = '';
				for (let i = 0; i < value.length; i++) {
					let reason = value[i].keyword || value[i].uid
					let icon = value[i].img ? (
						value[i].img.match("https:") ? `<img referrer="no-referrer" referrerPolicy="no-referrer" src="${value[i].img}" class="composition-icon">` :
							value[i].img.match("data:") ? `<img referrer="no-referrer" referrerPolicy="no-referrer" src="${value[i].img}" class="composition-icon">` :
								`<span class="composition-icon">${value[i].img}</span>`
					) : ''
					final += `
					<div style="margin-top: 25px;">
						<div class="composition-badge">
							<a class="composition-name">${value[i].name}</a>
							${icon}
						</div>
						<div style="margin-top: 12px;">
							<div class="composition-name">原因:${value[i].reason}</div>
							<div class="composition-name">匹配:${reason}</div>
						</div>
					</div>`;
				}
				Swal.fire({
					title: info.name,
					imageUrl: info.face,
					imageAlt: `${info.name}的头像`,
					imageWidth: 200,
					imageHeight: 200,
					html: `<div id="Identified">
							<div id="tips">${info.sign}</div>
							<br/>
							<div id="tips" style="color: #fb7299;">LV${info.level}</div>
							<div id="tips" style="color: #fb7299;"><a href="https://space.bilibili.com/${info.mid}/" target="_blank" style="color: #fb7299;">UID ${info.mid}</a></div>
							<div id="tips" style="color: #fb7299;">${info.vip}</div>
							<br/>
							<div id="tips" style="color: #ffd700;">${info.official_type}</div>
							<div id="tips" style="color: #ffd700;">${info.official_role}</div>
							<div id="tips" style="color: #ffd700;">${info.official_title}</div>
							<div id="tips" style="color: #ffd700;">${info.official_desc}</div>
							<br/>
							<div id="tips">因判断关键词较为广泛,可能会出现识别错误的现象<br/>脚本还在测试阶段,喜欢的话还请留下你的评论</div>
							${final}
						</div>`,
					allowOutsideClick: false,
					showCloseButton: true,
					showConfirmButton: false,
					heightAuto: false,
					scrollbarPadding: false,
				})
			}
		})
	}

	if (GM_getValue('Auto') === 'true') {
		GM_registerMenuCommand('自动检测用户成分:✅ 已启用', function () {
			setting('Auto', '自动检测用户成分')
		});
	} else {
		GM_registerMenuCommand('自动检测用户成分:❌ 已禁用', function () {
			setting('Auto', '自动检测用户成分')
		});
	}

	function addStyle(id, tag, css) {
		tag = tag || 'style';
		let doc = document, styleDom = doc.getElementById(id);
		if (styleDom) styleDom.remove();
		let style = doc.createElement(tag);
		style.rel = 'stylesheet';
		style.id = id;
		tag === 'style' ? style.innerHTML = css : style.href = css;
		doc.getElementsByTagName('head')[0].appendChild(style);
	}

	function addCheckerStyle(text) {
		let color = "#574AB8";

		let swalcss = `
			.swal2-styled{transition: all 0.2s ease;}
			.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:${color} transparent }
			.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:${color};color:#fff;font-size:1em}
			.swal2-styled.swal2-confirm:hover,.swal2-styled.swal2-deny:hover{opacity:0.8;background-image:none!important}
			.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px ${color}80}
			.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px #dc374180}
			.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}
			.swal2-timer-progress-bar{width:100%;height:.25em;background:${color}33 }
			.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:${color};color:#fff;line-height:2em;text-align:center}
			.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:${color} }
			.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:${color}}
			.swal2-popup {padding:1.25em 0 1.25em;flex-direction:column}
			.swal2-close {position:absolute;top:1px;right:1px;transition: all 0.2s ease;}
			div:where(.swal2-container) .swal2-html-container{padding: 1.3em 1.3em 0.3em;}
			div:where(.swal2-container) button:where(.swal2-close):hover {color:${color}!important;font-size:60px!important}
			div:where(.swal2-icon) {
				position: relative !important;
				box-sizing: content-box !important;
				justify-content: center !important;
				width: 5em !important;
				height: 5em !important;
				margin: 2.5em auto .6em !important;
				border: 0.25em solid !important;
				border-radius: 50% !important;
				font-family: inherit !important;
				line-height: 5em !important;
				cursor: default !important;
				user-select: none !important;
			}`;
		let bilicss = `
			[class^="composition-check"] {
				display: inline-block !important;
				cursor: pointer !important;
			}

			.composition-badge {
				display: inline-flex !important;
 				justify-content: center !important;
 				align-items: center !important;
				width: fit-content !important;
 				background: ${color}25 !important;
 				border-radius: 10px !important;
 				margin: 0 6px 0 6px !important;
 				font-family: PingFang SC, HarmonyOS_Regular, Helvetica Neue, Microsoft YaHei, sans-serif !important;
				font-weight: normal !important;
				cursor: pointer !important;
			}

			.composition-name {
 				line-height: 13px !important;
 				font-size: 13px !important;
				color: ${color} !important;
				padding: 2px 8px !important;
			}

			.composition-icon {
				color: ${color} !important;
				background: transparent !important;
				border-radius: 50% !important;
				width: 25px !important;
				height: 25px !important;
				border: 2px solid ${color}80 !important;
				margin: -6px !important;
				margin-right: 6px !important;
				display: flex !important;
				justify-content: center !important;
				align-items: center !important;
				font-size: 20px !important;
			}

			.composition-badge-control {
				display: inline-flex !important;
				justify-content: center !important;
				align-items: center !important;
				width: fit-content !important;
				background: #00000008 !important;
				border-radius: 10px !important;
				margin: 0 5px !important;
				font-family: PingFang SC, HarmonyOS_Regular, Helvetica Neue, Microsoft YaHei, sans-serif;
			}

			.composition-name-control {
				line-height: 13px !important;
				font-size: 12px !important;
				color: #00000050 !important;
				padding: 2px 8px !important;
			}
			`;
		if (text) return bilicss;

		// 先监听颜色方案变化 SweetAlert2-Default
		window.matchMedia('(prefers-color-scheme: dark)').addListener((e) => {
			if (e.matches) {
				// 切换到暗色主题
				addStyle('swal-pub-style', 'style', GM_getResourceText('SwalDark'));
			} else {
				// 切换到浅色主题
				addStyle('swal-pub-style', 'style', GM_getResourceText('Swal'));
			}
		});

		// 再修改主题 SweetAlert2-Default
		if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
			// 切换到暗色主题
			addStyle('swal-pub-style', 'style', GM_getResourceText('SwalDark'));
		} else {
			// 切换到浅色主题
			addStyle('swal-pub-style', 'style', GM_getResourceText('Swal'));
		}
		addStyle('SweetAlert2-User', 'style', swalcss);
		addStyle('BiliChecker-Style', 'style', bilicss);
	};

	// 准备好右上角的Toast提示
	let toast = Swal.mixin({
		toast: true,
		position: 'bottom-end',
		showConfirmButton: false,
		timer: 2700,
		heightAuto: false,
		scrollbarPadding: false,
		timerProgressBar: true,
		didOpen: (toast) => {
			toast.addEventListener('mouseenter', Swal.stopTimer);
			toast.addEventListener('mouseleave', Swal.resumeTimer);
			toast.addEventListener('click', () => {
				window.location.reload(); // 刷新
			});
		}
	});

	// 提示信息
	const message = {
		success: (text) => {
			toast.fire({ html: text, icon: 'success' });
		},
		error: (text) => {
			toast.fire({ html: text, icon: 'error' });
		},
		warning: (text) => {
			toast.fire({ html: text, icon: 'warning' });
		},
		info: (text) => {
			toast.fire({ html: text, icon: 'info' });
		},
		question: (text) => {
			toast.fire({ html: text, icon: 'question' });
		}
	};

	class CodeError extends Error {
		constructor(message) {
			super(message);
			this.name = '';
		}
	}

	function generateBuvid3() {
		const uuid = () => {
			return 'xxxxxx'.replace(/[x]/g, function () {
				return Math.floor(Math.random() * 16).toString(16);
			});
		};
		const randomInt = Math.floor(Math.random() * 99999) + 1;
		const buvid3 = `${uuid()}${randomInt.toString().padStart(5, '0')}infoc`;
		return buvid3;
	}

	function detectComposition(id, name, single) {
		return new Promise(async (resolve, reject) => {
			try {
				// 存储检测结果的数组
				let found = [];

				// 设定请求
				let spaceRequest = request({
					url: spaceApiUrl + id,
					headers: {
						"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
						"referer": "https://www.bilibili.com"
					},
				});

				let followingRequest = request({
					url: followingApiUrl + id,
					headers: {
						'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36',
					},
				});

				console.log(`【(改)B站成分检测器】即时\n正在检查用户 ${name} ${id} 的成分...`);

				// 检查用户是否在黑名单中
				try {
					for (let rule of checkers) {
						if (rule.blacklist) {
							for (let mid of rule.blacklist) {
								if (id.includes(mid)) {
									if (!found.includes(rule)) {
										found.push({
											...rule,
											reason: `黑名单`,
											keyword: "uid" + mid
										});
										if (single) break;
									}
								}
							}
						}
					}
				} catch (error) {
					if (debug) console.error(`【(改)B站成分检测器】即时\n获取 ${name} ${id} 是否在命中名单失败`, error);
				}

				// 检查动态内容
				try {
					let spaceContent = await spaceRequest;
					if (spaceContent.code === 0) {
						let items = spaceContent.data.items;
						for (let rule of checkers) {
							if (rule.keywords) {
								for (let i = 0; i < items.length; i++) {
									let itemContent = items[i]
									let spacefull = items;
									let pendant = itemContent.modules?.module_author?.avatar?.pendant?.text
									let content = itemContent.modules?.module_dynamic?.desc?.text
									if (
										pendant && spacefull && content &&
										rule.keywords.find(keyword => JSON.stringify(pendant).includes(keyword)) &&
										rule.keywords.find(keyword => JSON.stringify(spacefull).includes(keyword)) &&
										rule.keywords.find(keyword => JSON.stringify(content).includes(keyword))
									) {
										found.push({
											...rule,
											full: items[i],
											reason: `空间动态正文`,
											item: content,
											keyword: rule.keywords.find(keyword => JSON.stringify(spacefull).includes(keyword))
										});
										if (single) break;
									} else if (spacefull && rule.keywords.find(keyword => JSON.stringify(spacefull).includes(keyword))) {
										found.push({
											...rule,
											reason: `用户空间内容(动态/简介/认证)`,
											item: items,
											keyword: rule.keywords.find(keyword => JSON.stringify(items).includes(keyword))
										});
										if (single) break;
									}
								}
							}
						}
					} else if (spaceContent.code === -352) {
						console.error(`【(改)B站成分检测器】即时\n获取 ${name} ${id} 的空间动态失败,已触发哔哩哔哩风控,错误码:${spaceContent.code}`);
					} else {
						if (found.length > 0) {
							if (debug) console.error(`【(改)B站成分检测器】即时\n获取 ${name} ${id} 的空间动态失败,错误码:${spaceContent.code}`);
						} else {
							reject(new CodeError(`获取空间动态失败,错误码:${spaceContent.code}`));
						}
					}
				} catch (error) {
					if (debug) console.error(`【(改)B站成分检测器】即时\n获取 ${name} ${id} 的空间动态失败`, error);
				}

				// 检查关注列表
				try {
					let followingContent = await followingRequest;
					if (followingContent.code === 0) {
						let following = followingContent.data.list.map(it => it.mid)
						for (let rule of checkers) {
							if (rule.followings) {
								for (let mid of rule.followings) {
									if (following.includes(mid)) {
										if (!found.includes(rule)) {
											found.push({
												...rule,
												uid: "uid" + mid,
												reason: `关注列表`
											});
											if (single) break;
										}
									}
								}
							}
						}
					} else if (followingContent.code === 22115) {
						console.warn(`【(改)B站成分检测器】即时\n获取 ${name} ${id} 的关注列表失败,对方已关闭展示关注列表,错误码:${followingContent.code}`);
					} else if (followingContent.code === -352) {
						console.error(`【(改)B站成分检测器】即时\n获取 ${name} ${id} 的关注列表失败,已触发哔哩哔哩风控,错误码:${followingContent.code}`);
					} else {
						if (found.length > 0) {
							if (debug) console.error(`【(改)B站成分检测器】即时\n获取 ${name} ${id} 的关注列表失败,错误码:${followingContent.code}`);
						} else {
							reject(new CodeError(`获取关注列表失败,错误码:${followingContent.code}`));
						}
					}
				} catch (error) {
					if (debug) console.error(`【(改)B站成分检测器】即时\n获取 ${name} ${id} 的关注列表失败`, error);
				}

				// 返回检测结果
				if (found.length > 0) {
					console.log(`【(改)B站成分检测器】即时\n检测到 ${name} ${id} 的成分为\n`, JSON.parse(JSON.stringify(found.map(it => { return { name: it.displayName, reason: it.reason, item: it.item, keyword: it.keyword, uid: it.uid, full: it.full } }))))
				}
				resolve(found);
			} catch (error) {
				if (debug) console.error(`【(改)B站成分检测器】即时\n检测 ${name} ${id} 的成分失败`, error);
				reject(error)
			}
		})
	}

	function waitForKeyElements(selectorTxt, actionFunction, bWaitOnce, iframeSelector) {
		function findInShadowRoots(root, selector) {
			let elements = $(root).find(selector).toArray();
			$(root).find('*').each(function () {
				const shadowRoot = this.shadowRoot;
				if (shadowRoot) {
					elements = elements.concat(findInShadowRoots(shadowRoot, selector));
				}
			});
			return elements;
		}
		var targetElements;
		if (iframeSelector) {
			targetElements = $(iframeSelector).contents();
		} else {
			targetElements = $(document);
		}
		let allElements = findInShadowRoots(targetElements, selectorTxt);
		if (allElements.length > 0) {
			allElements.forEach(function (element) {
				var jThis = $(element);
				var alreadyFound = jThis.data('alreadyFound') || false;
				if (!alreadyFound) {
					var cancelFound = actionFunction(jThis);
					if (cancelFound) {
						return false;
					} else {
						jThis.data('alreadyFound', true);
					}
				}
			});
		}
		var controlObj = waitForKeyElements.controlObj || {};
		var controlKey = selectorTxt.replace(/[^\w]/g, "_");
		var timeControl = controlObj[controlKey];
		if (allElements.length > 0 && bWaitOnce && timeControl) {
			clearInterval(timeControl);
			delete controlObj[controlKey];
		} else {
			if (!timeControl) {
				timeControl = setInterval(function () {
					waitForKeyElements(selectorTxt, actionFunction, bWaitOnce, iframeSelector);
				}, 1000);
				controlObj[controlKey] = timeControl;
			}
		}
		waitForKeyElements.controlObj = controlObj;
	}
})