// ==UserScript==
// @name youtube chat control script&&Blacklist extension
// @namespace mod:delete comments ,Get the blocked user channel URL||report comment&&block user&&Add multiple blacklist accounts at once
// @version 2.2.1
// @description dellll
// @author null
// @match *://*.youtube.com/*
// @grant GM_registerMenuCommand
// @grant GM_unregisterMenuCommand
// @grant GM_addStyle
// ==/UserScript==
(function () {
'use strict';
window.location.host ==="studio.youtube.com"&&Add_URL_List ()
if (window.location.pathname !== "/live_chat"&&window.location.pathname !== "/live_chat_replay") return;
if (window.location.pathname!=window.parent.location.pathname)window.parent.document.querySelector("YTD-LIVE-CHAT-FRAME#chat").style.minHeight= "850px";
let language = navigator.language,IsTranslation=false,sc
const SET = GM_registerMenuCommand(language_("Detailed Settings&Log","详细设置&Log","詳細設定&Log"), () => {
Set_()
});
let IsMod = false,IsOwner = false
let Isspecial = document.querySelector("div#top")?.querySelector("#author-name")
Isspecial&&Isspecial.className=="moderator style-scope yt-live-chat-author-chip"?IsMod=true:IsMod=false
Isspecial&&Isspecial.className=="owner style-scope yt-live-chat-author-chip"?IsOwner=true:IsOwner=false
IsOwner&&alert(language_("you are Owner!","你是主播!","あなたはオーナーです!"))
if(IsOwner)return;
let Anemati=[],Node_List=[],Node_Log_List = [],Del_List = [],Keylist = [],NoSpamAccount = [],Tex = [],Comment = []
let Achan=null,Mod_dell=null,This=null
let Ch_m = 0,Node_List_index=0,Delete_interval = 6000,BC= 0 ,Pageleng=0,Spam=0,Normal=0,Untreated=0,doc = Number(localStorage.getItem("doc"))||5,rami = -1,spam_ro = 0,spam_co = 0
let prpr,Ame,Gura,color,Yagoo,Itemslist,color_ames,korone
let Key_l = Number(localStorage.getItem("Key_l"))||16,BBQ = Number(localStorage.getItem("BBQ"))||3,jp_l =Number(localStorage.getItem("jp_l"))||11,en_l = Number(localStorage.getItem("en_l"))||3,Kirara = localStorage.getItem("IsBlock")=="checked"?true:false
let Isblock=localStorage.getItem("IsBlock"),Isreplace=localStorage.getItem("Isreplace")
let PageMode = doc ,pages=doc,Page=0,PageN = 1
let Main_Menu_Box, Dialogs_Confirm ,Report_Menu_report,Report_Menu_Item,index_dell,WTF_1,WTF_2,YMD,YMD_Type,Deleting,Delet_mes,AutoR,ao,my,getmes,kazama
let lng_jp = true,lng_en = true,Auto = false,IsUntreated=false,Isiput = false,LoadMes=true,Mio = false,stop=false,Mod_Runing=false,del_all = false,Selection=true,gift = true,FubuKing=false,checkname = false
let re_=/[\u200b-\u200f\uFEFF\u202a-\u202e]/g
let re_jp = /[\u0800-\u4e00]|[\u4e00-\u9fa5]/g
let re_en = /\b[A-Z]+\w{4,}\b/g
let re_all = /(\b[A-Z]+\w{4,}\b)|[\u0800-\u4e00]{1}|[\u4e00-\u9fa5]{1}|^(<img.*src.*alt.*>)/g
let New_Chat_Frame = document.querySelector("#contents.yt-live-chat-renderer"),iv=document.querySelector("DIV#input")
//css
GM_addStyle(".mes_log_class{font-size:12px;line-height: 25px;text-indent:25px;color: #aaaaaa;}")
GM_addStyle(".item_class{text-indent:15px;display:inline-block;width:100%}")
GM_addStyle(".P_key{cursor:pointer;text-indent:25px;width:100%;height:100%;display:inline-block;font-size:12px}")
GM_addStyle("#key_mes{height:100%;overflow :scroll;overflow-x:auto}")
GM_addStyle(".Title_top{width:100%;height:100%;text-align:center;display:inline-block;cursor:pointer}")
GM_addStyle("#keyword_frame{overflow-y:auto;width:100%;height:150px;overflow-x:hidden}")
GM_addStyle("#new_div_chat{height:150px;overflow:scroll}")
GM_addStyle("#settingitem{user-select:none}")
GM_addStyle("#ChatMes,#Log,#dad:hover{cursor:pointer}")
GM_addStyle(".pro{color:#f00;font-size: 13px;text-align: center;line-height:16px}")
GM_addStyle(".ppts{font-size: 14px;line-height: 25px;text-indent:25px;color: #aaaaaa;}")
GM_addStyle("#Set_off{font-size: 14px;line-height: 21px;text-align:center}")
GM_addStyle(".shion_P{display:inline-block;text-indent: 0px;}")
GM_addStyle("#Y{user-select:none;cursor:pointer}")
function css_white(){
color = "rgba(0, 0, 0, 0.23)"
GM_addStyle(".set_list{width:50%;height:25px;display:inline-block;background-color:rgba(75, 75, 75, 0.2);text-align:center;user-select:none;line-height:25px;cursor:pointer}")
GM_addStyle(".set_item_list{height :25px;background-color:rgba(0, 0, 0, 0.23);text-indent: 10px;line-height:25px;cursor:pointer;font-size:13px;user-select: none")
GM_addStyle(".MainWindow_css{height:250px;overflow:hidden;border-bottom:1px;border-style:solid;border-bottom-color:#0241ff;display:inline-flex;flex-direction:column;overflow:hidden}")
GM_addStyle("textarea{resize: none;width:100%;height:144px;overflow-x:hidden;border-left:0px;border-top:0px;border-right:0px;border-bottom:0px;color:#000000;background-color:#f9f9f9}")//
}
function css_black(){
color = "#4b4b4b"
GM_addStyle(".set_list{width:50%;height:25px;display:inline-block;background-color:#363333;text-align:center;user-select:none;line-height:25px;cursor:pointer}")
GM_addStyle(".set_item_list{height :25px;background-color:#4b4b4b;text-indent: 10px;;line-height:25px;cursor:pointer;font-size:13px;user-select: none")
GM_addStyle(".MainWindow_css{height:250px;overflow:hidden;border-bottom:1px;border-style:solid;border-bottom-color:#ff00006e;display:inline-flex;flex-direction:column;overflow:hidden}")
GM_addStyle("textarea{resize: none;width:100%;height:144px;overflow-x:hidden;border-left:0px;border-top:0px;border-right:0px;border-bottom:0px;color:#FFFFFF;background-color:#181818}")//
}
/////////////////////////////////////////////////language/////////////////////////////////////
function language_(en,zh,jp) {
switch (language) {
case "en-US":
return en
case "zh-CN":
return zh
case "ja":
return jp
default:
return en
}
}
//////////////////////////////////////////////////////////////////////////////////////////////
let Y = document.createElement("div");
Y.innerHTML =' <span id = "Y" style="height: 24px;width: 24px;background: #0ff0;">◺</span> '
Y.title = language_("Turn on detailed settings and log(","打开详细设置和log","詳細設定とログを開く")
Y.onclick = ()=>{
Koyori(true)
Set_()
}
if (New_Chat_Frame){
switch (window.getComputedStyle(New_Chat_Frame, null)?.getPropertyValue('border-color'))
{
case "rgb(255, 255, 255)":
css_black()
color_ames="#ffffff"
WTF_1 = "#303030"
WTF_2 = "#202020"
break;
case "rgb(3, 3, 3)":
css_white()
color_ames="#000000"
WTF_1 = "#d6d6d6"
WTF_2 = "#eeeeee"
break;
}
}
Itemslist = document.querySelector("#items.yt-live-chat-item-list-renderer");
if (!Itemslist) return;
const Important_Frame = document.createElement("div");
Important_Frame.id = "MainWindow";
Important_Frame.setAttribute("class","MainWindow_css");
const shion = document.createElement("div");
const shion_P1 = document.createElement("div");
const shion_P2 = document.createElement("div");
const Setting = document.createElement("div");
const Settinglist = document.createElement("div");
const SettingItem = document.createElement("div")
const O_Item = document.createElement("div");
const shion_p = document.createElement("span");
const GetNewMes = document.createElement("input")
const DellMes = document.createElement("input")
O_Item.style.flexGrow="1";
O_Item.style.height = "130px";
Setting.id = "setting";
shion.id="state"
shion.setAttribute("class","set_item_list")
shion_p.id="tex"
shion_P1.setAttribute("class","shion_P")
shion_P1.style.width = "60%";
shion_P2.setAttribute("class","shion_P")
Settinglist.id = "settinglist";
SettingItem.id = "settingitem";
GetNewMes.type = "button"
GetNewMes.value = language_("Skip","跳过","スキップ")
GetNewMes.id = "skip_p"
DellMes.type = "button"
DellMes.id = "operate"
Kirara?DellMes.value = language_("Block","屏蔽","ブロック") :DellMes.value = IsMod?language_("Delete","删除","削除"):language_("Report","举报","報告")
DellMes.title = language_("arrow key →","方向键 →","矢印キー →");
GetNewMes.title = language_("arrow key ←","方向键 ←","矢印キー ←");
shion_P2.appendChild(GetNewMes);
shion_P2.appendChild(DellMes);
shion_P2.style.display="none"
for (let i=0;i<2;i++){
const set_List = document.createElement("div");
const set_Item_List = document.createElement("div");
const Title = document.createElement("span");
Title.setAttribute("class","Title_top");
set_List.setAttribute("class","set_list");
set_Item_List.setAttribute("class","set_item_list");
set_Item_List.style.display = "none";
switch (i)
{
case 0:
set_List.id = "Input_Key_List";
set_Item_List.id = "Input_Key_Item";
set_Item_List.style.display = "";
Title.innerHTML = language_("Keys","关键词","キーワード")
Title.id = "T1";
break;
case 1:
set_List.id = "gauging";
set_Item_List.id = "gauging_Item";
Title.innerHTML = language_("Comment","评论","コメント");
Title.id = "T2";
break;
}
Settinglist.appendChild(set_List);
set_List.appendChild(Title);
SettingItem.appendChild(set_Item_List);
}
shion_P1.appendChild(shion_p);
shion.appendChild(shion_P1);
shion.appendChild(shion_P2);
Setting.appendChild(Settinglist);
Setting.appendChild(SettingItem);
Important_Frame.appendChild(Setting);
Important_Frame.appendChild(shion);
const nextmes = document.createElement("div");
nextmes.id = "next"
nextmes.innerText = "▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼"
nextmes.style.height = "25px"
nextmes.style.cursor="pointer"
nextmes.style.userSelect="none"
nextmes.style.background="rgba(80, 80, 81, 0.39)"
nextmes.title = language_("Open settings after 1 second","1秒后打开设置","1秒後に設定を開く");
nextmes.before(Important_Frame);
Important_Frame.appendChild(nextmes)
New_Chat_Frame.before(Important_Frame);
const MainWindow = document.getElementById("MainWindow");
ao =IsMod?Kirara?language_("Block","屏蔽","ブロック"):language_("Delete","删除","削除"):Kirara?language_("Block","屏蔽","ブロック"):language_("Report","举报","報告");
const Inputs = document.getElementById("Input_Key_Item");
const gauging_Item = document.getElementById("gauging_Item");
Inputs.style.display="none"
gauging_Item.style.display=""
const TItle_1= document.getElementById("Input_Key_List");
const TItle_2= document.getElementById("gauging");
const gauging_0 = document.createElement("div");
const gauging_1 = document.createElement("div");
const gauging_2 = document.createElement("div");
const gauging_00 = document.createElement("span");
const gauging_01 = document.createElement("span");
const gauging_10 = document.createElement("span");
const gauging_11 = document.createElement("span");
const gauging_20 = document.createElement("span");
const gauging_21 = document.createElement("span");
gauging_0 .style.display = "inline-block";
gauging_0.id = "Key_l"
gauging_00.innerText = language_("Filter word count:","过滤的评论字数:","コメントの長さ:");
gauging_01.innerText = Key_l
gauging_01.setAttribute('contenteditable', 'true')
gauging_01.addEventListener('keydown', function (e) {if(e.keyCode == 13)gauging_01.blur()})
gauging_0.style.textIndent="0px";
gauging_1.style.display = "inline-block";
gauging_1.id = "BBQ"
gauging_10.innerText = language_("Hits:","连续次数:","連打回数:");
gauging_11.innerText = BBQ
gauging_11.setAttribute('contenteditable', 'true')
gauging_2.id = "Interval"
gauging_2.style.display = "inline-block";
gauging_20.innerText = language_("Max Waiting Time(ms):","最大等待时间(ms):","最大待ち時間(ms):");
gauging_21.innerText = Delete_interval
gauging_21.setAttribute('contenteditable', 'true')
gauging_11.addEventListener('keydown', function (e) {if(e.keyCode == 13)gauging_11.blur()})
gauging_0.appendChild(gauging_00);
gauging_0.appendChild(gauging_01);
gauging_1.appendChild(gauging_10);
gauging_1.appendChild(gauging_11);
gauging_2.appendChild(gauging_20);
gauging_2.appendChild(gauging_21);
gauging_Item.appendChild(gauging_0);
gauging_Item.appendChild(gauging_1);
gauging_Item.appendChild(gauging_2);
MainWindow.appendChild(O_Item);
const New_Chat = document.createElement("div");
const Gather_Set = document.createElement("div");
const Keyword_Frame = document.createElement("div");
const Keyword_Frame_Textarea = document.createElement("textarea");
Keyword_Frame_Textarea.id = "keys"
New_Chat.id = "new_div_chat";
Keyword_Frame.style.display = "none";
Gather_Set.id = "Gather_Set"
Gather_Set.style.display = "none";
Gather_Set.style.backgroundColor = color
Gather_Set.style.opacity=0.8
Gather_Set.style.height = "100%"
Keyword_Frame.id = "keyword_frame";
Keyword_Frame_Textarea.placeholder = language_("Paste keywords here and click Add","复制关键词到这后点添加","ここにキーワードを貼り付けて、[Add]をクリックします");
Keyword_Frame_Textarea.style.overflowY="scroll"
Keyword_Frame_Textarea.style.overflowX="scroll"
Keyword_Frame_Textarea.style.whiteSpace="pre"
Keyword_Frame.appendChild(Keyword_Frame_Textarea);
O_Item.appendChild(Keyword_Frame);
O_Item.appendChild(New_Chat);
O_Item.appendChild(Gather_Set);
const Add_Input_Key = document.createElement("input")
Add_Input_Key.id = "add_i_key";
Add_Input_Key.type = "text";
Add_Input_Key.placeholder = language_("Enter keyword","输入单条关键词","キーワードを入力してください");
Add_Input_Key.maxlength = "500"
Inputs.appendChild(Add_Input_Key)
const Add_Button = document.createElement("input")
Add_Button.type = "button"
Add_Button.value = "Add"
Add_Button.id = "add_b_key"
Inputs.appendChild(Add_Button)
const Del_Button = document.createElement("input")
Del_Button.type = "button"
Del_Button.value = "Delete"
Del_Button.id = "delete_key"
Inputs.appendChild(Del_Button)
const Addrun = document.getElementById("overflow")
Addrun.before(Y)
let miko = document.createElement("span")
miko.id = "miko"
miko.innerText = 0
let kanata = document.createElement("div")
kanata.style.display="inline-block"
let kanata_1 = document.createElement("div")
kanata.style.cssText+="font-size:16px"
const rami_1 = document.createElement("span")
rami_1.innerText="0"
const rami_m = document.createElement("span")
rami_m.innerText="/"
kanata_1.appendChild(miko)
kanata_1.appendChild(rami_m)
kanata_1.appendChild(rami_1)
kanata.appendChild(kanata_1)
Addrun.before(kanata)
/////////////////////////Detailed settings /////////////////////////////////
let bo =document.querySelector("yt-live-chat-app")
let TOP_div = document.createElement("div")
TOP_div.id = "TOPdiv"
TOP_div.style.position="absolute"
TOP_div.style.background="rgba(33, 33, 33,0.92)"
TOP_div.style.visibility="hidden"
let IsTaKo = '<div style="height: 50px;">'
+ '<div style="color: rgb(255, 255, 255);text-align:right;padding-top: 5px;padding-right: 10px;">'
+ '<span id="Set_off" style="display: inline-block;cursor:pointer;width: 21px;height: 21px">×</span>'
+ '</div>'
+ '</div>'
+ '<div style="overflow-y: scroll;overflow-x: hidden;">'
+ '<div style="height: 30px;width: 100%;display: inline-flex">'
+ '<div class="ppts" style="width: 85%;">'
+ '<span>' + language_("Block Users", "屏蔽用户", "ユーザーをブロックする") + '</span>'
+ '</div>'
+ '<div class="ppts" style="width: 15%">'
+ '<input id="ISblock" type="checkbox" ' + Isblock + '>'
+ '</div>'
+ '</div>'
+ '<div style="height: 30px;width: 100%;display: inline-flex">'
+ '<div class="ppts" style="width: 85%;"><span>' + language_("Replace chat comments", "替换聊天评论", "チャットコメントを置き換える") + '</span>'
+ '</div>'
+ '<div class="ppts" style="width: 15%">'
+ '<input id="ISreplace" type="checkbox" ' + Isreplace + '>'
+ '</div>'
+ '</div>'
+ '<div style="height: 30px;width: 100%;display: inline-flex">'
+ '<div class="ppts" style="width: 85%;">'
+ '<span>' + language_("Show Log", "输出log", "ログを表示") + '</span>'
+ '</div>'
+ '<div class="ppts" style="width: 15%">'
+ '<input id="Log_Show" type="checkbox">'
+ '</div>'
+ '</div>'
+ '</div>'
+ '<div style="width: 100%;height: 10px;background-color:#f9f9f947">'
+ '</div>'
+ '<div id="antetype_mes" style="display: none;border-bottom: 1px solid #666;border-top-width: 1px; border-left-width: 1px;border-left-style: solid;border-top-style: solid;">'
+ '<div style="display: inline-flex; width: 100%">'
+ '<div id="Log_Name" class="ppts" style="width: 85%;color:#ffffff"> =_________________________________='
+ '</div>'
+ '<div id="antetype" class="ppts" style="width: 15%;display: none" >'
+ '<input id="Unblock" type="checkbox" >'
+ '</div>'
+ '</div>'
+ '<div id = "mes_log" class = "mes_log_class" style="display: none">'
+ '</div>'
+ '</div>'
+ '<div id = "AllLog" style=" border-bottom-width: 0px; width: 100%;height: 25px;background-color:#f9f9f930;">'
+ '<div style="display:inline-flex; width: 96%" class="ppts"><div style="width:50%">' + language_("Sort", "排序:", "ソート")
+'<select id="Category_sort">'
+'<option value="name">' + language_("Name", "名字", "名前")+ '</option>'
+'<option value="Blocked">' + language_("Blocked", "已屏蔽", "ブロック済み") + '</option>'
+'<option value="nene" style="display:none">' + language_("Untreated", "未处理", "未処理") + '</option>'
+'<option value="URL_" style="display:none">' + language_("Channel URL", "频道URL", "チャネルURL") + '</option>'
+'</select>'
+'</div>'
+'<div><input id="del_a"style="visibility:hidden" value = "'+language_("Block","屏蔽","ブロック")+'" title = "'+ language_("","","")+'" type="button"><input id="All_Block" type="button" value = "'+language_("Single Selection","单选","一択")+'" title = "'+ language_("","","")+'"></div>'
+'</div>'
+'<div id="Block_Logs" style="overflow-y: scroll;overflow-x:hidden;">'
+'</div>'
+'<div id = "Options" class="ppts">'
+'<input id="up_" type="button" value="<" >'
+'<input id ="page_" type="text" style=" width:35px" value = "1">'
+'<input id="dow_" type="button" value=">" > '
+'<input id="max_"type="button" value="Max:1">'
+'<input id="Untreated_"type="button" value=' + language_("Untreated", "未处理", "未処理") +' >'
+'<input id ="isco" type="text" style="width:20px" value = "'+doc+'">/Page'
+'</div>'
+'</div>'
+'<div id="Dump" style="display:none">'
+'</div>'
TOP_div.innerHTML = IsTaKo
bo.appendChild(TOP_div)
document.querySelector("yt-icon-button#overflow").after(Y)
let pro = document.createElement("div")
pro.id = "Pro"
pro.style.position="relative"
pro.style.display = "none"
MainWindow.appendChild(pro)
pro.innerHTML = '<div id="PRO_1" class="pro" style="height: 16px;background:rgba(75,75,75,0.7)"></div>'
let Zeta = '<div style="text-align:center">language settings:(0 or 200)don\'t get this language</div><div style="height: 10px;"></div>'
+'<div style="text-align:center;display:flex;line-height: 25px;background:rgba(128,128,128,0.8)">'
+'<div style="width:50%;height: 25px;display:flex">'
+'<div style="min-width: 80px;text-align:right">'+language_("Japanese", "日语", "日本語")+'</div>'
+'<div style="min-width: 70px;text-align:right;">'+language_("Word Count>", "字数>", "文字数>")+'</div>'
+'<div><input id="lng_jp" type="text" style="width: 20px;height: 11px;" value="'+jp_l+'"></div>'
+'</div>'
+ '<div style="width:50%;height: 25px;display:flex;background:rgba(128,128,128,0.8)">'
+ '<div style="min-width: 80px;text-align:right">'+language_("English", "英语", "英語")+'</div>'
+'<div style="min-width: 70px;text-align:right;">'+language_("Word Count>", "单词数>", "単語数>")+'</div>'
+'<div><input id="lng_en" type="text" style="width: 20px;height: 11px;"value="'+en_l+'">'
+'</div>'
+'</div>'
+'</div>'
Gather_Set.innerHTML = Zeta
shion_p.innerText=count()
/////////////////////function/////////////////
getmes = function Getmes(){
shion_p.innerText = count();
if(BC>299){
for(let i = 299;i>=99;i--){
New_Chat.children[i].remove()
BC--
}
}
for(let i=Node_List.length-1;i>=0;i--){
if (Node_List[i].Isspam===null){
index_dell=i
break
}
}
if (index_dell!=null){
Mod_dell = Node_List[index_dell].node
let Fragment = document.createDocumentFragment()
let Item_Top = document.createElement("div")
Item_Top.id = index_dell
Item_Top.setAttribute("class","item_class");
Item_Top.title = "Name:{"+Node_List[index_dell].name+"}"
Item_Top.style.fontWeight="bold"
Item_Top.style.backgroundColor=BC%2==0?WTF_1:WTF_2
for (let i = 0,L = Node_List.length;i<L;i++){
if(Node_List[index_dell].name_src == Node_List[i].name_src&&Node_List[i].Isspam==null){
let Item = document.createElement("div")
Item.innerText = Node_List[i].Message
Item.id = Node_List[i].index
if (Node_List[i].dubious)Item.style.color = "red"
if (Node_List[i].interval<1)Item.style.background="rgba(255, 218, 74, 0.2) "
Item_Top.prepend(Item)
Fragment.prepend(Item_Top)
}
}
New_Chat.prepend(Fragment)
BC++
shion_P2.style.display=""
}else{
Mod_dell=null
index_dell= null
Mes(language_("No New Comment!","没有新的评论!","新しいコメントなし!"))
shion_P2.style.display="none"
}
}
function Action(){
let first = New_Chat.firstElementChild
first.style.textDecoration="line-through"
first.style.fontWeight="normal"
first.style.opacity = 0.4
if(Kirara){
Node_List[index_dell].act ="Block"
Node_List.forEach((mes)=>{
if (Node_List[index_dell].name_src == mes.name_src){
mes.Isblock = true
mes.Isspam =true
}
})
first.style.color="red"
Queue(Mod_dell,index_dell)
}else{
Node_List.forEach((mes)=>{
if (Node_List[index_dell].name_src == mes.name_src){
if (mes.Isspam===null) {
mes.Isspam =true
if(IsMod){
mes.act = "Delete"
Queue(mes.node,mes.index)
}else{
mes.act = Anemati.includes(Node_List[index_dell].name_src)?"Block":"Report"
}
}
}
})
first.style.color="yellow"
if(!IsMod)Queue(Mod_dell,index_dell)
}
Anemati.push(Node_List[index_dell].name_src)
Mod_dell=null
index_dell=null
shion_p.innerText=count()
Untreated?getmes():shion_P2.style.display="none"
}
function skip(){
Mes(language_("Comment skipped","已跳过评论","スキップしました"),"skip")
let Top =New_Chat.firstElementChild
for (let i = 0,l =Top.children.length;i<l;i++){
Node_List[Top.children[i].id*1].Isspam = false;
}
Top.style.color="green"
Top.fontWeight="normal"
Top.style.opacity = 0.5
Mod_dell=null
index_dell=null
shion_p.innerText=count()
if(Untreated){
getmes()
}else{
shion_P2.style.display="none"
}
}
//===================================================onev===============================================================================
let All_Block = document.getElementById("All_Block")
let up_ = document.getElementById("up_");
let max_ =document.getElementById("max_");
let page_= document.getElementById("page_");
let dow_ = document.getElementById("dow_");
let isco_ = document.getElementById("isco");
let Untreated_ = document.getElementById("Untreated_");
let Category = document.querySelector("#Category_sort")
let BlockLogs=document.querySelector("#Block_Logs")
if (IsMod)Category.options[3].style.display = ""
let golo
lng_jp = document.getElementById("lng_jp");
lng_en= document.getElementById("lng_en");
lng_jp.oninput = ()=>{
clearTimeout(golo)
golo =setTimeout(()=>{
let isn = lng_jp.value.match(/[0-9]+/g)
isn =isn?isn[0]*1:0
!(isn)?jp_l = 200:jp_l = isn>10?isn:11
lng_jp.value = jp_l
Key_l = jp_l>en_l?jp_l:en_l
gauging_01.innerText = Key_l
localStorage.setItem("Key_l",Key_l)
localStorage.setItem("jp_l",jp_l)
lng_jp.blur()
},1500)
}
lng_en.oninput = ()=>{
clearTimeout(golo)
golo =setTimeout(()=>{
let isn = lng_en.value.match(/[0-9]+/g)
isn =isn?isn[0]*1:0
!(isn)?en_l = 200:en_l = isn>3?isn:3
lng_en.value= en_l
Key_l = jp_l>en_l?jp_l:en_l
gauging_01.innerText = Key_l
localStorage.setItem("Key_l",Key_l)
localStorage.setItem("en_l",en_l)
lng_en.blur()
},1500)
}
dow_.onclick = function(){
if(PageN<Math.ceil(Pageleng/PageMode)) PageN++
if(pages<Pageleng){
Page=Number(Page)+Number(PageMode);
pages=Number(pages)+Number(PageMode)
}
page_.value = PageN
Log_List(YMD,Page,pages)
show_l()
}
up_.onclick = function(){
if(Page-PageMode>=0){
Page=Page-PageMode;
pages=pages-PageMode;
if(PageN>1) PageN--
}
page_.value = PageN
Log_List(YMD,Page,pages)
show_l()
}
isco_.oninput = ()=>{
if(!isco_.value)return
doc = isco_.value<1?5:Number(isco_.value)
isco_.value = doc
localStorage.setItem("doc",doc)
PageMode = doc;pages = doc;Page=0;PageN = 1
page_.value=PageN
Log_List(YMD,Page,pages)
show_l()
}
page_.oninput = ()=>{
pages=doc
if (page_.value<=Math.ceil(Pageleng/PageMode)){
if(page_.value<1)page_.value=1
pages = pages * page_.value
}else{
page_.value = Math.ceil(Pageleng/PageMode)
pages = pages * page_.value
}
Page=pages-PageMode
Log_List(YMD,Page,pages)
show_l()
}
max_.onclick = function(){
PageMode = doc;pages=doc;Page=0;PageN = 1
let max =Math.ceil(Pageleng/PageMode)
PageN = max
pages = pages * max
Page=pages-PageMode
page_.value = PageN
Log_List(YMD,Page,pages)
show_l()
}
Untreated_.onclick = function(){
let LogMes =[];
Node_Log_List = Node_List.filter((item)=>{
let Na = true
if(item.Isspam===null){
Na=LogMes.includes(item.name_src)
!Na&&LogMes.push(item.name_src)
}
return !Na
})
if(!Node_Log_List.length)return;
All_Block.style.display = ""
page_.value = 1
IsUntreated = true
Category.options[2].style.display = ""
Category.selectedIndex=2
Category.disabled = true
Untreated_.value = Untreated+ " " + language_("Untreated", "未处理", "未処理")//
Page= 0;pages=doc;PageN = 1
Log_List(Node_Log_List,Page,pages,"name",false)
show_l()
BlockLogs.scrollTop=BlockLogs.scrollHeight
}
document.addEventListener('keyup', logKey);
function logKey(e) {
let Isinput = document.activeElement.id == "input"
switch (e.code)
{
case "ArrowRight":
if (Isinput)return
if (New_Chat.style.display == "none"){
Keyword_Frame.style.display = "none"
Gather_Set.style.display = "none"
New_Chat.style.display = ""
}else{
Mod_dell&&!Node_List[index_dell].Isblock?Action():getmes()
}
break;
case "ArrowLeft":
if (Isinput)return
if (New_Chat.style.display == "none"){
Keyword_Frame.style.display = "none"
Gather_Set.style.display = "none"
New_Chat.style.display = ""
}else{
Mod_dell?skip():getmes()
}
break;
case "ArrowUp":
if (!Isinput||!Comment.length||Isiput)return
Comment.length-1>rami&&rami++
iv.innerHTML=Comment[rami]
iv.dispatchEvent(new InputEvent("input"));
break;
case "ArrowDown":
if (!Isinput||!Comment.length||Isiput)return
rami = rami<0?Comment.length:rami
rami>0&&rami--
iv.innerHTML=Comment[rami]
iv.dispatchEvent(new InputEvent("input"));
break;
case "Enter":
rami = -1
break;
case "NumpadEnter":
rami = -1
}
}
Add_Button.onclick = function addkey() {
let KeyItemList_="",LogNames=[]
if (Add_Input_Key.value != ""){
let cdk = Add_Input_Key.value.trim()
Keylist.push(cdk)
}else if (Keyword_Frame_Textarea.value!=""){
Keylist=Keyword_Frame_Textarea.value.trim().split('\n')
DellArray("",Keylist)
}
Add_Input_Key.value = ""
Node_List.filter((item)=>{
let Na = true
if (item.Isspam){
Na=LogNames.includes(item.Message)
!Na&&Keylist.push(item.Message)
!Na&&LogNames.push(item.Message)
}
return !Na
})
Keylist=[...new Set(Keylist)]
for (let i=0,l=Keylist.length;i<l;i++){
KeyItemList_+=(i+1== l)?Keylist[i]:Keylist[i]+"\n";
}
Del_Button.value = Keylist.length+"Delete"
Keyword_Frame_Textarea.value = KeyItemList_
}
Del_Button.onclick = function () {
Keylist = []
Del_Button.value = "Delete"
Add_Input_Key.value = ""
Keyword_Frame_Textarea.value = ""
}
GetNewMes.onclick = function () {
if (New_Chat.style.display == "none"){
Keyword_Frame.style.display = "none"
Gather_Set.style.display = "none"
New_Chat.style.display = ""
}else {
Mod_dell&&skip()
}
}
shion_P2.onmouseenter = ()=>{
iv&&iv.blur()
New_Chat.scrollTop=0
Koyori(true)
}
shion_P2.onmouseleave = ()=>{
!FubuKing&&Koyori(false)
}
DellMes.onclick = function () {
clearTimeout(kazama);kazama=null;
if (New_Chat.style.display == "none"){
Keyword_Frame.style.display = "none"
Gather_Set.style.display = "none"
New_Chat.style.display = ""
}else{
Mod_dell&&Action()
}
}
Settinglist.onclick = function (e){
let LogNames = []
switch (e.target.id)
{
case "T1":
if(Inputs.style.display="none" )Inputs.style.display="";
if (Inputs.style.display==""){
TItle_1.style.backgroundColor=color
TItle_2.removeAttribute("style")
gauging_Item.style.display = "none"
New_Chat.style.display = "none"
Keyword_Frame.style.display = ""
Gather_Set.style.display = "none";
let KeyItemList_ = ""
Node_List.filter((item)=>{
let Na = true
if (item.Isspam){
Na=LogNames.includes(item.Message)
!Na&&Keylist.push(item.Message)
!Na&&LogNames.push(item.Message)
}
return !Na
})
Keylist=[...new Set(Keylist)]
for (let i=0,l=Keylist.length;i<l;i++){
KeyItemList_+=(i+1== l)?Keylist[i]:Keylist[i]+"\n";
}
Del_Button.value = Keylist.length+"Delete"
Keyword_Frame_Textarea.value = KeyItemList_
}
break;
case "T2":
if(gauging_Item.style.display="none")gauging_Item.style.display="";
if (gauging_Item.style.display==""){
TItle_1.removeAttribute("style")
TItle_2.style.backgroundColor=color
Inputs.style.display = "none"
New_Chat.style.display = ""
Keyword_Frame.style.display = "none"
Gather_Set.style.display = "none";
}
break;
}
}
SettingItem.onclick =function(e){
if(e.target.nodeName=="SPAN"){
switch (e.target.parentNode.id)
{
case "Key_l":
gauging_01.focus();
gauging_01.innerText= "";
break;
case "BBQ":
gauging_11.focus();
gauging_11.innerText= "";
break;
case "Interval":
gauging_21.focus();
gauging_21.innerText= "";
}
}
}
Gather_Set.onmouseleave = ()=>{
if(Keyword_Frame.style.display != "none") return
!FubuKing&&Koyori(false)
New_Chat.style.display = ""
Keyword_Frame.style.display = "none"
Gather_Set.style.display = "none"
}
SettingItem.onmouseover = function(e){
if(e.target.nodeName=="SPAN"){
switch (e.target.parentNode.id)
{
case "Key_l":
e.target.title = language_("Set a number greater than 10","设置大于10的数","10より大きい数を設定");
break;
case "BBQ":
e.target.title = language_("Set a number greater than 1 and less than 10","设置大于1小于10的数字","1より大きく10より小さい数値を設定して");
break;
case "Interval":
e.target.title = language_("Set a number greater than 3000","设置大于3000的数","3000より大きい数を設定");
}
}
}
gauging_01.onblur = ()=>{
let x=gauging_01.innerText
let xx=parseInt(x)
typeof xx=='number'&&x!=""&&!isNaN(xx)&&Math.abs(xx)>10?Key_l=Math.abs(xx):Key_l= Key_l
gauging_01.innerText=Key_l
localStorage.setItem("Key_l",Key_l)
}
gauging_11.onblur = ()=>{
let x=gauging_11.innerText
let xx=parseInt(x)
typeof xx=='number'&&x!=""&&!isNaN(xx)&&Math.abs(xx)>2?BBQ=Math.abs(xx):BBQ= BBQ
gauging_11.innerText=BBQ
localStorage.setItem("BBQ",BBQ)
}
gauging_21.onblur = ()=>{
let x=gauging_21.innerText
let xx=parseInt(x)
typeof xx=='number'&&x!=""&&!isNaN(xx)&&Math.abs(xx)>3000?Delete_interval=Math.abs(xx):Delete_interval= Delete_interval
gauging_21.innerText=Delete_interval
}
nextmes.onmouseout = ()=>{
clearTimeout(korone)
}
nextmes.onmouseover = ()=>{
clearTimeout(korone);korone=null
korone=setTimeout(()=>{
Koyori(true)
iv&&iv.blur()
if(Keyword_Frame.style.display != "none") return
New_Chat.style.display = New_Chat.style.display == "none"?"":"none"
Keyword_Frame.style.display = "none"
Gather_Set.style.display = Gather_Set.style.display == "none"?"":"none"
},1000)
}
//===================================================filter================================================================================
function Iroha(mes,Height){
let reen =mes.match(re_en)
let enl = reen?reen.length:0
let rejp =mes.match(re_jp)
let jpl = rejp?rejp.length:0
let reall=mes.match(re_all)
let all_l =reall?reall.length:0
let save = (all_l > Key_l)||(enl>en_l)||(jpl>jp_l)
return save
}
Yagoo = new MutationObserver((Guestbook) => {
Guestbook.forEach(function (MessageList) {
MessageList.addedNodes.forEach(function (node) {
if (node.nodeName=="YTD-SPONSORSHIPS-LIVE-CHAT-GIFT-PURCHASE-ANNOUNCEMENT-RENDERER"&&gift)call("Gift Thank you")
if (node.nodeName!="YT-LIVE-CHAT-TEXT-MESSAGE-RENDERER")return;
const Messages_EL = node.querySelector("#message");
const Yname = node.querySelector("#author-name");
const may = node.querySelector("#chip-badges").children.length;
if (!Yname||!Messages_EL||may) return;
const Tname = node.querySelector("#author-photo").querySelector("#img");
let Tname_=Yname.innerText;
let Cdk = Messages_EL.innerText.trim();
if(checkname)Cdk = Tname_.length>Cdk.length?Tname_:Cdk
if(!Iroha(Cdk,node.offsetHeight)){Ch_m += 1;return};
if (node.querySelector("#card") || node.querySelector(".member")) return;
let Tname_T = Tname.src+"["+encodeURIComponent(Tname_)+"]";
let Key_On = false,Peko = false,Ischeck = false,IsSp = false;
let get_time =new Date().getSeconds();
Peko = Anemati.includes(Tname_T);
if (!Peko){
Keylist.length&&Keylist.some((item)=>{
if (item==Cdk){
Key_On = true
IsSp = true
}
return Key_On;
})
!Key_On&&Node_List.some((item)=>{
if (item.Message==Cdk){
Key_On = true
if(item.Isspam===false){
Ischeck = true
}else if(item.Isspam===true){
IsSp = true
}
}
return Key_On;
})
}
if(Ischeck)return;
Node_List.push({node:node,name:Tname_,name_src:Tname_T,index:Node_List_index,Isblock:false,Isspam:null,regexp:GetKey(Cdk),Message:Cdk,Time:get_time,interval:Ch_m,act:null,dubious:false});
if(Ame){
let zoo = document.createElement("span");
zoo.id = "ZOO"
zoo.innerHTML = Zoo();
Messages_EL.style.visibility = "hidden";
Messages_EL.before(zoo)
}
if(Mod_Runing&&del_all){
Node_List[Node_List_index].act = "Delete"
Queue(node,Node_List_index)
}else{
if (Key_On) {
if (IsSp){
Node_List[Node_List_index].act ="Block"
Node_List[Node_List_index].Isspam =true
Node_List[Node_List_index].Isblock = true
Queue(node,Node_List_index)
}else{
Node_List[Node_List_index].dubious = true
Mod_dell==null&&getmes()
}
}else if(Peko){
Node_List[Node_List_index].Isspam =true
let end = Node_List.some((item)=>{
return (item.name_src == Tname_T&&item.Isblock == true)
})
if (!Mod_Runing&&!Auto){
Node_List[Node_List_index].act =IsMod?"Delete":"Report"
if(Kirara&&!end){
Node_List[Node_List_index].act = "Block"
Node_List[Node_List_index].Isblock = true
}
}else if((Mod_Runing||Auto)&&!end){
Node_List[Node_List_index].act ="Block"
Node_List[Node_List_index].Isblock = true
}
Queue(node,Node_List_index)
}else{
let a=Node_List.length-1,b=Node_List.length-1-BBQ,Iscar=0
for(let i=a,c=b<0?0:b;i>=c;i--){
if(Node_List[i].name_src==Tname_T) Iscar++
}
if (Iscar>=BBQ&&Ch_m<=BBQ) {
Anemati.push(Tname_T)
let first = New_Chat.firstElementChild
first.style.textDecoration="line-through"
first.style.fontWeight="normal"
first.style.opacity = 0.4
Node_List.forEach((mes)=>{
if (Node_List[Node_List_index].name_src == mes.name_src&&!mes.Isblock){
mes.Isspam =true
if(Mod_Runing||Auto||Kirara){
mes.Isblock = true
}else{
mes.act =IsMod?"Delete":"Report"
Queue(mes.node,mes.index)
}
}
})
if(Mod_Runing||Auto||Kirara){
Node_List[Node_List_index].act ="Block"
Queue(node,Node_List_index)
}
}else{
Mod_dell==null&&getmes()
}
}
}
Ch_m=0;Node_List_index++
shion_p.innerText=count()
Untreated_.value =Untreated+ " " + language_("Untreated", "未处理", "未処理")
});
});
});
Yagoo.observe(Itemslist, {
childList: true,
});
let ISblock=document.getElementById("ISblock")
let ISreplace=document.getElementById("ISreplace")
let LogShow=document.querySelector("#Log_Show")
let Dump = document.querySelector("#Dump")
let Coco=document.getElementById("antetype_mes");
let PRO_1 =document.getElementById("PRO_1")
let AllLog=document.querySelector("#AllLog")
let TOPdiv=document.getElementById("TOPdiv")
let Del_all = document.getElementById("del_a")
let Report_Menu_Fram,Dialogs_Confirm_Fram,Main_Menu_Fram,MenuOperationing=false,wi=MainWindow.clientWidth
AllLog.style.visibility = "hidden"
Kirara = ISblock.checked
Ame = ISreplace.checked
Isauto()
Menu_Set()
function Menu_Set() {
let F=document.querySelector("div#input-panel")
let FF = new MutationObserver((node) =>Isauto())
FF.observe(F, {
childList: true,
})
let Menu_black = new MutationObserver((node) => {
for (let item of node){
for (let op of item.addedNodes){
if (op.nodeName=="TP-YT-IRON-OVERLAY-BACKDROP")op.style.display="none"
}
}
});
Menu_black.observe(document.querySelector("body"), {childList: true,});
let Mumei =document.querySelector("yt-live-chat-app")
let Menu_Set = new MutationObserver((node) => {
for (let item of node){
for (let op of item.addedNodes){
switch (op?.children[0]?.nodeName)
{
case "YT-REPORT-FORM-MODAL-RENDERER":
Report_Menu.disconnect()
Report_Menu.observe(op,{attributeFilter:[ "style"],})
Report_Menu_report=op.querySelector("#submit-button")
Report_Menu_Item=op.querySelector(".radio.style-scope.yt-options-renderer")
Report_Menu_Fram = op
break;
case "YT-CONFIRM-DIALOG-RENDERER":
Dialogs.disconnect()
Dialogs.observe(op,{attributeFilter:[ "style"],});
Dialogs_Confirm=op.querySelector("#confirm-button")
Dialogs_Confirm_Fram = op
break;
case "DIV":
if(op?.children[0].children[0].nodeName!="YTD-MENU-POPUP-RENDERER") return
Main_Menu.disconnect()
Main_Menu.observe(op,{attributeFilter:[ "style"],});
Main_Menu_Box = op.querySelector("#items").children
Main_Menu_Fram = op
}
}
}
if(Report_Menu_Fram&&Dialogs_Confirm_Fram&&Main_Menu_Fram)Menu_Set.disconnect()
});
Menu_Set.observe(Mumei, {
childList: true,
});
let Main_Menu = new MutationObserver((E) => {
if (Achan===null||Main_Menu_Fram.style.display=="none")return
Main_Menu_Fram.style.display = "none"
if (IsMod)Node_List[Achan].URL=document.querySelector("ytd-menu-navigation-item-renderer").children[0].href
let Main_Menu_Click,BoxLength=Main_Menu_Box.length
let MSG = Del_List.length
Main_Menu_Click&&Main_Menu_Click.children[0].children[0].click();
switch (Node_List[Achan].act){
case "Report":
Main_Menu_Click= BoxLength=2?Main_Menu_Box[0]:Main_Menu_Box[1]
break;
case "Delete":
BoxLength==5?Main_Menu_Click = Main_Menu_Box[2]:null
Mes(language_("Comment deleted","已删除评论","コメントが削除されました "),Node_List[Achan].act)
break;
case "Block":
IsMod?Main_Menu_Click = BoxLength ==4? Main_Menu_Box[3]: Main_Menu_Box[4]:Main_Menu_Click = Main_Menu_Box[1]
IsMod&&Mes(language_("User has been blocked","用户已屏蔽","ユーザーがブロックされました"),Node_List[Achan].act)
IsMod&&spam_co++;
rami_1.innerText = spam_co;
break;
case "Unblock":
IsMod?Main_Menu_Click = BoxLength ==4? Main_Menu_Box[3]: Main_Menu_Box[4]:Main_Menu_Click = Main_Menu_Box[1]
Mes(language_("Unblocked","已解除屏蔽","ユーザーのブロックが解除した"))
miko.innerText = stop?"Pausing:"+MSG:MSG;
spam_co--
rami_1.innerText = spam_co
DellMes.disabled = false
GetNewMes.disabled = false
}
Main_Menu_Click&&Main_Menu_Click.children[0].children[0].click();
if (!IsMod&&Node_List[Achan].act=="Unblock"){
clearTimeout(Deleting);Deleting=null;Achan=null;FubuKing = false;
MSG?Queue():Mio=false;
}else if(IsMod){
miko.innerText = stop?"Pausing:"+MSG:MSG;
clearTimeout(Deleting);Deleting=null;Achan=null;FubuKing = false;
if (MSG){
Queue();
}else{
Mio=false;
DellMes.disabled = false
GetNewMes.disabled = false
}
}
});
let Dialogs = new MutationObserver((E) => {
if (Dialogs_Confirm_Fram.style.display=="none")return
Dialogs_Confirm_Fram.style.display="none"
let MSG = Del_List.length
if (Achan!=null){
switch (Node_List[Achan].act){
case "Report":
Mes(language_("Comment has been reported","已举报评论","コメントが報告されました"),Node_List[Achan].act)
spam_ro++
break;
case "Block":
spam_co++
Mes(language_("User has been blocked","用户已屏蔽","ユーザーがブロックされました"),Node_List[Achan].act)
}
}
clearTimeout(Deleting);Deleting=null;Achan=null;FubuKing = false;
DellMes.disabled = false
GetNewMes.disabled = false
rami_1.innerText = spam_co
miko.innerText = stop?"Pausing:"+MSG:MSG;
Dialogs_Confirm.children[0].children[0].click();
MSG?Queue():Mio=false;
});
let Report_Menu = new MutationObserver((E) => {
if (Report_Menu_Fram.style.display=="none")return
Report_Menu_Fram.style.display="none"
Report_Menu_Item.click()
Report_Menu_Item.setAttribute('class', 'radio style-scope yt-options-renderer iron-selected')
Report_Menu_Item.setAttribute('aria-checked', 'true')
Report_Menu_Item.setAttribute('aria-selected', 'true')
Report_Menu_Item.setAttribute('checked', '')
Report_Menu_Item.setAttribute('active', '')
Report_Menu_Item.setAttribute('focused', '')
Report_Menu_report.click();
});
}
function DellArray(V,Array){
let Fubigi = [];
for (let i= Array.length-1;i>=0;i--){
if(Array[i].proto==V){
Array.splice(i, 1)
}
}
Array = Array.filter((item)=>{
let Na=Fubigi.includes(item.proto)
!Na&&Fubigi.push(item)
return !Na
})
return Array
}
function GetKey(en) {
en = en.match(re_all)
let items=""
en.forEach((item)=>{
let tes = re_.test(item)
if (tes)return;
items += item+".*"
})
return ".*"+ items
}
pro.style.width=wi+"px";
pro.setAttribute('class', 'pro')
TOPdiv.onclick=(e)=>{
let GTA,LogNames = [],ssd,index,AutoR
switch (e.target.id)
{
case "Set_off":
TOPdiv.style.visibility="hidden";
AllLog.style.visibility = "hidden"
Category.disabled = false
Category.selectedIndex=0
Category.options[2].style.display = "none"
IsUntreated=false
Del_all.style.visibility = "hidden"
Untreated_.value =Untreated+ " " + language_("Untreated", "未处理", "未処理")
BlockLogs.innerHTML=null
LogShow.checked =false
Selection = true
!FubuKing&&Koyori(false)
break;
case "ISblock":
AutoR=document.querySelector("#auto___")
Isblock = ISblock.checked?"checked":" "
Kirara=ISblock.checked
localStorage.setItem("IsBlock",Isblock)
Kirara?DellMes.value = language_("Block","屏蔽","ブロック") :DellMes.value = IsMod?language_("Delete","删除","削除"):language_("Report","举报","報告")
break;
case "ISreplace":
Isreplace = ISreplace.checked?"checked":" "
Ame=ISreplace.checked
localStorage.setItem("Isreplace",Isreplace)
break;
case "Log_Show":
Del_all.style.visibility = "hidden"
Selection = true
Node_Log_List= Node_List.filter((item)=>{
let Na = true
if (item.Isspam&&!item.Isblock){
Na=LogNames.includes(item.name_src)
!Na&&LogNames.push(item.name_src)
}
return !Na
})
Node_Log_List = Node_Log_List.filter((item)=>{
let block = Node_List.find((node)=>{
if (node.name_src == item.name_src){
return node.Isblock
}
})
return !block
})
Gura =LogShow.checked
All_Block.style.display = ""
Untreated_.value = Untreated+ " " + language_("Untreated", "未处理", "未処理")
if(!Gura){
BlockLogs.innerHTML=null
IsUntreated=false
AllLog.style.visibility = "hidden"
Category.selectedIndex=0
Category.disabled = false
Category.options[2].style.display = "none"
Koyori(true)
return
}
!FubuKing&&Koyori(false)
BlockLogs.style.height = "414px"
AllLog.style.visibility = "visible"
PageMode = doc;pages=doc;Page=0;PageN = 1
page_.value = PageN
sort(false,"name",Node_Log_List)
Log_List(Node_Log_List,Page,pages,"name")
show_l()
BlockLogs.scrollTop=BlockLogs.scrollHeight
break;
case "IS__Block":
if (!Selection) return
index=e.target.parentNode.id*1
GTA=Node_List[index]
ssd = e.target.parentNode.previousElementSibling
if(!GTA.Isblock){
Node_List.forEach((mes)=>{
if (GTA.name_src === mes.name_src){
mes.Isspam=true
mes.Isblock =true
}
})
GTA.act = "Block"
}else{
Node_List.forEach((mes)=>{
if (GTA.name_src === mes.name_src){
if(mes.Isblock)mes.Isblock = false
}
})
GTA.act = "Unblock"
}
ssd.parentNode.parentNode.style.opacity=GTA.Isblock?0.3:1
e.target.disabled = GTA.Isblock?true:false
shion_p.innerText=count()
Untreated_.value = Untreated+ " " + language_("Untreated", "未处理", "未処理")
Queue(GTA.node,index)
break;
case "All_Block":
Selection = Selection?false:true;
All_Block.value = Selection?language_("Single Selection","单选","一択"):language_("Multiple Selection","多选","多肢選択")
Del_all.style.visibility =Selection?"hidden":"visible"
for(let i=0,l = BlockLogs.children.length;i<l;i++){
let box = BlockLogs.children[i].querySelector("#IS__Block")
box.checked = Selection?false:true
}
break;
case "del_a":
for(let i=0,l = BlockLogs.children.length;i<l;i++){
let item = BlockLogs.children[i]
let box = item.querySelector("#IS__Block")
let index = box.parentNode.id*1
if(box.checked&&!Node_List[index].Isblock){
item.style.opacity = 0.3
box.disabled = true
Node_List[index].Isblock = true
Node_List[index].Isspam=true
Node_List[index].act = "Block"
Queue(Node_List[index].node,index)
}else{
item.style.display = "none"
Node_List[index].Isspam=false
}
}
}
}
function Mes(mes,dodo){
switch (dodo){
case "Report":
PRO_1.style.background = "rgba(222, 253, 7, 0.5)"
break;
case "Delete":
PRO_1.style.background = "rgba(222, 253, 7, 0.5)"
break;
case "Block":
PRO_1.style.background = "rgba(255, 0, 0, 0.5)"
break;
case "Unblock":
PRO_1.style.background = "rgba(0, 255, 52, 0.5)"
break;
case "skip":
PRO_1.style.background = "rgba(0, 255, 52, 0.5)"
break;
default:
PRO_1.style.color = "#93d2ff"
PRO_1.style.background = "rgba(75,75,75,0.7)"
}
pro.style.display = ""
PRO_1.innerHTML = mes
clearTimeout(prpr)
prpr=setTimeout(()=>{
pro.style.display = "none"
prpr=null
},500)
}
Category.onblur = ()=>{
!FubuKing&&Koyori(false)
}
Category.onfocus = ()=>{
Koyori(true)
}
Category.onclick = ()=>{
if (This ===Category.selectedIndex&&This!=null){
Category.blur()
This=null
}else{
This = Category.selectedIndex
}
}
Category.onchange=()=>{
BlockLogs.style.height = "414px"
BlockLogs.innerHTML=null
PageMode = doc;pages=doc;Page=0;PageN = 1
let Selector = document.querySelector("#Category_sort").value
if(Selector == "URL_"){
All_Block.style.display = "none"
let URL_Textarea = document.createElement("textarea"),yooooo=[]
URL_Textarea.setAttribute("readOnly", true);
for (let i=0,l=Node_List.length;i<l;i++){
if(Node_List[i].URL&&(Node_List[i].Isblock))yooooo.push(Node_List[i].URL);
}
yooooo=[...new Set(yooooo)]
URL_Textarea.placeholder = language_("Get only the channel URL of blocked user","只获取已屏蔽的用户的频道网址","ブロックされたユーザーのチャネルURLのみを取得する");
URL_Textarea.value = yooooo.join("\n")
BlockLogs.appendChild(URL_Textarea)
}else if(Selector == "Blocked"){
let LogNames= []
All_Block.style.display = "none"
Del_all.style.visibility ="hidden"
Node_Log_List=Node_List.filter((item)=>{
let Na = true
if (item.Isblock){
Na=LogNames.includes(item.name_src)
!Na&&LogNames.push(item.name_src)
}
return !Na
})
Log_List(Node_Log_List,Page,pages,"name")
show_l()
}else{
let LogNames= []
All_Block.style.display = ""
Node_Log_List = Node_List.filter((item)=>{
let Na = true
if (item.Isspam&&!item.Isblock){
Na=LogNames.includes(item.name_src)
!Na&&LogNames.push(item.name_src)
}
return !Na
})
Node_Log_List = Node_Log_List.filter((item)=>{
let block = Node_List.find((node)=>{
if (node.name_src == item.name_src){
return node.Isblock
}
})
return !block
})
sort(false,Selector,Node_Log_List)
Log_List(Node_Log_List,Page,pages,"name")
show_l()
}
page_.value = 1
BlockLogs.scrollTop=BlockLogs.scrollHeight
Category.blur()
setTimeout(()=>{This = null},100)
}
function Log_List(Log_ty,Page,pages,Name){
BlockLogs.innerHTML=null
let Fragment = document.createDocumentFragment(),BB=0
if(Name)YMD_Type = Name;
YMD = Log_ty;
Pageleng = Log_ty.length
for(let i = Page;i<pages;i++){
if(!Log_ty[i])break;
let div = Coco.cloneNode(true);
div.querySelector("#antetype").parentNode.id = Log_ty[i].name_src
div.querySelector("#antetype").id= Log_ty[i].index
div.style.backgroundColor=BB%2==0?WTF_1:WTF_2
let logn=div.querySelector("#Log_Name")
logn.innerText = Log_ty[i].name;
let input =div.querySelector("#Unblock")
input.title = language_("Unblock or block users","解除或屏蔽用户","ユーザーのブロックを解除またはブロックする")
input.id="IS__Block"
if(Log_ty[i].Isblock&&!IsUntreated){
div.querySelector("#IS__Block").setAttribute('checked', '');
} else if(Log_ty[i].Isblock&&IsUntreated){
div.querySelector("#IS__Block").setAttribute('checked', '');
input.disabled = true
div.style.opacity=0.3
}
div.style.display = "";
BB++
Fragment.appendChild(div)
}
shion_p.innerText=count()
Untreated_.value =Untreated+ " " + language_("Untreated", "未处理", "未処理")
BlockLogs.appendChild(Fragment)
max_.value = "Max:"+ Math.ceil(Pageleng/PageMode)
BlockLogs.scrollTop=BlockLogs.scrollHeight
}
function show_l(){
Selection = true
All_Block.value = language_("Single Selection","单选","一択")
Del_all.style.visibility ="hidden"
for(let i = 0 ,I=BlockLogs.children.length;i<I;i++){
let it = YMD_Type=="mes" ? BlockLogs.children[i].querySelector("#Log_Message").innerText:BlockLogs.children[i]?.querySelector("#Log_Name")?.parentNode?.id
let name = YMD_Type=="mes" ? "Mes":"Name"
if(IsUntreated)name = "Untreated"
let add=BlockLogs.children[i].querySelector("#mes_log")
ShowGO(it,add,name)
add.previousElementSibling.children[1].style.display=""
add.style.display=""
}
}
function ShowGO(it,add,name){
let LogN =[]
if(name=="Name"){
Node_List.forEach((mes)=>{
if(mes.Isspam&&mes.name_src===it){
let Na=LogN.includes(mes.Message)
!Na&&LogN.push(mes.Message)
if(Na)return;
let mes_log_div = document.createElement("div");
mes_log_div.innerText = mes.Message
mes_log_div.id = mes.index
if(mes.interval<2)add.parentNode.style.background="rgba(255, 218, 74, 0.2) "
add.appendChild(mes_log_div)
}
})
}else if(name=="Mes"){
Node_List.forEach((mes)=>{
if(!mes.Isblock&&it === mes.Message){
let Na=LogN.includes(mes.name_src)
!Na&&LogN.push(mes.name_src)
if(Na)return;
let mes_log_div = document.createElement("div");
mes_log_div.innerText = mes.name
mes_log_div.id = mes.index
if(mes.interval<2)add.parentNode.style.background="rgba(255, 218, 74, 0.2) "
add.appendChild(mes_log_div)
}
})
}else if(name = "Untreated"){
Node_List.forEach((mes)=>{
if ( it == mes.name_src&&!mes.Isspam&&!mes.Isblock){
let mes_log_div = document.createElement("div");
mes_log_div.innerText = mes.Message
mes_log_div.id = mes.index
if(mes.interval<2)add.parentNode.style.background="rgba(255, 218, 74, 0.2) "
add.appendChild(mes_log_div)
add.previousElementSibling.children[1].style.display=""
add.style.display=""
}
})
}
}
function count(){
Untreated = 0;Spam = 0; Normal = 0
for (let i =0,L=Node_List.length;i<L;i++ ){
if (Node_List[i].Isspam ==null)continue
Node_List[i].Isspam?Spam++:Normal++
}
Untreated = Node_List.length - Spam - Normal
return "Spam:"+Spam+" |Normal:"+ Normal + " |Untreated:"+ Untreated
}
function sort(Sort,type,arr){
arr.sort((a,b)=>{
let x, y
switch (type)
{
case "name":
x = a.name.length
y = b.name.length
break
case "Mes_length":
x = a.Message.length
y = b.Message.length
break
case "name_abc":
x = a.name.toLowerCase()
y = b.name.toLowerCase()
}
if (x < y) return Sort?-1:1
if (x > y) return Sort?1:-1
return 0;
})
}
function Set_(){
let wi=window.innerWidth
let hi=window.innerHeight-169;
TOPdiv.style.width=wi+"px";
TOPdiv.style.height=hi+"px";
TOPdiv.style.visibility = "visible"
}
function Zoo(){
let zoo=["にゃん","モグ","ワン","パチ","ピカ","ガオ"]
let i=Math.floor(Math.random()*6)
let b=zoo[i]+zoo[i]
for(let n=0;n<=Math.floor(Math.random()*2);n++){
b+=zoo[i]
}
return b
}
function Queue(mes,index){
if(mes){
Del_List.push({node:mes,index:index})
miko.innerText = stop?"Pausing:"+Del_List.length:Del_List.length;
if(!Mio)Queue();
}else{
if(stop){
shion_p.innerText=count();
miko.innerText = stop?"Pausing:"+Del_List.length:Del_List.length;
return;
}
Delet_mes = Del_List.pop();
shion_p.innerText=count();
Mio=true;
FubuKing = true;
DellMes.disabled = true;
GetNewMes.disabled = true;
Achan = Delet_mes.index*1;
if(!document.body.contains(Node_List[Achan].node)){
Dump.innerHTML = "";
Dump.appendChild(Node_List[Achan].node);
}
setTimeout(()=>{
Delet_mes.node.querySelector("#button.yt-icon-button").click()
},600)
Deleting = setTimeout(()=>{
FubuKing = false;
DellMes.disabled = false;
GetNewMes.disabled = false;
let ML = Del_List.length;
miko.innerText = stop?"Pausing:"+ML:ML;
Achan = null;
console.log("err")
ML?Queue():Mio=false;
},Delete_interval+600)
}
}
function Isauto(){
let self= document.querySelector("div#top")?.querySelector("yt-live-chat-author-chip")
if(!self)return
my = self?.querySelector("#chat-badges")
my.title = language_("automatic block","自动屏蔽","自動ブロック")
iv=document.querySelector("DIV#input")
if(IsMod&&my){
const gauging_120 = document.createElement("div");
gauging_120.style.display = "inline-block";
gauging_120.id = "D_D"
gauging_120.style.visibility = "hidden";
gauging_120.innerText = language_("Delete Directly","直接删除","直接削除");
const gauging_dell = document.createElement("input");
gauging_dell.setAttribute("type","checkbox");
gauging_dell.id = "ALL_Del"
gauging_120.appendChild(gauging_dell);
self.appendChild(gauging_120)
my.style.cursor = "pointer"
my.querySelector("div#image").style.color=Mod_Runing?"aqua":""
gauging_120.style.visibility = Mod_Runing?"visible":"hidden"
gauging_dell.checked = del_all;
my.onclick = (e)=>{
Mod_Runing=Mod_Runing?false:true
my.querySelector("div#image").style.color=Mod_Runing?"aqua":""
gauging_120.style.visibility = Mod_Runing?"visible":"hidden"
del_all = false; gauging_dell.checked = del_all;
}
gauging_dell.onclick = (e)=>{
del_all = gauging_dell.checked;
}
}else{
AutoR = document.createElement("div");
AutoR.style.cursor = "pointer"
AutoR.id = "auto___"
AutoR.innerText = "☑"
AutoR.style.fontSize = "16px"
AutoR.style.userSelect="none"
AutoR.style.color=Auto?"aqua":""
self.appendChild(AutoR)
AutoR.onclick = ()=>{
Auto=Auto?false:true
AutoR.style.color=Auto?"aqua":""
}
AutoR.title = language_("automatic execution","自动执行","自動実行")
}
if(iv){
if(iv)iv.title = language_("⁂Record only comments sent via the send button\narrow key↑:Show originally sent comment \n arrow key↓:Show last sent comment","⁂仅记录通过发送按钮发送的评论\n方向键↑:显示最初发送的评论\n方向键↓:显示最后发送的评论","⁂送信ボタンから送信されたコメントのみをログに記録する\n矢印キー↑:送信された最初のコメントを表示\n矢印キー↓:送信された最後のコメントを表示")
iv.addEventListener('compositionstart', (event) => {
Isiput = true
});
iv.addEventListener('compositionend', (event) => {
Isiput = false
});
iv.onfocus = ()=> Koyori(true)
iv.onblur = ()=> {!FubuKing&&Koyori(false)}
iv.oninput=()=>{
if (Isiput)return
let tex=iv.cloneNode(true)
let isnull = !(tex.innerHTML=="<br>"||tex.innerHTML=='<br class="style-scope yt-live-chat-text-input-field-renderer">')
if (rami>-1){
if(isnull){
Comment[rami] = tex.innerHTML
}else{
Comment.splice(rami,1)
rami=-1
}
}else{
isnull&&Tex.pop()
isnull&&Tex.unshift(tex)
}
}
New_Chat_Frame.onclick = (e)=>{
if(e.target.nodeName=="IMG"&&e.target.parentNode.id=="emoji"){
let tex=iv.cloneNode(true)
if (rami>-1){
Comment[rami] = tex.innerHTML
}else{
Tex.pop()
Tex.unshift(tex)
}
}else if (e.target.nodeName =="YT-ICON"&&e.target.parentNode.id=="button"){
if (rami>-1){
rami = -1
return
}
Tex[0]&&Comment.push(Tex[0].innerHTML)
Tex = []
Comment=[...new Set(Comment)]
rami = -1
}
}
}
if(!(document.body.contains(Itemslist))){
Yagoo.disconnect()
Itemslist = document.querySelector("#items.yt-live-chat-item-list-renderer");
Yagoo.observe(Itemslist, {
childList: true,
})
}
}
const nullll = GM_registerMenuCommand("┏━━━━━━━━━━━━━━━━━━━━┓", () => {
});
const rere = GM_registerMenuCommand(language_("Enable/disable automatic operation under playback video","开启/关闭录播的自动操作","動画再生時の自動操作の有効化/無効化"), () => {
IsMod?Mod_Runing=Mod_Runing?false:true:Auto=Auto?false:true
if(Mod_Runing||Auto){alert("On")}else{alert("Off")}
});
const nullll11 = GM_registerMenuCommand("┗━━━━━━━━━━━━━━━━━━━━┛", () => {
});
function call(none){
let iv=document.querySelector("DIV#input")
if (!iv) return
iv.parentNode.setAttribute('focused', '')
let ie= new InputEvent("input")
iv.innerHTML= none
iv.dispatchEvent(ie);
document.querySelector("yt-button-renderer.yt-live-chat-message-input-renderer").click()
iv.innerHTML = null
}
function Koyori(is){
stop = is
let Top=New_Chat?.firstElementChild
if(stop){
if (Top&&Untreated&&Node_List[Top.id*1].Isspam==null){
Top.remove()
BC--
}
Mod_dell=null
index_dell= null
getmes()
if(FubuKing){
DellMes.disabled = true
GetNewMes.disabled = true
}
miko.innerText = "Pausing:"+Del_List.length
}else{
let ML = Del_List.length
miko.innerText = stop?"Pausing:"+ML:ML
ML?Queue():Mio=false;
}
}
(function Translation(){
sc=window.parent.document.getElementById("sc-translator-shadow")||document.getElementById("sc-translator-shadow")
sc = false/////////////////////////////////////////////////
if (sc){
let EliteMiko=sc.shadowRoot.childNodes[4].querySelector(".st-result")
let scc = new MutationObserver((node) => {
node.forEach((me)=>{
me.addedNodes.forEach((you)=>{
if (you?.children?.length==1&&you?.children[0].nodeName=="SPAN"){
let selection = window.getSelection ? window.getSelection() : window.document.getSelection();
let messs=selection.focusNode
messs.data=you.innerText
}
})
})
});
scc.disconnect();
scc.observe(EliteMiko,{
childList: true
});
}
})()
function Add_URL_List (){
let language = navigator.language,URL_list=[],show,SetList,wait
let yagoo=document.querySelector("#html-body"),map,map2,destination
let Menu_Set = new MutationObserver((E) => {
if(E[0]?.addedNodes[0]?.nodeName =="YTCP-CHANNEL-SETTINGS-DIALOG"){
let allblock=E[0]?.addedNodes[0]
map = allblock.children[0].children[0].children[0].children[1]
show=allblock.querySelector("h1#dialog-title")
Menu_Set.disconnect()
Menu_Map.observe(map,{childList: true})
}
});
yagoo&&Menu_Set.observe(yagoo,{childList: true})
let Menu_Map = new MutationObserver((E) => {
if (E[0]?.addedNodes[0].nodeName =="YTCP-NAVIGATION"){
map2 = E[0]?.addedNodes[0]
Menu_Map.disconnect()
Menu_Map2.observe(map2,{childList: true,subtree:true})
}
});
let Menu_Map2 = new MutationObserver((item) => {
item.forEach((node)=>{
node.addedNodes.forEach((no)=>{
if (no.nodeName =="YTCP-COMMUNITY-SETTINGS"){
destination=no
fun()
Menu_Map2.disconnect()
}
})
})
});
function language_(en,zh,jp) {
switch (language) {
case "en-US":
return en
case "zh-CN":
return zh
case "ja":
return jp
default:
return en
}
}
function Queue_(){
SetList.value = URL_list.length-1
let ul = URL_list.shift()
WriteBlock(ul)
wait=setTimeout(()=>{
let pvp=document.querySelectorAll("#text-input")[2]
pvp.innerText= ""
pvp.value= ""
URL_list.length&&Queue_()
},2000)
}
function WriteBlock(url){
let pvp=document.querySelectorAll("#text-input")[2]
let ie= new InputEvent("input")
pvp.innerText= url
pvp.value= url
pvp.dispatchEvent(ie);
pvp.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.focus()
let event = document.createEvent('Event')
event = new KeyboardEvent('keyup',{keyCode: 13})
pvp.focus()
pvp.dispatchEvent(event)
}
const on = GM_registerMenuCommand(language_("Blacklist extension script","黑名单扩展脚本","ブラックリスト拡張スクリプト"), () => {
destination&&fun()
});
function fun(){
document.querySelectorAll("ytcp-channel-picker-form-container")[0].disabled=true
document.querySelectorAll("ytcp-channel-picker-form-container")[0].style.display="none"
document.querySelectorAll("ytcp-channel-picker-form-container")[1].disabled=true
document.querySelectorAll("ytcp-channel-picker-form-container")[1].style.display="none"
document.querySelectorAll("ytcp-channel-picker-form-container")[2].querySelector("#chip-bar-container-hint").innerHTML +=
'<input id="SetList" type="button" value="Add" style="border: 0px;">'
document.querySelectorAll("ytcp-channel-picker-form-container")[2].querySelector("#chip-bar-container-hint").parentNode.innerHTML +=
'<div style="height: 150px;width: 600px;"><textarea id="URL_List" placeholder="'+
language_("Channel URL ","频道网址","チャネルURL")
+'" style="width: 600px;height: 150px;background: #000000fa;margin: 0px;border: 0px;color: #f5f5dcb5;"></textarea></div>'
document.querySelector("#SetList").onclick=()=>{
URL_list = document.querySelector("#URL_List").value.split('\n')
Queue_()
}
SetList = document.querySelector("#SetList")
let Yagoo=document.querySelectorAll("tp-yt-paper-listbox#channel-results-container")[2]
let Menu_Set = new MutationObserver((E) => {
if (E[0].addedNodes[0]&&E[0].addedNodes[0].tagName == "TP-YT-PAPER-ITEM"){
Yagoo.click()
Yagoo.children[0].click()
}
});
Menu_Set.disconnect()
Menu_Set.observe(Yagoo,{childList: true,})
}
}
})();