diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/SCRIPT_VERSION.json" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/SCRIPT_VERSION.json" index dd00451f0..578495755 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/SCRIPT_VERSION.json" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/SCRIPT_VERSION.json" @@ -1,4 +1,4 @@ { - "time": 1719293379395, - "version": "2024.6.25" + "time": 1719378532890, + "version": "2024.6.26" } \ No newline at end of file diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.min.user.js" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.min.user.js" index 7761d6ccb..5c9767ab9 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.min.user.js" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.min.user.js" @@ -1,7 +1,7 @@ // ==UserScript== // @name 抖音优化 // @namespace https://github.com/WhiteSevs/TamperMonkeyScript -// @version 2024.6.25 +// @version 2024.6.26 // @author WhiteSevs // @description 过滤广告、过滤直播、可自定义过滤视频的屏蔽关键字、伪装登录、直播屏蔽弹幕、礼物特效等 // @license GPL-3.0-only @@ -25,13 +25,13 @@ // @run-at document-start // ==/UserScript== -(function (S, Ee, Me) { +(function (S, Te, Me) { 'use strict'; - var ye=e=>{throw TypeError(e)};var Se=(e,i,t)=>i.has(e)||ye("Cannot "+t);var T=(e,i,t)=>(Se(e,i,"read from private field"),t?t.call(e):i.get(e)),z=(e,i,t)=>i.has(e)?ye("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,t),U=(e,i,t,n)=>(Se(e,i,"write to private field"),i.set(e,t),t);var k=typeof GM_getValue<"u"?GM_getValue:void 0,$=typeof GM_info<"u"?GM_info:void 0,Te=typeof GM_registerMenuCommand<"u"?GM_registerMenuCommand:void 0,P=typeof GM_setValue<"u"?GM_setValue:void 0,Ie=typeof GM_unregisterMenuCommand<"u"?GM_unregisterMenuCommand:void 0,Re=typeof GM_xmlhttpRequest<"u"?GM_xmlhttpRequest:void 0,M=typeof unsafeWindow<"u"?unsafeWindow:void 0,_e=window;const I="GM_Panel",O="data-key",F="data-default-value",H=function(e,i,t,n,r,a){let h=[];typeof n=="function"?h=n():h=n;let d={text:e,type:"select",description:a,attributes:{},getValue(){return l.getValue(i,t)},callback(u,f,v){l.setValue(i,f),typeof r=="function"&&r(u,f,v);},data:h};return d.attributes&&(d.attributes[O]=i,d.attributes[F]=t),d},s=function(e,i,t,n,r){let a={text:e,type:"switch",description:r,attributes:{},getValue(){return !!l.getValue(i,t)},callback(h,d){o.success(`${d?"开启":"关闭"} ${e}`),l.setValue(i,!!d);},afterAddToUListCallBack:void 0};return a.attributes&&(a.attributes[O]=i,a.attributes[F]=!!t),a},De={id:"panel-config-common",title:"通用",forms:[{text:"功能",type:"forms",forms:[s("debug模式","debug",!0,void 0,"移除抖音的开发者模式检测"),s("伪装登录","disguiseLogin",!1,void 0,"使用随机UID进行伪装"),s("initial-scale=1","dy-initialScale",!1,void 0,"可配合手机模式放大页面"),s("移除 apple-itunes-app","dy-apple-removeMetaAppleItunesApp",!0,void 0,"Safari使用,移除顶部横幅【Open in the 抖音 app】")]},{text:"Url重定向",type:"forms",forms:[s("重定向/home","douyin-redirect-url-home-to-root",!1,void 0,"/home => /")]},{text:"屏蔽",type:"forms",forms:[s("【屏蔽】登录弹窗","watchLoginDialogToClose",!0,void 0,"屏蔽元素且自动等待元素出现并关闭登录弹窗"),s("【屏蔽】底部?按钮","shieldBottomQuestionButton",!0,void 0,"屏蔽元素")]},{text:"主框架-屏蔽",type:"forms",forms:[s("【屏蔽】客户端提示","shieldClientTip",!0,void 0,"屏蔽元素"),s("【屏蔽】充砖石","shieldFillingBricksAndStones",!0,void 0,"屏蔽元素"),s("【屏蔽】客户端","shieldClient",!0,void 0,"屏蔽元素"),s("【屏蔽】快捷访问","shieldQuickAccess",!1,void 0,"屏蔽元素"),s("【屏蔽】通知","shieldNotifitation",!1,void 0,"屏蔽元素"),s("【屏蔽】私信","shieldPrivateMessage",!1,void 0,"屏蔽元素"),s("【屏蔽】投稿","shieldSubmission",!1,void 0,"屏蔽元素"),s("【屏蔽】壁纸","shieldWallpaper",!1,void 0,"屏蔽元素"),s("【屏蔽】左侧导航栏","shieldLeftNavigator",!1,void 0,"屏蔽元素"),s("【屏蔽】顶部导航栏","shieldTopNavigator",!1,void 0,"屏蔽元素")]},{text:"搜索-屏蔽",type:"forms",forms:[s("【屏蔽】搜索框","shieldSearch",!1,void 0,"屏蔽元素"),s("【屏蔽】搜索框的提示","shieldSearchPlaceholder",!1,void 0,"屏蔽元素"),s("【屏蔽】猜你想搜","shieldSearchGuessYouWantToSearch",!1,void 0,"屏蔽元素"),s("【屏蔽】抖音热点","shieldSearchTiktokHotspot",!1,void 0,"屏蔽元素")]},{text:"Toast配置",type:"forms",forms:[H("Toast位置","qmsg-config-position","bottom",[{value:"topleft",text:"左上角"},{value:"top",text:"顶部"},{value:"topright",text:"右上角"},{value:"left",text:"左边"},{value:"center",text:"中间"},{value:"right",text:"右边"},{value:"bottomleft",text:"左下角"},{value:"bottom",text:"底部"},{value:"bottomright",text:"右下角"}],(e,i,t)=>{o.info("设置当前Qmsg弹出位置"+t);},"Toast显示在页面九宫格的位置"),H("最多显示的数量","qmsg-config-maxnums",3,[{value:1,text:"1"},{value:2,text:"2"},{value:3,text:"3"},{value:4,text:"4"},{value:5,text:"5"}],void 0,"限制Toast显示的数量"),s("逆序弹出","qmsg-config-showreverse",!1,void 0,"修改Toast弹出的顺序")]}]},m={isVerticalScreen(){return !window.screen.orientation.type.includes("landscape")},addBlockCSS(...e){let i=[];e.length!==0&&(e.length===1&&typeof e[0]=="string"&&e[0].trim()===""||(e.forEach(t=>{Array.isArray(t)?i=i.concat(t):i.push(t);}),c.addStyle(`${i.join(`, + var ye=e=>{throw TypeError(e)};var Se=(e,i,t)=>i.has(e)||ye("Cannot "+t);var E=(e,i,t)=>(Se(e,i,"read from private field"),t?t.call(e):i.get(e)),z=(e,i,t)=>i.has(e)?ye("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,t),U=(e,i,t,n)=>(Se(e,i,"write to private field"),i.set(e,t),t);var k=typeof GM_getValue<"u"?GM_getValue:void 0,$=typeof GM_info<"u"?GM_info:void 0,Ee=typeof GM_registerMenuCommand<"u"?GM_registerMenuCommand:void 0,P=typeof GM_setValue<"u"?GM_setValue:void 0,Ie=typeof GM_unregisterMenuCommand<"u"?GM_unregisterMenuCommand:void 0,Re=typeof GM_xmlhttpRequest<"u"?GM_xmlhttpRequest:void 0,M=typeof unsafeWindow<"u"?unsafeWindow:void 0,_e=window;const I="GM_Panel",O="data-key",F="data-default-value",H=function(e,i,t,n,r,a){let h=[];typeof n=="function"?h=n():h=n;let d={text:e,type:"select",description:a,attributes:{},getValue(){return l.getValue(i,t)},callback(u,f,v){l.setValue(i,f),typeof r=="function"&&r(u,f,v);},data:h};return d.attributes&&(d.attributes[O]=i,d.attributes[F]=t),d},s=function(e,i,t,n,r){let a={text:e,type:"switch",description:r,attributes:{},getValue(){return !!l.getValue(i,t)},callback(h,d){o.success(`${d?"开启":"关闭"} ${e}`),l.setValue(i,!!d);},afterAddToUListCallBack:void 0};return a.attributes&&(a.attributes[O]=i,a.attributes[F]=!!t),a},De={id:"panel-config-common",title:"通用",forms:[{text:"功能",type:"forms",forms:[s("debug模式","debug",!0,void 0,"移除抖音的开发者模式检测"),s("伪装登录","disguiseLogin",!1,void 0,"使用随机UID进行伪装"),s("initial-scale=1","dy-initialScale",!1,void 0,"可配合手机模式放大页面"),s("移除 apple-itunes-app","dy-apple-removeMetaAppleItunesApp",!0,void 0,"Safari使用,移除顶部横幅【Open in the 抖音 app】")]},{text:"Url重定向",type:"forms",forms:[s("重定向/home","douyin-redirect-url-home-to-root",!1,void 0,"/home => /")]},{text:"屏蔽",type:"forms",forms:[s("【屏蔽】登录弹窗","watchLoginDialogToClose",!0,void 0,"屏蔽元素且自动等待元素出现并关闭登录弹窗"),s("【屏蔽】底部?按钮","shieldBottomQuestionButton",!0,void 0,"屏蔽元素")]},{text:"主框架-屏蔽",type:"forms",forms:[s("【屏蔽】客户端提示","shieldClientTip",!0,void 0,"屏蔽元素"),s("【屏蔽】充砖石","shieldFillingBricksAndStones",!0,void 0,"屏蔽元素"),s("【屏蔽】客户端","shieldClient",!0,void 0,"屏蔽元素"),s("【屏蔽】快捷访问","shieldQuickAccess",!1,void 0,"屏蔽元素"),s("【屏蔽】通知","shieldNotifitation",!1,void 0,"屏蔽元素"),s("【屏蔽】私信","shieldPrivateMessage",!1,void 0,"屏蔽元素"),s("【屏蔽】投稿","shieldSubmission",!1,void 0,"屏蔽元素"),s("【屏蔽】壁纸","shieldWallpaper",!1,void 0,"屏蔽元素"),s("【屏蔽】左侧导航栏","shieldLeftNavigator",!1,void 0,"屏蔽元素"),s("【屏蔽】顶部导航栏","shieldTopNavigator",!1,void 0,"屏蔽元素")]},{text:"搜索-屏蔽",type:"forms",forms:[s("【屏蔽】搜索框","shieldSearch",!1,void 0,"屏蔽元素"),s("【屏蔽】搜索框的提示","shieldSearchPlaceholder",!1,void 0,"屏蔽元素"),s("【屏蔽】猜你想搜","shieldSearchGuessYouWantToSearch",!1,void 0,"屏蔽元素"),s("【屏蔽】抖音热点","shieldSearchTiktokHotspot",!1,void 0,"屏蔽元素")]},{text:"Toast配置",type:"forms",forms:[H("Toast位置","qmsg-config-position","bottom",[{value:"topleft",text:"左上角"},{value:"top",text:"顶部"},{value:"topright",text:"右上角"},{value:"left",text:"左边"},{value:"center",text:"中间"},{value:"right",text:"右边"},{value:"bottomleft",text:"左下角"},{value:"bottom",text:"底部"},{value:"bottomright",text:"右下角"}],(e,i,t)=>{o.info("设置当前Qmsg弹出位置"+t);},"Toast显示在页面九宫格的位置"),H("最多显示的数量","qmsg-config-maxnums",3,[{value:1,text:"1"},{value:2,text:"2"},{value:3,text:"3"},{value:4,text:"4"},{value:5,text:"5"}],void 0,"限制Toast显示的数量"),s("逆序弹出","qmsg-config-showreverse",!1,void 0,"修改Toast弹出的顺序")]}]},m={isVerticalScreen(){return !window.screen.orientation.type.includes("landscape")},addBlockCSS(...e){let i=[];e.length!==0&&(e.length===1&&typeof e[0]=="string"&&e[0].trim()===""||(e.forEach(t=>{Array.isArray(t)?i=i.concat(t):i.push(t);}),c.addStyle(`${i.join(`, `)}{display: none !important;}`)));}},N={key:"douyin-live-danmu-rule",$data:{rule:[],isFilterAttrName:"data-is-filter"},init(){this.parseRule();},parseRule(){this.get().trim().split(` -`).forEach(t=>{if(t.trim()=="")return;t=t.trim();let n=new RegExp(t.trim());this.$data.rule.push(n);});},change(){var i,t,n,r,a,h,d;let e=Array.from(document.querySelectorAll("xg-danmu.xgplayer-danmu > div > div"));if(e.length)for(let u=0;u{if(!e){o.error("xg-danmu.xgplayer-danmu获取失败");return}o.success("弹幕过滤"),N.init(),c.mutationObserver(e,{config:{childList:!0,subtree:!0},callback:()=>{N.change();}});});}},Pe={id:"panel-config-live",title:"直播",forms:[{text:"功能",type:"forms",forms:[s("自动进入网页全屏","live-autoEnterElementFullScreen",!1,void 0,"网页加载完毕后自动点击网页全屏按钮进入全屏"),s("解锁画质选择","live-unlockImageQuality",!0,void 0,"未登录的情况下选择原画实际上是未登录的情况下最高选择的画质"),s("监听并关闭【长时间无操作,已暂停播放】弹窗","live-waitToRemovePauseDialog",!0,void 0,"自动监听并检测弹窗"),s("禁止自动播放","live-pauseVideo",!1,void 0,"暂停直播播放")]},{text:"视频区域内-屏蔽",type:"forms",forms:[s("【屏蔽】顶栏信息","live-shieldTopToolBarInfo",!1,void 0,"屏蔽元素,包括直播作者、右侧的礼物展馆"),s("【屏蔽】底部的礼物栏","live-shieldGiftColumn",!1,void 0,"屏蔽元素"),s("【屏蔽】礼物特效","live-shieldGiftEffects",!1,void 0,"屏蔽元素"),s("【屏蔽】弹幕","live-shieldDanmuku",!1,void 0,"屏蔽元素"),s("【屏蔽】小黄车","live-shielYellowCar",!1,void 0,"屏蔽元素")]},{text:"聊天室-屏蔽",type:"forms",forms:[s("【屏蔽】聊天室","live-shieldChatRoom",!1,void 0,"屏蔽元素"),s("【屏蔽】贵宾席","live-shielChatRoomVipSeats",!1,void 0,"屏蔽元素"),s("【屏蔽】用户等级图标","dy-live-shieldUserLevelIcon",!1,void 0,"屏蔽元素"),s("【屏蔽】VIP图标","dy-live-shieldUserVIPIcon",!1,void 0,"屏蔽元素"),s("【屏蔽】粉丝牌","dy-live-shieldUserFansIcon",!1,void 0,"屏蔽元素"),s("【屏蔽】信息播报","dy-live-shieldMessage",!1,void 0,"底部滚动播报的的xxx来了,xxx给主播点赞")]},{text:"弹幕屏蔽规则(可正则)",type:"forms",forms:[s("启用","live-danmu-shield-rule-enable",!1,void 0,"启用弹幕屏蔽规则"),{type:"own",getLiElementCallBack(e){let i=p.createElement("div",{className:"pops-panel-textarea",innerHTML:''},{style:"width: 100%;"}),t=i.querySelector("textarea");return t.value=N.get(),p.on(t,["input","propertychange"],c.debounce(function(){N.set(t.value);},200)),e.appendChild(i),e}}]}]},q={watchVideDataListChange(e){let i=null;p.ready(()=>{c.waitNode("#slidelist").then(t=>{c.mutationObserver(t,{config:{childList:!0,subtree:!0},callback:()=>{if(i||(i=this.getOSElement()),!i){o.error("watchVideDataListChange:获取osElement失败");return}e(i);}});});});},getOSElement(){return document.querySelector("#root div[class*='-os']")||document.querySelector("#douyin-right-container")}},G={rule:null},j={key:"douyin-shield-rule",$data:{get rule(){return G.rule==null&&(G.rule=new c.Dictionary),G.rule},isFirstLoad:!0},init(){this.parseRule(),o.info(["当前自定义视频拦截规则: ",this.$data.rule.getItems()]);let e=null;q.watchVideDataListChange(c.debounce(i=>{var a;let t=document.querySelector('#slidelist div[data-e2e="slideList"]');if(!t){o.error("未获取到视频列表元素");return}let n=(a=c.getReactObj(t))==null?void 0:a.reactFiber;if(n==null){o.error(["元素上不存在reactFiber属性",t]);return}let r=n==null?void 0:n.return.memoizedProps.data;if(r.length){if(this.$data.isFirstLoad){let h=r[r.length-1];if(e==null&&(e=h.awemeId),e===h.awemeId)return;this.$data.isFirstLoad=!1;}for(let h=0;h!!E.match(y))){f=!0,o.success(["自定义屏蔽: "+v+" "+y,u]);break}}}f&&(r.splice(h,1),h--);}}},150));},getVideoInfoTagMap(e){var h,d,u,f,v,y;let i=(d=(h=e==null?void 0:e.authorInfo)==null?void 0:h.nickname)==null?void 0:d.toString(),t=(f=(u=e==null?void 0:e.authorInfo)==null?void 0:u.uid)==null?void 0:f.toString(),n=(v=e==null?void 0:e.desc)==null?void 0:v.toString(),r=[];typeof(e==null?void 0:e.textExtra)=="object"&&Array.isArray(e==null?void 0:e.textExtra)&&((y=e==null?void 0:e.textExtra)==null||y.forEach(g=>{r.push(g.hashtagName);}));let a=[];return typeof(e==null?void 0:e.videoTag)=="object"&&Array.isArray(e==null?void 0:e.videoTag)&&(e==null||e.videoTag.forEach(g=>{a.push(g.tagName);})),{nickname:i,uid:t,desc:n,textExtra:r,videoTag:a}},parseRule(){this.get().trim().split(` -`).forEach(t=>{if(c.isNull(t))return;let r=t.trim().split("##");if(r.length<2)return;let a=r[0];r.shift();let h=r.join("");try{let d=new RegExp(h,"g");this.$data.rule.set(a,d);}catch(d){o.error(["自定义视频过滤规则-正则解析错误:"+d]),o.error("错误的规则:"+t);}});},set(e){P(this.key,e);},get(){return k(this.key,"")}},be=function(e,i,t,n,r,a,h,d){return {text:e,type:"button",description:i,buttonIcon:n,buttonIsRightIcon:r,buttonIconIsLoading:a,buttonType:h,buttonText:t,callback(f){typeof d=="function"&&d(f);},afterAddToUListCallBack:void 0}};var _,D;class Le{constructor(i){z(this,_,"short-cut");z(this,D,!1);typeof i=="string"&&U(this,_,i);}getValue(i,t){let n=k(T(this,_),[]);return i?n.find(a=>a.key===i)??t:n}setValue(i,t,n,r){let a=k(T(this,_),[]);a.push({key:i,value:{keyName:t,keyValue:n,ohterCodeList:r}}),P(T(this,_),a);}deleteValue(i){let t=!1,n=k(T(this,_),[]),r=n.findIndex(a=>a.key===i);return r!==-1&&(n.splice(r,1),t=!0),P(T(this,_),n),t}getShowText(i,t){let n=this.getValue(i);if(n){let r="";return n.value.ohterCodeList.forEach(a=>{n.key===i&&(r+=c.stringTitleToUpperCase(a,!0)+" + ");}),r+=n.value.keyName,r}else return t}inputShortCut(i,t,n){if((this.getValue(i)??t)===t){let a=S.loading("请按下快捷键...",{showClose:!0,onClose(){h.removeListen();}});U(this,D,!0);let h=c.listenKeyboard(window,"keyup",(d,u,f)=>{let v=JSON.stringify({keyName:d,keyValue:u,ohterCodeList:f}),y=this.getValue();for(let g=0;g{if(T(this,D))return;t=this.getValue();let h=t.findIndex(d=>{let u=d.value,f={keyName:n,keyValue:r,ohterCodeList:a};if(JSON.stringify(u)===JSON.stringify(f))return d});if(h!=-1){let d=t[h];o.info(["调用快捷键",d]),d.key in i&&i[d.key].callback();}});}}_=new WeakMap,D=new WeakMap;const Ae=`/* 去除顶部的padding距离 */\r +`).forEach(t=>{if(t.trim()=="")return;t=t.trim();let n=new RegExp(t.trim());this.$data.rule.push(n);});},change(){var i,t,n,r,a,h,d;let e=Array.from(document.querySelectorAll("xg-danmu.xgplayer-danmu > div > div"));if(e.length)for(let u=0;u{if(!e){o.error("xg-danmu.xgplayer-danmu获取失败");return}o.success("弹幕过滤"),N.init(),c.mutationObserver(e,{config:{childList:!0,subtree:!0},callback:()=>{N.change();}});});}},Pe={id:"panel-config-live",title:"直播",forms:[{text:"功能",type:"forms",forms:[s("自动进入网页全屏","live-autoEnterElementFullScreen",!1,void 0,"网页加载完毕后自动点击网页全屏按钮进入全屏"),s("解锁画质选择","live-unlockImageQuality",!0,void 0,"未登录的情况下选择原画实际上是未登录的情况下最高选择的画质"),s("监听并关闭【长时间无操作,已暂停播放】弹窗","live-waitToRemovePauseDialog",!0,void 0,"自动监听并检测弹窗"),s("禁止自动播放","live-pauseVideo",!1,void 0,"暂停直播播放")]},{text:"视频区域内-屏蔽",type:"forms",forms:[s("【屏蔽】顶栏信息","live-shieldTopToolBarInfo",!1,void 0,"屏蔽元素,包括直播作者、右侧的礼物展馆"),s("【屏蔽】底部的礼物栏","live-shieldGiftColumn",!1,void 0,"屏蔽元素"),s("【屏蔽】礼物特效","live-shieldGiftEffects",!1,void 0,"屏蔽元素"),s("【屏蔽】弹幕","live-shieldDanmuku",!1,void 0,"屏蔽元素"),s("【屏蔽】小黄车","live-shielYellowCar",!1,void 0,"屏蔽元素")]},{text:"聊天室-屏蔽",type:"forms",forms:[s("【屏蔽】聊天室","live-shieldChatRoom",!1,void 0,"屏蔽元素"),s("【屏蔽】贵宾席","live-shielChatRoomVipSeats",!1,void 0,"屏蔽元素"),s("【屏蔽】用户等级图标","dy-live-shieldUserLevelIcon",!1,void 0,"屏蔽元素"),s("【屏蔽】VIP图标","dy-live-shieldUserVIPIcon",!1,void 0,"屏蔽元素"),s("【屏蔽】粉丝牌","dy-live-shieldUserFansIcon",!1,void 0,"屏蔽元素"),s("【屏蔽】信息播报","dy-live-shieldMessage",!1,void 0,"底部滚动播报的的xxx来了,xxx给主播点赞")]},{text:"弹幕屏蔽规则(可正则)",type:"forms",forms:[s("启用","live-danmu-shield-rule-enable",!1,void 0,"启用弹幕屏蔽规则"),{type:"own",getLiElementCallBack(e){let i=p.createElement("div",{className:"pops-panel-textarea",innerHTML:''},{style:"width: 100%;"}),t=i.querySelector("textarea");return t.value=N.get(),p.on(t,["input","propertychange"],c.debounce(function(){N.set(t.value);},200)),e.appendChild(i),e}}]}]},q={watchVideDataListChange(e){let i=null;p.ready(()=>{c.waitNode("#slidelist").then(t=>{c.mutationObserver(t,{config:{childList:!0,subtree:!0},callback:()=>{if(i||(i=this.getOSElement()),!i){o.error("watchVideDataListChange:获取osElement失败");return}e(i);}});});});},getOSElement(){return document.querySelector("#root div[class*='-os']")||document.querySelector("#douyin-right-container")}},G={rule:null},j={key:"douyin-shield-rule",$data:{get rule(){return G.rule==null&&(G.rule=new c.Dictionary),G.rule},isFirstLoad:!0},init(){this.parseRule(),o.info(["当前自定义视频拦截规则: ",this.$data.rule.getItems()]);let e=null;q.watchVideDataListChange(c.debounce(i=>{var a;let t=document.querySelector('#slidelist div[data-e2e="slideList"]');if(!t){o.error("未获取到视频列表元素");return}let n=(a=c.getReactObj(t))==null?void 0:a.reactFiber;if(n==null){o.error(["元素上不存在reactFiber属性",t]);return}let r=n==null?void 0:n.return.memoizedProps.data;if(r.length){if(this.$data.isFirstLoad){let h=r[r.length-1];if(e==null&&(e=h.awemeId),e===h.awemeId)return;this.$data.isFirstLoad=!1;}for(let h=0;h!!T.match(y))){f=!0,o.success(["自定义屏蔽: "+v+" "+y,u]);break}}}f&&(r.splice(h,1),h--);}}},150));},getVideoInfoTagMap(e){var h,d,u,f,v,y;let i=(d=(h=e==null?void 0:e.authorInfo)==null?void 0:h.nickname)==null?void 0:d.toString(),t=(f=(u=e==null?void 0:e.authorInfo)==null?void 0:u.uid)==null?void 0:f.toString(),n=(v=e==null?void 0:e.desc)==null?void 0:v.toString(),r=[];typeof(e==null?void 0:e.textExtra)=="object"&&Array.isArray(e==null?void 0:e.textExtra)&&((y=e==null?void 0:e.textExtra)==null||y.forEach(g=>{r.push(g.hashtagName);}));let a=[];return typeof(e==null?void 0:e.videoTag)=="object"&&Array.isArray(e==null?void 0:e.videoTag)&&(e==null||e.videoTag.forEach(g=>{a.push(g.tagName);})),{nickname:i,uid:t,desc:n,textExtra:r,videoTag:a}},parseRule(){this.get().trim().split(` +`).forEach(t=>{if(c.isNull(t))return;let r=t.trim().split("##");if(r.length<2)return;let a=r[0];r.shift();let h=r.join("");try{let d=new RegExp(h,"g");this.$data.rule.set(a,d);}catch(d){o.error(["自定义视频过滤规则-正则解析错误:"+d]),o.error("错误的规则:"+t);}});},set(e){P(this.key,e);},get(){return k(this.key,"")}},be=function(e,i,t,n,r,a,h,d){return {text:e,type:"button",description:i,buttonIcon:n,buttonIsRightIcon:r,buttonIconIsLoading:a,buttonType:h,buttonText:t,callback(f){typeof d=="function"&&d(f);},afterAddToUListCallBack:void 0}};var _,D;class Le{constructor(i){z(this,_,"short-cut");z(this,D,!1);typeof i=="string"&&U(this,_,i);}getValue(i,t){let n=k(E(this,_),[]);return i?n.find(a=>a.key===i)??t:n}setValue(i,t,n,r){let a=k(E(this,_),[]);a.push({key:i,value:{keyName:t,keyValue:n,ohterCodeList:r}}),P(E(this,_),a);}deleteValue(i){let t=!1,n=k(E(this,_),[]),r=n.findIndex(a=>a.key===i);return r!==-1&&(n.splice(r,1),t=!0),P(E(this,_),n),t}getShowText(i,t){let n=this.getValue(i);if(n){let r="";return n.value.ohterCodeList.forEach(a=>{n.key===i&&(r+=c.stringTitleToUpperCase(a,!0)+" + ");}),r+=n.value.keyName,r}else return t}inputShortCut(i,t,n){if((this.getValue(i)??t)===t){let a=S.loading("请按下快捷键...",{showClose:!0,onClose(){h.removeListen();}});U(this,D,!0);let h=c.listenKeyboard(window,"keyup",(d,u,f)=>{let v=JSON.stringify({keyName:d,keyValue:u,ohterCodeList:f}),y=this.getValue();for(let g=0;g{if(E(this,D))return;t=this.getValue();let h=t.findIndex(d=>{let u=d.value,f={keyName:n,keyValue:r,ohterCodeList:a};if(JSON.stringify(u)===JSON.stringify(f))return d});if(h!=-1){let d=t[h];o.info(["调用快捷键",d]),d.key in i&&i[d.key].callback();}});}}_=new WeakMap,D=new WeakMap;const Ae=`/* 去除顶部的padding距离 */\r #douyin-right-container {\r padding-top: 0;\r }\r @@ -170,7 +170,7 @@ ul[data-e2e="scroll-list"] {\r min-width: 100%;\r }\r }\r -`,xe={init(){l.execMenu("shieldRightExpandCommentButton",()=>{this.shieldRightExpandCommentButton();}),l.execMenu("shieldSearchFloatingBar",()=>{this.shieldSearchFloatingBar();}),l.execMenu("shieldCloseFullScreenButton",()=>{this.shieldCloseFullScreenButton();}),l.execMenu("shieldPlaySwitchButton",()=>{this.shieldPlaySwitchButton();}),l.execMenu("shieldAuthorAvatar",()=>{this.shieldAuthorAvatar();}),l.execMenu("shieldLikeButton",()=>{this.shieldLikeButton();}),l.execMenu("shieldCommentButton",()=>{this.shieldCommentButton();}),l.execMenu("shieldCollectionButton",()=>{this.shieldCollectionButton();}),l.execMenu("shieldSharenButton",()=>{this.shieldSharenButton();}),l.execMenu("shieldRelatedRecommendationsButton",()=>{this.shieldRelatedRecommendationsButton();}),l.execMenu("shieldMoreButton",()=>{this.shieldMoreButton();}),l.execMenu("shieldBottomVideoToolBar",()=>{this.shieldBottomVideoToolBar();});},shieldRightExpandCommentButton(){o.info("【屏蔽】右侧的展开评论按钮"),m.addBlockCSS('#sliderVideo[data-e2e="feed-active-video"] > div > div > button[type="button"]','.playerContainer button[type=button] svg > g[filter] > path[d="M21.316 29.73a1.393 1.393 0 01-1.97 0l-5.056-5.055a1.393 1.393 0 010-1.97l.012-.011 5.044-5.045a1.393 1.393 0 011.97 1.97l-4.07 4.071 4.07 4.071a1.393 1.393 0 010 1.97z"]'),C(` +`,xe={init(){l.execMenu("shieldRightExpandCommentButton",()=>{this.shieldRightExpandCommentButton();}),l.execMenu("shieldSearchFloatingBar",()=>{this.shieldSearchFloatingBar();}),l.execMenu("shieldCloseFullScreenButton",()=>{this.shieldCloseFullScreenButton();}),l.execMenu("shieldPlaySwitchButton",()=>{this.shieldPlaySwitchButton();}),l.execMenu("shieldAuthorAvatar",()=>{this.shieldAuthorAvatar();}),l.execMenu("shieldLikeButton",()=>{this.shieldLikeButton();}),l.execMenu("shieldCommentButton",()=>{this.shieldCommentButton();}),l.execMenu("shieldCollectionButton",()=>{this.shieldCollectionButton();}),l.execMenu("shieldSharenButton",()=>{this.shieldSharenButton();}),l.execMenu("shieldRelatedRecommendationsButton",()=>{this.shieldRelatedRecommendationsButton();}),l.execMenu("shieldMoreButton",()=>{this.shieldMoreButton();}),l.execMenu("shieldBottomVideoToolBar",()=>{this.shieldBottomVideoToolBar();}),l.execMenu("shieldBottomVideoToolbarDanmuContainer",()=>{this.shieldBottomVideoToolbarDanmuContainer();});},shieldRightExpandCommentButton(){o.info("【屏蔽】右侧的展开评论按钮"),m.addBlockCSS('#sliderVideo[data-e2e="feed-active-video"] > div > div > button[type="button"]','.playerContainer button[type=button] svg > g[filter] > path[d="M21.316 29.73a1.393 1.393 0 01-1.97 0l-5.056-5.055a1.393 1.393 0 010-1.97l.012-.011 5.044-5.045a1.393 1.393 0 011.97 1.97l-4.07 4.071 4.07 4.071a1.393 1.393 0 010 1.97z"]'),C(` .basePlayerContainer .positionBox{ padding-right: 20px !important; } @@ -185,7 +185,7 @@ ul[data-e2e="scroll-list"] {\r xg-video-container.xg-video-container{ bottom: 0 !important; } - `);}},Oe={init(){l.execMenuOnce("dy-video-shieldUserCommentToolBar",()=>{this.shieldUserCommentToolBar();}),l.execMenuOnce("dy-video-shieldUserCommentEveryOneAllSearch",()=>{this.shieldUserCommentEveryOneAllSearch();});},shieldUserCommentToolBar(){o.info("【屏蔽】评论工具栏"),m.addBlockCSS(".comment-input-container");},shieldUserCommentEveryOneAllSearch(){o.info("【屏蔽】大家都在搜"),m.addBlockCSS(".comment-header-with-search");}},R={init(){xe.init(),w.init(),Oe.init(),l.execMenu("shieldVideo",()=>{j.init();}),l.execMenu("changeCommentToBottom",()=>{R.changeCommentToBottom();}),l.execMenu("fullScreen",()=>{this.fullScreen();}),l.execMenu("parseVideo",()=>{R.parseVideo();}),l.execMenu("autoEnterElementFullScreen",()=>{this.autoEnterElementFullScreen();}),l.execMenu("dy-video-doubleClickEnterElementFullScreen",()=>{this.doubleClickEnterElementFullScreen();}),p.ready(()=>{R.chooseVideoDefinition(l.getValue("chooseVideoDefinition")),l.execMenu("mobileMode",()=>{this.mobileMode();});});},fullScreen(){o.info("全屏"),m.addBlockCSS(".slider-video .positionBox","#video-info-wrap","xg-controls.xgplayer-controls"),xe.shieldSearchFloatingBar(),C(` + `);},shieldBottomVideoToolbarDanmuContainer(){o.info("【屏蔽】底部视频工具栏的弹幕容器"),m.addBlockCSS('xg-controls xg-inner-controls .danmakuContainer[data-e2e="danmaku-container"]');}},Oe={init(){l.execMenuOnce("dy-video-shieldUserCommentToolBar",()=>{this.shieldUserCommentToolBar();}),l.execMenuOnce("dy-video-shieldUserCommentEveryOneAllSearch",()=>{this.shieldUserCommentEveryOneAllSearch();});},shieldUserCommentToolBar(){o.info("【屏蔽】评论工具栏"),m.addBlockCSS(".comment-input-container");},shieldUserCommentEveryOneAllSearch(){o.info("【屏蔽】大家都在搜"),m.addBlockCSS(".comment-header-with-search");}},R={init(){xe.init(),w.init(),Oe.init(),l.execMenu("shieldVideo",()=>{j.init();}),l.execMenu("changeCommentToBottom",()=>{R.changeCommentToBottom();}),l.execMenu("fullScreen",()=>{this.fullScreen();}),l.execMenu("parseVideo",()=>{R.parseVideo();}),l.execMenu("autoEnterElementFullScreen",()=>{this.autoEnterElementFullScreen();}),l.execMenu("dy-video-doubleClickEnterElementFullScreen",()=>{this.doubleClickEnterElementFullScreen();}),p.ready(()=>{R.chooseVideoDefinition(l.getValue("chooseVideoDefinition")),l.execMenu("mobileMode",()=>{this.mobileMode();});});},fullScreen(){o.info("全屏"),m.addBlockCSS(".slider-video .positionBox","#video-info-wrap","xg-controls.xgplayer-controls"),xe.shieldSearchFloatingBar(),C(` /* 视频全屏 */ xg-video-container.xg-video-container{ bottom: 0px !important; @@ -229,7 +229,7 @@ ul[data-e2e="scroll-list"] {\r .douyin-video-link-item a{ } - `});}p.on(document,"click",'div[data-e2e="video-share-container"] div[data-inuser="false"] button + div',function(i){var r;let t=i.target,n=(r=c.getReactObj(t.parentElement))==null?void 0:r.reactFiber;if(!n){S.error("获取rectFiber属性失败");return}try{let a=[],h=n.return.memoizedProps.awemeInfo.video.playAddr,d=n.return.memoizedProps.awemeInfo.video.playAddrH265;if(h!=null&&Array.isArray(h)&&(a=a.concat(h)),d!=null&&Array.isArray(d)&&(a=a.concat(d)),!a.length){S.error("未获取到视频的有效链接信息");return}let u=a.map(f=>f.src);e(u);}catch{S.error("解析视频失败");}},{capture:!0});},mobileMode(){o.info("启用手机模式"),Ve.initialScale(),m.addBlockCSS("img#douyin-temp-sidebar"),C($e),b.isSearch()&&l.onceExec("douyin-search-mobileMode",()=>{Be.mobileMode();});}},w={shortCut:new Le("video-short-cut"),$data:{rateMap:["0.75","1","1.25","1.5","1.75","2","3"]},init(){this.shortCut.initGlobalKeyboardListener(this.getShortCutMap());},getShortCutMap(){return {"dy-video-rate-low":{callback(){o.info("调用倍速 => 小");let e=M.sessionStorage.getItem("player_playbackratio")??"1",i=w.$data.rateMap.findIndex(n=>n===e);if(i===0){o.warn("已是最小倍速: "+e);return}let t=w.$data.rateMap[i-1];o.info("设置倍速: "+t),R.chooseVideoRate(t);}},"dy-video-rate-up":{callback(){o.info("调用倍速 => 大");let e=M.sessionStorage.getItem("player_playbackratio")??"1",i=w.$data.rateMap.findIndex(n=>n===e);if(i===w.$data.rateMap.length-1){o.warn("已是最大倍速: "+e);return}let t=w.$data.rateMap[i+1];o.info("设置倍速: "+t),R.chooseVideoRate(t);}}}}},Fe={id:"panel-config-video",title:"视频",forms:[{text:"功能",type:"forms",forms:[s("沉浸模式","fullScreen",!1,void 0,"移除右侧工具栏、底部信息栏等"),s("手机模式","mobileMode",!1,void 0,"放大各种文字和图标")]},{text:"视频",type:"forms",forms:[H("清晰度","chooseVideoDefinition",1,[{text:"智能",value:0},{text:"极速",value:4},{text:"流畅",value:3},{text:"清晰",value:2},{text:"高清",value:1}],void 0,"自行选择清晰度"),s("视频解析","parseVideo",!0,void 0,"分享->下载(灰色的也可点击)"),s("评论区移到中间","changeCommentToBottom",!0,void 0,"修改评论区为中间弹出而非右侧区域"),s("↑自适应评论区位置","douyin-video-autoCheckChangeCommentToBottom",!0,void 0,"根据window.screen.orientation.type自动判断是否开启【评论区移到中间】"),s("自动进入网页全屏","autoEnterElementFullScreen",!1,void 0,"网页加载完毕后自动点击网页全屏按钮进入全屏"),s("双击进入网页全屏","dy-video-doubleClickEnterElementFullScreen",!1,void 0,"双击视频自动进入网页全屏,检测间隔250ms")]},{text:"快捷键",type:"forms",forms:[be("倍速 -> 小","视频倍速变小",()=>w.shortCut.getShowText("dy-video-rate-low","暂无快捷键"),"keyboard",!1,!1,"default",e=>{var n;let t=(n=e.target.closest(".pops-panel-button"))==null?void 0:n.querySelector("span");w.shortCut.inputShortCut("dy-video-rate-low","暂无快捷键",r=>{t.innerHTML=r;});}),be("倍速 -> 大","视频倍速变大",()=>w.shortCut.getShowText("dy-video-rate-up","暂无快捷键"),"keyboard",!1,!1,"default",e=>{var n;let t=(n=e.target.closest(".pops-panel-button"))==null?void 0:n.querySelector("span");w.shortCut.inputShortCut("dy-video-rate-up","暂无快捷键",r=>{t.innerHTML=r;});})]},{text:"视频区域内-屏蔽",type:"forms",forms:[s("【屏蔽】右侧的展开评论按钮","shieldRightExpandCommentButton",!0,void 0,"屏蔽元素"),s("【屏蔽】搜索悬浮栏","shieldSearchFloatingBar",!0,void 0,"屏蔽元素,一般出现在左上角"),s("【屏蔽】网页全屏关闭按钮","shieldCloseFullScreenButton",!0,void 0,"屏蔽元素,一般开启网页全屏后出现在左上角"),s("【屏蔽】切换播放","shieldPlaySwitchButton",!1,void 0,"屏蔽元素,在右侧作者头像上方"),s("【屏蔽】作者头像","shieldAuthorAvatar",!1,void 0,"屏蔽元素"),s("【屏蔽】点赞","shieldLikeButton",!1,void 0,"屏蔽元素"),s("【屏蔽】评论","shieldCommentButton",!1,void 0,"屏蔽元素"),s("【屏蔽】收藏","shieldCollectionButton",!1,void 0,"屏蔽元素"),s("【屏蔽】分享","shieldSharenButton",!1,void 0,"屏蔽元素"),s("【屏蔽】看相关","shieldRelatedRecommendationsButton",!1,void 0,"屏蔽元素"),s("【屏蔽】更多","shieldMoreButton",!1,void 0,"...按钮,屏蔽元素"),s("【屏蔽】底部视频工具栏","shieldBottomVideoToolBar",!1,void 0,"屏蔽元素")]},{text:"评论区域内-屏蔽",type:"forms",forms:[s("【屏蔽】评论工具栏","dy-video-shieldUserCommentToolBar",!1,void 0,"屏蔽元素"),s("【屏蔽】大家都在搜","dy-video-shieldUserCommentEveryOneAllSearch",!1,void 0,"在评论区的顶部出现")]},{text:"视频过滤规则(可正则)",type:"forms",forms:[s("启用","shieldVideo",!0,void 0,"开启后可启用下面的屏蔽功能"),s("【屏蔽】直播","shieldVideo-live",!0,void 0,"过滤掉直播"),s("【屏蔽】广告","shieldVideo-ads",!0,void 0,"过滤掉广告"),{type:"own",getLiElementCallBack(e){let i=p.createElement("div",{className:"pops-panel-textarea",innerHTML:''},{style:"width: 100%;"}),t=i.querySelector("textarea");return t.value=j.get(),p.on(t,["input","propertychange"],c.debounce(function(){j.set(t.value);},200)),e.appendChild(i),e}}]}]},Ne={id:"panel-config-search",title:"搜索",forms:[{text:"屏蔽",type:"forms",forms:[s("【屏蔽】相关搜索","douyin-search-shieldReleatedSearches",!1,void 0,"屏蔽右边的相关搜索")]}]},ze={id:"m-panel-config-share-user",title:"主页",headerTitle:"/share/user
主页",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("视频合集","m-dy-share-user-coverPlayletList",!0,void 0,"正确跳转视频合集页面"),s("视频列表","m-dy-share-user-coverPostListContainer",!0,void 0,"正确跳转视频页面")]}]},Ge={id:"m-panel-config-share-video",title:"视频",headerTitle:"/share/video
视频",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("全局点击","m-dy-share-video-coverGlobalClick",!0,void 0,"阻止跳转至下载页")]}]},Ye={id:"m-panel-config-share-note",title:"笔记",headerTitle:"/share/note
笔记",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("精彩图文","m-dy-share-note-coverExcitingGraphicsAndText",!0,void 0,"正确跳转笔记页面"),s("用户","m-dy-share-note-coverUser",!0,void 0,"正确跳转用户主页"),s("话题","m-dy-share-note-coverHashTag",!0,void 0,"正确跳转相关话题"),s("音乐","m-dy-share-note-coverMusic",!0,void 0,"正确跳转相关音乐"),s("相关推荐","m-dy-share-note-coverRecommend",!0,void 0,"正确跳转笔记页面")]},{text:"屏蔽元素",type:"forms",forms:[s("【屏蔽】评论","m-dy-share-note-blockComment",!1,void 0,"屏蔽元素"),s("【屏蔽】相关推荐","m-dy-share-note-blockRecommend",!1,void 0,"屏蔽元素"),s("【屏蔽】底部工具栏","m-dy-share-note-blockFooterToobar",!1,void 0,"屏蔽元素")]}]},He={id:"m-panel-config-share-challenge",title:"话题",headerTitle:"/share/challenge
话题",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("顶部区域","m-dy-share-challenge-coverTopJump",!0,void 0,"阻止跳转至下载页面"),s("视频卡片","m-dy-share-challenge-coverVideoCard",!0,void 0,"正确跳转视频页面")]}]},qe={id:"m-panel-config-share-music",title:"音乐",headerTitle:"/share/music
音乐",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("视频卡片","m-dy-share-music-coverVideoCard",!0,void 0,"正确跳转视频页面")]}]},x={data:null,oneSuccessExecMenu:null,onceExec:null,listenData:null},l={$data:{get data(){return x.data==null&&(x.data=new c.Dictionary),x.data},get oneSuccessExecMenu(){return x.oneSuccessExecMenu==null&&(x.oneSuccessExecMenu=new c.Dictionary),x.oneSuccessExecMenu},get onceExec(){return x.onceExec==null&&(x.onceExec=new c.Dictionary),x.onceExec},get scriptName(){return Y},key:I,attributeKeyName:O,attributeDefaultValueName:F},$listener:{get listenData(){return x.listenData==null&&(x.listenData=new c.Dictionary),x.listenData}},init(){this.initPanelDefaultValue(),this.initExtensionsMenu();},initExtensionsMenu(){M.top===M.self&&Qe.add([{key:"show_pops_panel_setting",text:"⚙ 设置",autoReload:!1,isStoreValue:!1,showText(e){return e},callback:()=>{this.showPanel();}},{key:"show_pops_m_panel_setting",text:"⚙ 移动端设置",autoReload:!1,isStoreValue:!1,showText(e){return e},callback:()=>{this.showMPanel();}}]);},initPanelDefaultValue(){let e=this;function i(n){if(!n.attributes)return;let r=n.attributes[O],a=n.attributes[F];if(r==null){console.warn("请先配置键",n);return}e.$data.data.has(r)&&console.warn("请检查该key(已存在): "+r),e.$data.data.set(r,a);}let t=this.getPanelContentConfig().concat(this.getMPanelContentConfig());for(let n=0;n(o.error(["拦截器-请求错误",e]),e.type==="onabort"?S.warning("请求取消"):e.type==="onerror"?S.error("请求异常"):e.type==="ontimeout"?S.error("请求超时"):S.error("其它错误"),e));const C=c.addStyle,Je={init(){l.execMenu("shieldClientTip",()=>{this.shieldClientTip();}),l.execMenu("shieldFillingBricksAndStones",()=>{this.shieldFillingBricksAndStones();}),l.execMenu("shieldClient",()=>{this.shieldClient();}),l.execMenu("shieldQuickAccess",()=>{this.shieldQuickAccess();}),l.execMenu("shieldNotifitation",()=>{this.shieldNotifitation();}),l.execMenu("shieldPrivateMessage",()=>{this.shieldPrivateMessage();}),l.execMenu("shieldSubmission",()=>{this.shieldSubmission();}),l.execMenu("shieldWallpaper",()=>{this.shieldWallpaper();}),l.execMenu("shieldLeftNavigator",()=>{this.shieldLeftNavigator();}),l.execMenu("shieldTopNavigator",()=>{this.shieldTopNavigator();}),l.execMenuOnce("shieldBottomQuestionButton",()=>{this.shieldBottomQuestionButton();});},shieldFillingBricksAndStones(){o.info("【屏蔽】充砖石"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:not([data-click]):has(div[data-e2e="something-button"]) > :has(path[d="M5.757 12.268a6.397 6.397 0 1112.793 0 6.397 6.397 0 01-12.793 0zm6.396-7.897a7.897 7.897 0 100 15.793 7.897 7.897 0 000-15.793zm2.127 3.52v-.497h-1.5v6.462h.001c0 .854-.685 1.536-1.517 1.536a1.527 1.527 0 01-1.517-1.536c0-.854.685-1.536 1.517-1.536v-1.5c-1.672 0-3.017 1.365-3.017 3.036 0 1.67 1.345 3.036 3.017 3.036s3.017-1.365 3.017-3.036h-.001v-3.228a3.184 3.184 0 001.715.498v-1.5a1.725 1.725 0 01-1.715-1.735z"])','#douyin-header pace-island[id^="island"] > div[class]:not([data-click]):has(div[data-e2e="something-button"]) > :has(path[d="M5.757 12.268a6.397 6.397 0 1112.793 0 6.397 6.397 0 01-12.793 0zm6.396-7.897a7.897 7.897 0 100 15.793 7.897 7.897 0 000-15.793zm2.127 3.52v-.497h-1.5v6.462h.001c0 .854-.685 1.536-1.517 1.536a1.527 1.527 0 01-1.517-1.536c0-.854.685-1.536 1.517-1.536v-1.5c-1.672 0-3.017 1.365-3.017 3.036 0 1.67 1.345 3.036 3.017 3.036s3.017-1.365 3.017-3.036h-.001v-3.228a3.184 3.184 0 001.715.498v-1.5a1.725 1.725 0 01-1.715-1.735z"])'),b.isSearch()&&(o.info("搜索-【屏蔽】充砖石"),m.addBlockCSS('div:has(>div>div>div>div[data-e2e="something-button"] path[d="M5.757 12.268a6.397 6.397 0 1112.793 0 6.397 6.397 0 01-12.793 0zm6.396-7.897a7.897 7.897 0 100 15.793 7.897 7.897 0 000-15.793zm2.127 3.52v-.497h-1.5v6.462h.001c0 .854-.685 1.536-1.517 1.536a1.527 1.527 0 01-1.517-1.536c0-.854.685-1.536 1.517-1.536v-1.5c-1.672 0-3.017 1.365-3.017 3.036 0 1.67 1.345 3.036 3.017 3.036s3.017-1.365 3.017-3.036h-.001v-3.228a3.184 3.184 0 001.715.498v-1.5a1.725 1.725 0 01-1.715-1.735z"])'));},shieldClient(){o.info("【屏蔽】客户端"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) .dy-tip-container','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) .dy-tip-container:has(a)'),b.isSearch()&&(o.info("搜索-【屏蔽】客户端"),m.addBlockCSS('div:has(> div[data-e2e="something-button"] path[d="M18.404 19.018h-12v-1.5h12v1.5zM11.654 13.457v-8.19h1.5v8.19l3.22-3.22 1.06 1.061-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5 1.06-1.06 3.22 3.22z"])'));},shieldQuickAccess(){o.info("【屏蔽】快捷访问"),m.addBlockCSS('header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(.quick-access-nav-icon)'),b.isSearch()&&(o.info("搜索-【屏蔽】快捷访问"),m.addBlockCSS("div:has(>div>div>.quick-access-nav-icon)"));},shieldNotifitation(){o.info("【屏蔽】通知"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(path[d="M9.905 19.407h4.5v-1.5h-4.5v1.5z"])','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(path[d="M9.905 19.407h4.5v-1.5h-4.5v1.5z"])'),b.isSearch()&&(o.info("搜索-【屏蔽】通知"),m.addBlockCSS('ul:has( div>div[data-e2e="notice-entry"] )'));},shieldPrivateMessage(){o.info("【屏蔽】私信"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > ul:has(div[data-e2e="im-entry"])','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > ul:has(div[data-e2e="im-entry"])'),b.isSearch()&&(o.info("搜索-【屏蔽】私信"),m.addBlockCSS('ul:has( div>div[data-e2e="im-entry"] )'));},shieldSubmission(){o.info("【屏蔽】投稿"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(ul[data-e2e="cooperate-list"])','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(ul[data-e2e="cooperate-list"])'),b.isSearch()&&(o.info("搜索-【屏蔽】投稿"),m.addBlockCSS('div:has(>div >div>div[data-e2e="something-button"] path[d="M11.349 5.17h-.033c-1.068 0-1.915 0-2.598.054-.698.056-1.29.172-1.832.441a4.75 4.75 0 00-2.14 2.14c-.269.542-.386 1.134-.441 1.832-.055.683-.055 1.53-.055 2.599v.064c0 1.069 0 1.916.055 2.599.055.698.172 1.29.441 1.831a4.75 4.75 0 002.14 2.14c.542.27 1.134.386 1.832.442.683.055 1.53.055 2.598.055H12.684c1.068 0 1.915 0 2.598-.055.698-.056 1.29-.172 1.832-.442a4.75 4.75 0 002.14-2.14c.269-.541.386-1.133.441-1.831.055-.683.055-1.53.055-2.599v-.064c0-1.069 0-1.916-.055-2.599-.055-.698-.172-1.29-.441-1.832a4.75 4.75 0 00-2.14-2.14c-.542-.269-1.134-.385-1.832-.441-.683-.055-1.53-.055-2.598-.055h-1.335zM7.554 7.008c.299-.149.676-.241 1.284-.29.616-.05 1.403-.05 2.51-.05h1.303c1.108 0 1.895 0 2.511.05.608.049.985.141 1.284.29a3.25 3.25 0 011.464 1.464c.15.3.241.676.29 1.284.05.616.05 1.403.05 2.51 0 1.109 0 1.896-.05 2.512-.049.608-.14.985-.29 1.284a3.25 3.25 0 01-1.464 1.464c-.299.149-.676.241-1.284.29-.616.05-1.403.05-2.51.05h-1.303c-1.108 0-1.895 0-2.511-.05-.608-.049-.985-.141-1.284-.29a3.25 3.25 0 01-1.464-1.464c-.15-.3-.242-.676-.29-1.284-.05-.616-.05-1.403-.05-2.511s0-1.895.05-2.511c.048-.608.14-.985.29-1.284a3.25 3.25 0 011.464-1.464zm3.696 8.259v-2.25H9v-1.5h2.25v-2.25h1.5v2.25H15v1.5h-2.25v2.25h-1.5z"])'));},shieldClientTip(){o.info("【屏蔽】客户端提示"),m.addBlockCSS('ul li div[data-e2e="something-button"] + div div:has(>a[download*="douyin-downloader"])','#douyin-header pace-island[id^="island_"] ul > div:has(>a[class][download])','#douyin-header pace-island[id^="island_"] ul[class] li div[data-e2e="im-entry"] div>div div div:has(a[download][href])','#douyin-header header div[id^="douyin-header-menu"] pace-island[id^="island_"] .dy-tip-container div:has(+ #wallpaper-modal)');},shieldWallpaper(){o.info("【屏蔽】壁纸"),m.addBlockCSS('#douyin-header header div[id^="douyin-header-menu"] pace-island[id^="island_"] .dy-tip-container:has(span.semi-icon)');},shieldLeftNavigator(){o.info("【屏蔽】左侧导航栏"),m.addBlockCSS("#douyin-navigation"),C(` + `});}p.on(document,"click",'div[data-e2e="video-share-container"] div[data-inuser="false"] button + div',function(i){var r;let t=i.target,n=(r=c.getReactObj(t.parentElement))==null?void 0:r.reactFiber;if(!n){S.error("获取rectFiber属性失败");return}try{let a=[],h=n.return.memoizedProps.awemeInfo.video.playAddr,d=n.return.memoizedProps.awemeInfo.video.playAddrH265;if(h!=null&&Array.isArray(h)&&(a=a.concat(h)),d!=null&&Array.isArray(d)&&(a=a.concat(d)),!a.length){S.error("未获取到视频的有效链接信息");return}let u=a.map(f=>f.src);e(u);}catch{S.error("解析视频失败");}},{capture:!0});},mobileMode(){o.info("启用手机模式"),Ve.initialScale(),m.addBlockCSS("img#douyin-temp-sidebar"),C($e),b.isSearch()&&l.onceExec("douyin-search-mobileMode",()=>{Be.mobileMode();});}},w={shortCut:new Le("video-short-cut"),$data:{rateMap:["0.75","1","1.25","1.5","1.75","2","3"]},init(){this.shortCut.initGlobalKeyboardListener(this.getShortCutMap());},getShortCutMap(){return {"dy-video-rate-low":{callback(){o.info("调用倍速 => 小");let e=M.sessionStorage.getItem("player_playbackratio")??"1",i=w.$data.rateMap.findIndex(n=>n===e);if(i===0){o.warn("已是最小倍速: "+e);return}let t=w.$data.rateMap[i-1];o.info("设置倍速: "+t),R.chooseVideoRate(t);}},"dy-video-rate-up":{callback(){o.info("调用倍速 => 大");let e=M.sessionStorage.getItem("player_playbackratio")??"1",i=w.$data.rateMap.findIndex(n=>n===e);if(i===w.$data.rateMap.length-1){o.warn("已是最大倍速: "+e);return}let t=w.$data.rateMap[i+1];o.info("设置倍速: "+t),R.chooseVideoRate(t);}}}}},Fe={id:"panel-config-video",title:"视频",forms:[{text:"功能",type:"forms",forms:[s("沉浸模式","fullScreen",!1,void 0,"移除右侧工具栏、底部信息栏等"),s("手机模式","mobileMode",!1,void 0,"放大各种文字和图标")]},{text:"视频",type:"forms",forms:[H("清晰度","chooseVideoDefinition",1,[{text:"智能",value:0},{text:"极速",value:4},{text:"流畅",value:3},{text:"清晰",value:2},{text:"高清",value:1}],void 0,"自行选择清晰度"),s("视频解析","parseVideo",!0,void 0,"分享->下载(灰色的也可点击)"),s("评论区移到中间","changeCommentToBottom",!0,void 0,"修改评论区为中间弹出而非右侧区域"),s("↑自适应评论区位置","douyin-video-autoCheckChangeCommentToBottom",!0,void 0,"根据window.screen.orientation.type自动判断是否开启【评论区移到中间】"),s("自动进入网页全屏","autoEnterElementFullScreen",!1,void 0,"网页加载完毕后自动点击网页全屏按钮进入全屏"),s("双击进入网页全屏","dy-video-doubleClickEnterElementFullScreen",!1,void 0,"双击视频自动进入网页全屏,检测间隔250ms")]},{text:"快捷键",type:"forms",forms:[be("倍速 -> 小","视频倍速变小",()=>w.shortCut.getShowText("dy-video-rate-low","暂无快捷键"),"keyboard",!1,!1,"default",e=>{var n;let t=(n=e.target.closest(".pops-panel-button"))==null?void 0:n.querySelector("span");w.shortCut.inputShortCut("dy-video-rate-low","暂无快捷键",r=>{t.innerHTML=r;});}),be("倍速 -> 大","视频倍速变大",()=>w.shortCut.getShowText("dy-video-rate-up","暂无快捷键"),"keyboard",!1,!1,"default",e=>{var n;let t=(n=e.target.closest(".pops-panel-button"))==null?void 0:n.querySelector("span");w.shortCut.inputShortCut("dy-video-rate-up","暂无快捷键",r=>{t.innerHTML=r;});})]},{text:"视频区域内-屏蔽",type:"forms",forms:[s("【屏蔽】右侧的展开评论按钮","shieldRightExpandCommentButton",!0,void 0,"屏蔽元素"),s("【屏蔽】搜索悬浮栏","shieldSearchFloatingBar",!0,void 0,"屏蔽元素,一般出现在左上角"),s("【屏蔽】网页全屏关闭按钮","shieldCloseFullScreenButton",!0,void 0,"屏蔽元素,一般开启网页全屏后出现在左上角"),s("【屏蔽】切换播放","shieldPlaySwitchButton",!1,void 0,"屏蔽元素,在右侧作者头像上方"),s("【屏蔽】作者头像","shieldAuthorAvatar",!1,void 0,"屏蔽元素"),s("【屏蔽】点赞","shieldLikeButton",!1,void 0,"屏蔽元素"),s("【屏蔽】评论","shieldCommentButton",!1,void 0,"屏蔽元素"),s("【屏蔽】收藏","shieldCollectionButton",!1,void 0,"屏蔽元素"),s("【屏蔽】分享","shieldSharenButton",!1,void 0,"屏蔽元素"),s("【屏蔽】看相关","shieldRelatedRecommendationsButton",!1,void 0,"屏蔽元素"),s("【屏蔽】更多","shieldMoreButton",!1,void 0,"...按钮,屏蔽元素"),s("【屏蔽】底部视频工具栏","shieldBottomVideoToolBar",!1,void 0,"屏蔽元素"),s("【屏蔽】弹幕容器","shieldBottomVideoToolbarDanmuContainer",!1,void 0,"屏蔽元素(不包括屏蔽弹幕)")]},{text:"评论区域内-屏蔽",type:"forms",forms:[s("【屏蔽】评论工具栏","dy-video-shieldUserCommentToolBar",!1,void 0,"屏蔽元素"),s("【屏蔽】大家都在搜","dy-video-shieldUserCommentEveryOneAllSearch",!1,void 0,"在评论区的顶部出现")]},{text:"视频过滤规则(可正则)",type:"forms",forms:[s("启用","shieldVideo",!0,void 0,"开启后可启用下面的屏蔽功能"),s("【屏蔽】直播","shieldVideo-live",!0,void 0,"过滤掉直播"),s("【屏蔽】广告","shieldVideo-ads",!0,void 0,"过滤掉广告"),{type:"own",getLiElementCallBack(e){let i=p.createElement("div",{className:"pops-panel-textarea",innerHTML:''},{style:"width: 100%;"}),t=i.querySelector("textarea");return t.value=j.get(),p.on(t,["input","propertychange"],c.debounce(function(){j.set(t.value);},200)),e.appendChild(i),e}}]}]},Ne={id:"panel-config-search",title:"搜索",forms:[{text:"屏蔽",type:"forms",forms:[s("【屏蔽】相关搜索","douyin-search-shieldReleatedSearches",!1,void 0,"屏蔽右边的相关搜索")]}]},ze={id:"m-panel-config-share-user",title:"主页",headerTitle:"/share/user
主页",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("视频合集","m-dy-share-user-coverPlayletList",!0,void 0,"正确跳转视频合集页面"),s("视频列表","m-dy-share-user-coverPostListContainer",!0,void 0,"正确跳转视频页面")]}]},Ge={id:"m-panel-config-share-video",title:"视频",headerTitle:"/share/video
视频",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("全局点击","m-dy-share-video-coverGlobalClick",!0,void 0,"阻止跳转至下载页")]}]},Ye={id:"m-panel-config-share-note",title:"笔记",headerTitle:"/share/note
笔记",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("精彩图文","m-dy-share-note-coverExcitingGraphicsAndText",!0,void 0,"正确跳转笔记页面"),s("用户","m-dy-share-note-coverUser",!0,void 0,"正确跳转用户主页"),s("话题","m-dy-share-note-coverHashTag",!0,void 0,"正确跳转相关话题"),s("音乐","m-dy-share-note-coverMusic",!0,void 0,"正确跳转相关音乐"),s("相关推荐","m-dy-share-note-coverRecommend",!0,void 0,"正确跳转笔记页面")]},{text:"屏蔽元素",type:"forms",forms:[s("【屏蔽】评论","m-dy-share-note-blockComment",!1,void 0,"屏蔽元素"),s("【屏蔽】相关推荐","m-dy-share-note-blockRecommend",!1,void 0,"屏蔽元素"),s("【屏蔽】底部工具栏","m-dy-share-note-blockFooterToobar",!1,void 0,"屏蔽元素")]}]},He={id:"m-panel-config-share-challenge",title:"话题",headerTitle:"/share/challenge
话题",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("顶部区域","m-dy-share-challenge-coverTopJump",!0,void 0,"阻止跳转至下载页面"),s("视频卡片","m-dy-share-challenge-coverVideoCard",!0,void 0,"正确跳转视频页面")]}]},qe={id:"m-panel-config-share-music",title:"音乐",headerTitle:"/share/music
音乐",forms:[{text:"覆盖点击事件",type:"forms",forms:[s("视频卡片","m-dy-share-music-coverVideoCard",!0,void 0,"正确跳转视频页面")]}]},x={data:null,oneSuccessExecMenu:null,onceExec:null,listenData:null},l={$data:{get data(){return x.data==null&&(x.data=new c.Dictionary),x.data},get oneSuccessExecMenu(){return x.oneSuccessExecMenu==null&&(x.oneSuccessExecMenu=new c.Dictionary),x.oneSuccessExecMenu},get onceExec(){return x.onceExec==null&&(x.onceExec=new c.Dictionary),x.onceExec},get scriptName(){return Y},key:I,attributeKeyName:O,attributeDefaultValueName:F},$listener:{get listenData(){return x.listenData==null&&(x.listenData=new c.Dictionary),x.listenData}},init(){this.initPanelDefaultValue(),this.initExtensionsMenu();},initExtensionsMenu(){M.top===M.self&&Qe.add([{key:"show_pops_panel_setting",text:"⚙ 设置",autoReload:!1,isStoreValue:!1,showText(e){return e},callback:()=>{this.showPanel();}},{key:"show_pops_m_panel_setting",text:"⚙ 移动端设置",autoReload:!1,isStoreValue:!1,showText(e){return e},callback:()=>{this.showMPanel();}}]);},initPanelDefaultValue(){let e=this;function i(n){if(!n.attributes)return;let r=n.attributes[O],a=n.attributes[F];if(r==null){console.warn("请先配置键",n);return}e.$data.data.has(r)&&console.warn("请检查该key(已存在): "+r),e.$data.data.set(r,a);}let t=this.getPanelContentConfig().concat(this.getMPanelContentConfig());for(let n=0;n(o.error(["拦截器-请求错误",e]),e.type==="onabort"?S.warning("请求取消"):e.type==="onerror"?S.error("请求异常"):e.type==="ontimeout"?S.error("请求超时"):S.error("其它错误"),e));const C=c.addStyle,Je={init(){l.execMenu("shieldClientTip",()=>{this.shieldClientTip();}),l.execMenu("shieldFillingBricksAndStones",()=>{this.shieldFillingBricksAndStones();}),l.execMenu("shieldClient",()=>{this.shieldClient();}),l.execMenu("shieldQuickAccess",()=>{this.shieldQuickAccess();}),l.execMenu("shieldNotifitation",()=>{this.shieldNotifitation();}),l.execMenu("shieldPrivateMessage",()=>{this.shieldPrivateMessage();}),l.execMenu("shieldSubmission",()=>{this.shieldSubmission();}),l.execMenu("shieldWallpaper",()=>{this.shieldWallpaper();}),l.execMenu("shieldLeftNavigator",()=>{this.shieldLeftNavigator();}),l.execMenu("shieldTopNavigator",()=>{this.shieldTopNavigator();}),l.execMenuOnce("shieldBottomQuestionButton",()=>{this.shieldBottomQuestionButton();});},shieldFillingBricksAndStones(){o.info("【屏蔽】充砖石"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:not([data-click]):has(div[data-e2e="something-button"]) > :has(path[d="M5.757 12.268a6.397 6.397 0 1112.793 0 6.397 6.397 0 01-12.793 0zm6.396-7.897a7.897 7.897 0 100 15.793 7.897 7.897 0 000-15.793zm2.127 3.52v-.497h-1.5v6.462h.001c0 .854-.685 1.536-1.517 1.536a1.527 1.527 0 01-1.517-1.536c0-.854.685-1.536 1.517-1.536v-1.5c-1.672 0-3.017 1.365-3.017 3.036 0 1.67 1.345 3.036 3.017 3.036s3.017-1.365 3.017-3.036h-.001v-3.228a3.184 3.184 0 001.715.498v-1.5a1.725 1.725 0 01-1.715-1.735z"])','#douyin-header pace-island[id^="island"] > div[class]:not([data-click]):has(div[data-e2e="something-button"]) > :has(path[d="M5.757 12.268a6.397 6.397 0 1112.793 0 6.397 6.397 0 01-12.793 0zm6.396-7.897a7.897 7.897 0 100 15.793 7.897 7.897 0 000-15.793zm2.127 3.52v-.497h-1.5v6.462h.001c0 .854-.685 1.536-1.517 1.536a1.527 1.527 0 01-1.517-1.536c0-.854.685-1.536 1.517-1.536v-1.5c-1.672 0-3.017 1.365-3.017 3.036 0 1.67 1.345 3.036 3.017 3.036s3.017-1.365 3.017-3.036h-.001v-3.228a3.184 3.184 0 001.715.498v-1.5a1.725 1.725 0 01-1.715-1.735z"])'),b.isSearch()&&(o.info("搜索-【屏蔽】充砖石"),m.addBlockCSS('div:has(>div>div>div>div[data-e2e="something-button"] path[d="M5.757 12.268a6.397 6.397 0 1112.793 0 6.397 6.397 0 01-12.793 0zm6.396-7.897a7.897 7.897 0 100 15.793 7.897 7.897 0 000-15.793zm2.127 3.52v-.497h-1.5v6.462h.001c0 .854-.685 1.536-1.517 1.536a1.527 1.527 0 01-1.517-1.536c0-.854.685-1.536 1.517-1.536v-1.5c-1.672 0-3.017 1.365-3.017 3.036 0 1.67 1.345 3.036 3.017 3.036s3.017-1.365 3.017-3.036h-.001v-3.228a3.184 3.184 0 001.715.498v-1.5a1.725 1.725 0 01-1.715-1.735z"])'));},shieldClient(){o.info("【屏蔽】客户端"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) .dy-tip-container','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) .dy-tip-container:has(a)'),b.isSearch()&&(o.info("搜索-【屏蔽】客户端"),m.addBlockCSS('div:has(> div[data-e2e="something-button"] path[d="M18.404 19.018h-12v-1.5h12v1.5zM11.654 13.457v-8.19h1.5v8.19l3.22-3.22 1.06 1.061-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5 1.06-1.06 3.22 3.22z"])'));},shieldQuickAccess(){o.info("【屏蔽】快捷访问"),m.addBlockCSS('header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(.quick-access-nav-icon)'),b.isSearch()&&(o.info("搜索-【屏蔽】快捷访问"),m.addBlockCSS("div:has(>div>div>.quick-access-nav-icon)"));},shieldNotifitation(){o.info("【屏蔽】通知"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(path[d="M9.905 19.407h4.5v-1.5h-4.5v1.5z"])','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(path[d="M9.905 19.407h4.5v-1.5h-4.5v1.5z"])'),b.isSearch()&&(o.info("搜索-【屏蔽】通知"),m.addBlockCSS('ul:has( div>div[data-e2e="notice-entry"] )'));},shieldPrivateMessage(){o.info("【屏蔽】私信"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > ul:has(div[data-e2e="im-entry"])','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > ul:has(div[data-e2e="im-entry"])'),b.isSearch()&&(o.info("搜索-【屏蔽】私信"),m.addBlockCSS('ul:has( div>div[data-e2e="im-entry"] )'));},shieldSubmission(){o.info("【屏蔽】投稿"),m.addBlockCSS('#douyin-right-container pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(ul[data-e2e="cooperate-list"])','#douyin-header pace-island[id^="island"] > div[class]:has(div[data-e2e="something-button"]) > :has(ul[data-e2e="cooperate-list"])'),b.isSearch()&&(o.info("搜索-【屏蔽】投稿"),m.addBlockCSS('div:has(>div >div>div[data-e2e="something-button"] path[d="M11.349 5.17h-.033c-1.068 0-1.915 0-2.598.054-.698.056-1.29.172-1.832.441a4.75 4.75 0 00-2.14 2.14c-.269.542-.386 1.134-.441 1.832-.055.683-.055 1.53-.055 2.599v.064c0 1.069 0 1.916.055 2.599.055.698.172 1.29.441 1.831a4.75 4.75 0 002.14 2.14c.542.27 1.134.386 1.832.442.683.055 1.53.055 2.598.055H12.684c1.068 0 1.915 0 2.598-.055.698-.056 1.29-.172 1.832-.442a4.75 4.75 0 002.14-2.14c.269-.541.386-1.133.441-1.831.055-.683.055-1.53.055-2.599v-.064c0-1.069 0-1.916-.055-2.599-.055-.698-.172-1.29-.441-1.832a4.75 4.75 0 00-2.14-2.14c-.542-.269-1.134-.385-1.832-.441-.683-.055-1.53-.055-2.598-.055h-1.335zM7.554 7.008c.299-.149.676-.241 1.284-.29.616-.05 1.403-.05 2.51-.05h1.303c1.108 0 1.895 0 2.511.05.608.049.985.141 1.284.29a3.25 3.25 0 011.464 1.464c.15.3.241.676.29 1.284.05.616.05 1.403.05 2.51 0 1.109 0 1.896-.05 2.512-.049.608-.14.985-.29 1.284a3.25 3.25 0 01-1.464 1.464c-.299.149-.676.241-1.284.29-.616.05-1.403.05-2.51.05h-1.303c-1.108 0-1.895 0-2.511-.05-.608-.049-.985-.141-1.284-.29a3.25 3.25 0 01-1.464-1.464c-.15-.3-.242-.676-.29-1.284-.05-.616-.05-1.403-.05-2.511s0-1.895.05-2.511c.048-.608.14-.985.29-1.284a3.25 3.25 0 011.464-1.464zm3.696 8.259v-2.25H9v-1.5h2.25v-2.25h1.5v2.25H15v1.5h-2.25v2.25h-1.5z"])'));},shieldClientTip(){o.info("【屏蔽】客户端提示"),m.addBlockCSS('ul li div[data-e2e="something-button"] + div div:has(>a[download*="douyin-downloader"])','#douyin-header pace-island[id^="island_"] ul > div:has(>a[class][download])','#douyin-header pace-island[id^="island_"] ul[class] li div[data-e2e="im-entry"] div>div div div:has(a[download][href])','#douyin-header header div[id^="douyin-header-menu"] pace-island[id^="island_"] .dy-tip-container div:has(+ #wallpaper-modal)');},shieldWallpaper(){o.info("【屏蔽】壁纸"),m.addBlockCSS('#douyin-header header div[id^="douyin-header-menu"] pace-island[id^="island_"] .dy-tip-container:has(span.semi-icon)');},shieldLeftNavigator(){o.info("【屏蔽】左侧导航栏"),m.addBlockCSS("#douyin-navigation"),C(` /* 修复顶部导航栏的宽度 */ #douyin-header{ width: 100%; @@ -243,7 +243,7 @@ ul[data-e2e="scroll-list"] {\r #douyin-header div[data-click="doubleClick"] > div[data-click="doubleClick"] > div input[data-e2e="searchbar-input"]::placeholder{ color: transparent; } - `);},shieldSearchGuessYouWantToSearch(){o.info("【屏蔽】搜索-猜你想搜"),m.addBlockCSS('button[data-e2e="searchbar-button"] + div div:has( + div[data-e2e="search-guess-container"])','button[data-e2e="searchbar-button"] + div div[data-e2e="search-guess-container"]');},shieldSearchTiktokHotspot(){o.info("【屏蔽】搜索-抖音热点"),m.addBlockCSS('button[data-e2e="searchbar-button"] + div div:has( + div[data-e2e="search-hot-container"])','button[data-e2e="searchbar-button"] + div div[data-e2e="search-hot-container"]');}},Ze={removeEnvCheck(){o.info("移除环境检测");let e=M.setInterval;M.setInterval=function(i,t){let n=i.toString().trim();if(n.includes("debugger")){o.success(["拦截→",[n]]);return}if(n.includes("checkEXp")){o.success(["拦截→",[n]]);return}return e.call(this,i,t)};}},we={disguiseLogin(){o.info("伪装登录");const e=2e4;let i=parseInt((Math.random()*1e6).toString()),t=Object.defineProperty({},"uid",{value:i,writable:!1});function n(a){var f,v,y,g,B,E,A,Q,K,J,X,Z,ee,te,ie,oe,ne,ae,re,le,se,de,ce,ue,he,me,fe,ve,pe,ge;let h=[],d=c.getReactObj(a),u=d==null?void 0:d.reactFiber;return d==null||d.reactProps,(y=(v=(f=u==null?void 0:u.alternate)==null?void 0:f.return)==null?void 0:v.memoizedProps)!=null&&y.userInfo&&h.push((E=(B=(g=u==null?void 0:u.alternate)==null?void 0:g.return)==null?void 0:B.memoizedProps)==null?void 0:E.userInfo),(J=(K=(Q=(A=u==null?void 0:u.alternate)==null?void 0:A.return)==null?void 0:Q.memoizedProps)==null?void 0:K.userInfo)!=null&&J.userInfo&&h.push((ee=(Z=(X=u==null?void 0:u.alternate)==null?void 0:X.return)==null?void 0:Z.memoizedProps)==null?void 0:ee.userInfo.userInfo),(ne=(oe=(ie=(te=u==null?void 0:u.alternate)==null?void 0:te.return)==null?void 0:ie.return)==null?void 0:oe.memoizedProps)!=null&&ne.userInfo&&h.push((se=(le=(re=(ae=u==null?void 0:u.alternate)==null?void 0:ae.return)==null?void 0:re.return)==null?void 0:le.memoizedProps)==null?void 0:se.userInfo),(me=(he=(ue=(ce=(de=u==null?void 0:u.alternate)==null?void 0:de.return)==null?void 0:ce.return)==null?void 0:ue.memoizedProps)==null?void 0:he.userInfo)!=null&&me.userInfo&&h.push((ge=(pe=(ve=(fe=u==null?void 0:u.alternate)==null?void 0:fe.return)==null?void 0:ve.return)==null?void 0:pe.memoizedProps)==null?void 0:ge.userInfo.userInfo),h}function r(a){n(a).forEach(h=>{Object.defineProperties(h,{info:{value:t,writable:!1},isLogin:{value:!0,writable:!1}});});}if(q.watchVideDataListChange(a=>{r(a);}),c.waitNode("#root div[class*='-os']",e).then(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback:c.debounce(()=>{let a=q.getOSElement();a&&r(a);},70)});}).catch(a=>{}),b.isLive())o.info("伪装登录:live"),c.waitNode("#douyin-header div:has(.dy-tip-container)",e).then(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback:c.debounce(()=>{r(document.querySelector("#douyin-header"));},70)});});else if(b.isSearch()){let a=function(h){var f,v,y,g,B,E,A;let d=c.getReactObj(h);d==null||d.reactFiber;let u=d==null?void 0:d.reactProps;typeof((g=(y=(v=(f=u==null?void 0:u.children)==null?void 0:f[1])==null?void 0:v.props)==null?void 0:y.userInfo)==null?void 0:g.isLogin)=="boolean"&&(u.children[1].props.userInfo.isLogin=!0),typeof((A=(E=(B=u==null?void 0:u.children)==null?void 0:B[1])==null?void 0:E.props)==null?void 0:A.isClient)=="boolean"&&(u.children[1].props.isClient=!0);};o.info("伪装登录:search"),c.waitNode("#root > div",e).then(h=>{if(!h){o.error("#root > div获取失败");return}c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback:c.debounce((d,u)=>{a(h);},70)});});}},watchLoginDialogToClose(){o.info("监听登录弹窗并关闭"),m.addBlockCSS('div[id^="login-full-panel-"]'),c.waitNode("body").then(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback(){var i,t;let e=document.querySelector('body > div[id^="login-full-panel-"] .dy-account-close');e&&((t=(i=c.getReactObj(e))==null?void 0:i.reactProps)==null||t.onClick(new Event("click")));}});});}},et={init(){l.execMenu("live-shieldChatRoom",()=>{this.shieldChatRoom();}),l.execMenu("live-shielChatRoomVipSeats",()=>{this.shielChatRoomVipSeats();}),l.execMenu("dy-live-shieldUserLevelIcon",()=>{this.shieldUserLevelIcon();}),l.execMenu("dy-live-shieldUserVIPIcon",()=>{this.shieldUserVIPIcon();}),l.execMenu("dy-live-shieldUserFansIcon",()=>{this.shieldUserFansIcon();}),l.execMenu("dy-live-shieldMessage",()=>{this.shieldMessage();});},shieldChatRoom(){o.info("【屏蔽】评论区"),m.addBlockCSS("#chatroom"),C(` + `);},shieldSearchGuessYouWantToSearch(){o.info("【屏蔽】搜索-猜你想搜"),m.addBlockCSS('button[data-e2e="searchbar-button"] + div div:has( + div[data-e2e="search-guess-container"])','button[data-e2e="searchbar-button"] + div div[data-e2e="search-guess-container"]');},shieldSearchTiktokHotspot(){o.info("【屏蔽】搜索-抖音热点"),m.addBlockCSS('button[data-e2e="searchbar-button"] + div div:has( + div[data-e2e="search-hot-container"])','button[data-e2e="searchbar-button"] + div div[data-e2e="search-hot-container"]');}},Ze={removeEnvCheck(){o.info("移除环境检测");let e=M.setInterval;M.setInterval=function(i,t){let n=i.toString().trim();if(n.includes("debugger")){o.success(["拦截→",[n]]);return}if(n.includes("checkEXp")){o.success(["拦截→",[n]]);return}return e.call(this,i,t)};}},we={disguiseLogin(){o.info("伪装登录");const e=2e4;let i=parseInt((Math.random()*1e6).toString()),t=Object.defineProperty({},"uid",{value:i,writable:!1});function n(a){var f,v,y,g,B,T,A,Q,K,J,X,Z,ee,te,ie,oe,ne,ae,re,le,se,de,ce,ue,he,me,fe,ve,pe,ge;let h=[],d=c.getReactObj(a),u=d==null?void 0:d.reactFiber;return d==null||d.reactProps,(y=(v=(f=u==null?void 0:u.alternate)==null?void 0:f.return)==null?void 0:v.memoizedProps)!=null&&y.userInfo&&h.push((T=(B=(g=u==null?void 0:u.alternate)==null?void 0:g.return)==null?void 0:B.memoizedProps)==null?void 0:T.userInfo),(J=(K=(Q=(A=u==null?void 0:u.alternate)==null?void 0:A.return)==null?void 0:Q.memoizedProps)==null?void 0:K.userInfo)!=null&&J.userInfo&&h.push((ee=(Z=(X=u==null?void 0:u.alternate)==null?void 0:X.return)==null?void 0:Z.memoizedProps)==null?void 0:ee.userInfo.userInfo),(ne=(oe=(ie=(te=u==null?void 0:u.alternate)==null?void 0:te.return)==null?void 0:ie.return)==null?void 0:oe.memoizedProps)!=null&&ne.userInfo&&h.push((se=(le=(re=(ae=u==null?void 0:u.alternate)==null?void 0:ae.return)==null?void 0:re.return)==null?void 0:le.memoizedProps)==null?void 0:se.userInfo),(me=(he=(ue=(ce=(de=u==null?void 0:u.alternate)==null?void 0:de.return)==null?void 0:ce.return)==null?void 0:ue.memoizedProps)==null?void 0:he.userInfo)!=null&&me.userInfo&&h.push((ge=(pe=(ve=(fe=u==null?void 0:u.alternate)==null?void 0:fe.return)==null?void 0:ve.return)==null?void 0:pe.memoizedProps)==null?void 0:ge.userInfo.userInfo),h}function r(a){n(a).forEach(h=>{Object.defineProperties(h,{info:{value:t,writable:!1},isLogin:{value:!0,writable:!1}});});}if(q.watchVideDataListChange(a=>{r(a);}),c.waitNode("#root div[class*='-os']",e).then(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback:c.debounce(()=>{let a=q.getOSElement();a&&r(a);},70)});}).catch(a=>{}),b.isLive())o.info("伪装登录:live"),c.waitNode("#douyin-header div:has(.dy-tip-container)",e).then(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback:c.debounce(()=>{r(document.querySelector("#douyin-header"));},70)});});else if(b.isSearch()){let a=function(h){var f,v,y,g,B,T,A;let d=c.getReactObj(h);d==null||d.reactFiber;let u=d==null?void 0:d.reactProps;typeof((g=(y=(v=(f=u==null?void 0:u.children)==null?void 0:f[1])==null?void 0:v.props)==null?void 0:y.userInfo)==null?void 0:g.isLogin)=="boolean"&&(u.children[1].props.userInfo.isLogin=!0),typeof((A=(T=(B=u==null?void 0:u.children)==null?void 0:B[1])==null?void 0:T.props)==null?void 0:A.isClient)=="boolean"&&(u.children[1].props.isClient=!0);};o.info("伪装登录:search"),c.waitNode("#root > div",e).then(h=>{if(!h){o.error("#root > div获取失败");return}c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback:c.debounce((d,u)=>{a(h);},70)});});}},watchLoginDialogToClose(){o.info("监听登录弹窗并关闭"),m.addBlockCSS('div[id^="login-full-panel-"]'),c.waitNode("body").then(()=>{c.mutationObserver(document.body,{config:{subtree:!0,childList:!0},callback(){var i,t;let e=document.querySelector('body > div[id^="login-full-panel-"] .dy-account-close');e&&((t=(i=c.getReactObj(e))==null?void 0:i.reactProps)==null||t.onClick(new Event("click")));}});});}},et={init(){l.execMenu("live-shieldChatRoom",()=>{this.shieldChatRoom();}),l.execMenu("live-shielChatRoomVipSeats",()=>{this.shielChatRoomVipSeats();}),l.execMenu("dy-live-shieldUserLevelIcon",()=>{this.shieldUserLevelIcon();}),l.execMenu("dy-live-shieldUserVIPIcon",()=>{this.shieldUserVIPIcon();}),l.execMenu("dy-live-shieldUserFansIcon",()=>{this.shieldUserFansIcon();}),l.execMenu("dy-live-shieldMessage",()=>{this.shieldMessage();});},shieldChatRoom(){o.info("【屏蔽】评论区"),m.addBlockCSS("#chatroom"),C(` div[data-e2e="living-container"], div[data-e2e="living-container"] > div{ margin-bottom: 0px !important; diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.user.js" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.user.js" index a03379c3e..2eb44cc35 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.user.js" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/dist/\346\212\226\351\237\263\344\274\230\345\214\226.user.js" @@ -1,7 +1,7 @@ // ==UserScript== // @name 抖音优化 // @namespace https://github.com/WhiteSevs/TamperMonkeyScript -// @version 2024.6.25 +// @version 2024.6.26 // @author WhiteSevs // @description 过滤广告、过滤直播、可自定义过滤视频的屏蔽关键字、伪装登录、直播屏蔽弹幕、礼物特效等 // @license GPL-3.0-only @@ -1122,6 +1122,9 @@ PopsPanel.execMenu("shieldBottomVideoToolBar", () => { this.shieldBottomVideoToolBar(); }); + PopsPanel.execMenu("shieldBottomVideoToolbarDanmuContainer", () => { + this.shieldBottomVideoToolbarDanmuContainer(); + }); }, /** * 【屏蔽】右侧的展开评论按钮 @@ -1258,6 +1261,15 @@ bottom: 0 !important; } `); + }, + /** + * 【屏蔽】底部视频工具栏的弹幕容器 + */ + shieldBottomVideoToolbarDanmuContainer() { + log.info("【屏蔽】底部视频工具栏的弹幕容器"); + DouYinUtils.addBlockCSS( + 'xg-controls xg-inner-controls .danmakuContainer[data-e2e="danmaku-container"]' + ); } }; const DouYinVideoComment = { @@ -1938,6 +1950,13 @@ false, void 0, "屏蔽元素" + ), + UISwitch( + "【屏蔽】弹幕容器", + "shieldBottomVideoToolbarDanmuContainer", + false, + void 0, + "屏蔽元素(不包括屏蔽弹幕)" ) ] }, diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/video/DouYinVideoHideElement.ts" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/video/DouYinVideoHideElement.ts" index e2dd00c6e..16378d071 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/video/DouYinVideoHideElement.ts" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/main/video/DouYinVideoHideElement.ts" @@ -40,6 +40,9 @@ export const DouYinVideoHideElement = { PopsPanel.execMenu("shieldBottomVideoToolBar", () => { this.shieldBottomVideoToolBar(); }); + PopsPanel.execMenu("shieldBottomVideoToolbarDanmuContainer", () => { + this.shieldBottomVideoToolbarDanmuContainer(); + }); }, /** * 【屏蔽】右侧的展开评论按钮 @@ -178,4 +181,15 @@ export const DouYinVideoHideElement = { } `); }, + /** + * 【屏蔽】底部视频工具栏的弹幕容器 + */ + shieldBottomVideoToolbarDanmuContainer() { + log.info("【屏蔽】底部视频工具栏的弹幕容器"); + DouYinUtils.addBlockCSS( + 'xg-controls xg-inner-controls .danmakuContainer[data-e2e="danmaku-container"]' + ); + // 弹幕 + // .basePlayerContainer > div.danmu + }, }; diff --git "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/setting/components/video.ts" "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/setting/components/video.ts" index 697e6143a..0588aa0d3 100644 --- "a/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/setting/components/video.ts" +++ "b/packages/\346\212\226\351\237\263\344\274\230\345\214\226/src/setting/components/video.ts" @@ -235,6 +235,13 @@ const PanelVideoConfig: PopsPanelContentConfig = { void 0, "屏蔽元素" ), + UISwitch( + "【屏蔽】弹幕容器", + "shieldBottomVideoToolbarDanmuContainer", + false, + void 0, + "屏蔽元素(不包括屏蔽弹幕)" + ), ], }, {