From 30c6f3eacf86236668fb242727ca2b8ccda88485 Mon Sep 17 00:00:00 2001 From: Demo Date: Wed, 10 May 2023 22:37:35 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=A3=20feat:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=BE=AE=E5=8D=9A=E7=9B=B8=E5=85=B3=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rewrite/AdBlock/Weibo.adblock | 14 ++- Rewrite/AdBlock/Weibo.conf | 143 ----------------------------- Scripts/AdBlock/Weibo/weibo.js | 32 +++++-- Scripts/AdBlock/Weibo/weibo.min.js | 5 +- 4 files changed, 36 insertions(+), 158 deletions(-) delete mode 100644 Rewrite/AdBlock/Weibo.conf diff --git a/Rewrite/AdBlock/Weibo.adblock b/Rewrite/AdBlock/Weibo.adblock index 995fc46..3e6eca8 100644 --- a/Rewrite/AdBlock/Weibo.adblock +++ b/Rewrite/AdBlock/Weibo.adblock @@ -6,17 +6,23 @@ // @TgChannel https://t.me/ddgksf2021 // @Contribute https://t.me/ddgksf2013_bot // @Feedback 📮 ddgksf2013@163.com 📮 -// @UpdateTime 2023-04-11 +// @UpdateTime 2023-04-27 // @Attention 微博、微博国际版净化,现已二合一,使用中若有问题请发邮件! -// @Function 让你更加愉悦的刷微博 // @Suitable 自行观看“# > ”注释内容 // @Attention 如需引用请注明出处,谢谢合作! -// @Version V2.0.77 +// @Version V2.0.83 // @ScriptURL https://github.com/ddgksf2013/Rewrite/raw/master/AdBlock/Weibo.conf // ==/UserScript== hostname = api.weibo.*, *.api.weibo.*, mapi.weibo.*, *.uve.weibo.com, new.vip.weibo.cn, boot.biz.weibo.com + +# > 微博_请手动添加以下分流至本地@ddgksf2013 +; host, sdkapp.uve.weibo.com, direct + + +# > 微博_开屏广告预加载处理@ddgksf2013 +^https?:\/\/boot.*weibo\.com\/v\d\/ad\/preload url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js # > 微博_未登陆状态下首页信息流处理@ddgksf2013 ^https?:\/\/api\.weibo\.cn\/\d\/\w{5}\/(statuses_unread_hot_timeline|timeline) url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js # > 微博_每日一次的开屏广告请求@ddgksf2013 @@ -56,7 +62,7 @@ hostname = api.weibo.*, *.api.weibo.*, mapi.weibo.*, *.uve.weibo.com, new.vip.we # > 微博国际版_屏蔽searching_info@shiro ^https?:\/\/weibointl\.api\.weibo\.c(n|om)\/portal\.php.*user&a=get_searching_info url echo-response text/html echo-response https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo_search_info.json # > 微博国际版_屏蔽search_topic@shiro -^https?:\/\/weibointl\.api\.weibo\.c(n|om)\/portal\.php.*feed&a=search_topic url echo-response text/html echo-response https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo_search_topic.json +^https?:\/\/weibointl\.api\.weibo\.c(n|om)\/portal\.php.*feed&a=search_topic url echo-response text/html echo-response https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo_search_info.json # > 微博国际版_屏蔽开屏广告@ddgksf2013 ^https?:\/\/weibointl\.api\.weibo\.c(n|om)\/portal\.php.*get_coopen_ads url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js # > 微博国际版_屏蔽sdkad@ddgksf2013 diff --git a/Rewrite/AdBlock/Weibo.conf b/Rewrite/AdBlock/Weibo.conf deleted file mode 100644 index 19bae35..0000000 --- a/Rewrite/AdBlock/Weibo.conf +++ /dev/null @@ -1,143 +0,0 @@ -// ==UserScript== -// @ScriptName 微博&微博国际版净化[墨鱼版] -// @Author @ddgksf2013,@zmqcherish -// @ForHelp 若有屏蔽广告的需求,可公众号后台回复APP名称 -// @WechatID 公众号墨鱼手记 -// @TgChannel https://t.me/ddgksf2021 -// @Contribute https://t.me/ddgksf2013_bot -// @Feedback 📮 ddgksf2013@163.com 📮 -// @UpdateTime 2023-04-11 -// @Attention 微博、微博国际版净化,现已二合一,使用中若有问题请发邮件! -// @Function 让你更加愉悦的刷微博 -// @Suitable 自行观看“# > ”注释内容 -// @Attention 如需引用请注明出处,谢谢合作! -// @Version V2.0.77 -// @ScriptURL https://github.com/ddgksf2013/Rewrite/raw/master/AdBlock/Weibo.conf -// ==/UserScript== - -# 𝐂𝐮𝐭𝐭𝐥𝐞𝐟𝐢𝐬𝐡 𝐒𝐞𝐥𝐟-𝐮𝐬𝐞 𝐑𝐞𝐰𝐫𝐢𝐭𝐞 𝐂𝐨𝐧𝐟𝐢𝐠𝐮𝐫𝐚𝐭𝐢𝐨𝐧 𝐂𝐡𝐚𝐧𝐠𝐞𝐥𝐨𝐠 𝐂𝐫𝐞𝐚𝐭𝐞𝐝 𝐛𝐲 𝐝𝐝𝐠𝐤𝐬𝐟𝟐𝟎𝟏𝟑 𝐚𝐧𝐝 𝐳𝐦𝐪𝐜𝐡𝐞𝐫𝐢𝐬𝐡 -# [+]202X-XX-XX 01、删除首页(tab1)流和超话中的广告、热推删除视频号(tab2)流中的广告,删除发现页(tab3)轮播广告图 -# [+]202X-XX-XX 02、删除个人页(tab5)中的创作者中心下方的轮播图、为你推荐、用户任务和VIP一栏(可配置) -# [+]202X-XX-XX 03、删除微博详情页的广告、相关推荐、微博主好物种草和关注博主模块(可配置),删除微博开屏广告 | 参考@yichahucha -# [+]202X-XX-XX 04、删除tab2菜单中的虚假通知,删除tab1顶部的签到和直播(可配置),删除微博详情页菜单栏的新鲜事头像挂件等(可配置) -# [+]202X-XX-XX 05、删除微博详情页评论区相关内容(可配置,默认关闭),删除微博详情页评论区推荐内容(可配置,默认打开) -# [+]202X-XX-XX 06、删除超话中可能感兴趣的超话、超话中的好友、超话好友关注、用户页可能感兴趣的人(可配置,默认关闭) -# [+]202X-XX-XX 07、删除搜索结果页广告,将个人主页关注按钮默认值由推荐改为关注的人 -# [+]202X-XX-XX 08、自定义个人主页图标(可配置,默认关闭)效果图,关闭自动播放下一个视频(可配置,默认关闭) -# [+]202X-XX-XX 09、删除微博详情页打赏模块(可配置,默认关闭),自定义底部tab图标(可配置,默认关闭)效果图 -# [+]202X-XX-XX 10、已删除移除tab5新任务通知,原样式,删除绿洲模块(可配置,默认关闭) -# [+]202X-XX-XX 11、待定自定义开屏图片/视频。如有需求,可以考虑开发,删除个人页让“红包飞模块” -# [+]2022-03-12 12、新增屏蔽用户功能,如果有不得已需要关注的人(比如某些抽奖关注),但是又不想看TA的内容可以使用此配置。 -# [+]2022-05-22 13、重新删除发现页(tab3)轮播广告图,需要配置weibo_config.js -> removeSearchWindow为true,其实轮播中有些不是广告,一起杀 -# [+]2022-07-12 14、删除消息页动态流的广告 -# [+]2022-08-22 15、删除超话tab页无关元素(可配置) -# [+]2022-08-23 16、删除微博详情页超话新帖和新用户相关提示 -# [+]2022-09-02 17、删除初次打开搜索页的轮播图 -# [+]2022-09-12 18、修复超话无法签到bug -# [+]2022-10-11 19、移除首页新版广告 -# [+]2022-10-24 20、移除用户页新版广告 -# [+]2022-10-24 XX、🍁以上1-20条为@zmqcherish所写,下面21条开始为@墨鱼所写🍁 -# [+]2022-12-14 21、将微博国际版去广告与微博去广告二合一,删除微博发现页的轮播图,add key removeSearchWindow for true -# [+]2022-12-15 22、更换微博国际版去广告的search_topic -# [+]2022-12-15 23、微博国际版去广告不再采用单一reject方式,利用脚本去广告 -# [+]2022-12-15 24、去除微博我的页面“绿荫总动员”条幅,去除微博搜索框填词 -# [+]2022-12-15 25、修复微博热搜界面“要闻”与“同城”无法打开的bug -# [+]2022-12-15 26、去除我的、热搜、文娱列表广告内容 -# [+]2022-12-16 27、请手动添加后面的分流至本地 host, sdkapp.uve.weibo.com, direct -# [+]2022-12-16 28、删除主页顶部“#记录周五的开心时刻#”,去除搜索页面“实况热聊”栏以及group栏 -# [+]2022-12-16 29、删除微博评论详情页面最底部的“已过滤不当言论,部分评论暂不展示”等文字 -# [-]2022-12-17 30、脚本weibo_json.js已解除限制,其它工具诸如surge、Loon、小火箭亦可使用 -# [+]2022-12-18 31、优化超话tab看帖页面,保留搜索(去除自动填充内容)及感兴趣的超话以及去除一些无关group和card -# [+]2022-12-20 32、删除超话搜索栏目下方的“可能感兴趣”、“热门超话”、“影视超话”、“游戏超话”等card -# [+]2022-12-21 33、去除搜索页面tab中热搜下面一排圆圈图标内容 -# [+]2022-12-23 34、屏蔽hot_hours_spotlight请求 -# [+]2022-12-24 35、修复主页浏览动态微博时广告图片的空白占位问题,修复每日首次打开SearchTab页面广告轮播失效问题 -# [+]2022-12-24 36、删除发现页下拉刷新时的背景广告图片,瞬间清爽 -# [+]2022-12-24 37、删除微博短视频流中的广告,让你无广告享受刷短视频的快感 -# [+]2022-12-25 38、删除搜索页面热搜顶部偶尔出现的HotSearchPush -# [+]2022-12-27 39、删除微博用户页“可能感兴趣的人”内容 -# [+]2022-12-29 40、删除微博信息流中商品橱窗内容(并未将整个CARD一起删除) -# [+]2023-01-01 41、删除微博首页顶部感兴趣的人group推荐,并兼容微博国际版 -# [+]2023-01-03 42、去除微博国际版热搜列表的置顶内容 -# [+]2023-01-05 43、添加屏蔽sdkconfig请求及应用内弹窗广告请求 -# [+]2023-01-06 44、去除微博我的页面中Myname后面的续费VIP_Icon内容 -# [+]2023-01-08 45、屏蔽发现页面顶部搜索框热词,将热词恢复为‘搜索’ -# [+]2023-01-16 46、去除微博短视频中的右下角的红包`转发有礼`与左下角商品推广`进店逛逛`等推广标志 -# [+]2023-01-18 47、屏蔽微博客户端首页左上角每日的弹窗tips -# [+]2023-01-22 48、去除微博热搜对应某关键词下信息流中的遗留广告 -# [+]2023-01-24 49、去除微博底部超话栏表层浮icon及tips -# [+]2023-02-03 50、解决微博用户置顶博文消失的bug,同时新增去除搜索框下方的猜你想搜条目 -# [+]2023-02-08 51、修复首页‘可能感兴趣的人’card失效bug,同时去除搜索页面中部比较窄的‘热门微博’字样的CARD,使信息流保持一致 -# [+]2023-02-09 52、自动删除我的页面除[超话社区]CARD以外的所有推广内容(再也不用手动移除),另外[超话社区]依然支持自主移除或添加到我的页面内 -# [+]2023-02-09 53、我的页面Card白名单新增[我的最近访问],以方便群友,依然支持自主移除或添加 -# [+]2023-02-13 54、修复某些用户微博页面最近动态不显示的bug,增加微博视频detail处理 -# [+]2023-02-15 55、在有缓存的情况下,处理微博搜索框下的‘猜你想搜’栏目以及‘猜你想搜偏好设置’栏目[code not added] -# [+]2023-02-16 56、处理部分用户每日首次打开微博的开屏广告请求[部分用户是指未将boot.biz.weibo.com域名添加黑名单] -# [+]2023-02-18 57、修复微博在繁体字下评论区屏蔽用户推荐失效的问题 -# [+]2023-02-22 58、处理信息流中视频左上角的"红包派送中"Tag[code not added] -# [+]2023-02-25 59、处理用户反馈的微博国际版‘微博会员’推广CARD -# [+]2023-02-25 60、修改MITM写法,使小火箭工具能够MITM本重写的域名[后续新的重写配置也将注意此问题] -# [+]2023-03-04 61、调整boot.biz.weibo.com屏蔽策略,缩短微博应用启动时间,提高用户使用体验[或在本地添加分流host,boot.biz.weibo.com,reject(Anti已包含)] -# [+]2023-03-09 62、微博在未登录状态下,新增对首页[关注]与[热门]信息流广告的处理 -# [+]2023-03-31 63、修复微博开屏广告屏蔽失效的bug -# [+]2023-04-02 64、去除微博超话[广场]tab页面顶部广告推送以及搜索框下方的“我的热搜”内容 -# [+]2023-04-11 65、移除视频20s预览的限制 - -hostname = api.weibo.*, *.api.weibo.*, mapi.weibo.*, *.uve.weibo.com, new.vip.weibo.cn, boot.biz.weibo.com - - -# > 微博_请手动添加以下分流至本地@ddgksf2013 -; host, sdkapp.uve.weibo.com, direct - - - -# > 微博_未登陆状态下首页信息流处理@ddgksf2013 -^https?:\/\/api\.weibo\.cn\/\d\/\w{5}\/(statuses_unread_hot_timeline|timeline) url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -# > 微博_每日一次的开屏广告请求@ddgksf2013 -^https?:\/\/boot.*weibo\.com\/v\d\/ad\/realtime url reject-200 -# > 微博_视频信息处理@ddgksf2013 -^https?:\/\/api\.weibo\.cn\/\d\/video\/tiny_stream_mid_detail url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -# > 微博_去除底部超话栏表层浮icon及tips@ddgksf2013 -^https?:\/\/api\.weibo\.cn\/\d\/!\/huati\/discovery_home_bottom_getdotinfo url reject-dict -# > 微博_屏蔽首页左上角每日的弹窗tips@ddgksf2013 -^https?:\/\/m?api\.weibo\.c(n|om)\/\d/push/daily url reject-dict -# > 微博_屏蔽发现页面搜索框热词@ddgksf2013 -^https?:\/\/m?api\.weibo\.c(n|om)\/\d\/\w{5}\/cardlist url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -# > 微博_应用内弹窗广告@ddgksf2013 -^https?:\/\/(preload-click|preload-impression)\.uve\.weibo\.com\/(interface\/wbpullad\/wbpullad_click\.php|wbapplua\/get_wbpullad_log\.lua) url reject -# > 微博_屏蔽sdkconfig请求@ddgksf2013 -^https?:\/\/sdkapp\.uve\.weibo\.com\/interface\/sdk\/sdkconfig\.php url reject -# > 微博_Spotlight@ddgksf2013 -^https?:\/\/m?api\.weibo\.c(n|om)\/\d\/hot\/hours_spotlight url reject-dict -# > 微博_自定义tab皮肤@zmqcherish -^https://api.weibo.cn/2/!/client/light_skin url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -# > 微博_非会员设置tab皮肤@zmqcherish -^https://new.vip.weibo.cn/littleskin/preview url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -# > 微博_去广告以及去除各部分推广模块@zmqcherish,@ddgksf2013 -^https?:\/\/m?api\.weibo\.c(n|om)\/\d\/(searchall|page\?|messageflow) url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -^https?:\/\/m?api\.weibo\.c(n|om)\/\d\/statuses/(unread_)?friends(/|_)timeline url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -^https?:\/\/m?api\.weibo\.c(n|om)\/\d\/groups/timeline url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -^https?:\/\/m?api\.weibo\.c(n|om)\/\d\/statuses/(container_timeline|unread_hot_timeline|extend|video_mixtimeline|unread_topic_timeline) url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -^https?:\/\/m?api\.weibo\.c(n|om)\/\d\/profile/(me|container_timeline) url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -^https?:\/\/m?api\.weibo\.c(n|om)\/\d\/video/(community_tab|remind_info|tiny_stream_video_list) url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -^https?:\/\/m?api\.weibo\.c(n|om)\/\d\/search/(finder|container_timeline|container_discover) url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -^https?:\/\/m?api\.weibo\.c(n|om)\/\d\/(checkin/show|\!/live/media_homelist|comments/build_comments|container/get_item) url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -^https?:\/\/m?api\.weibo\.c(n|om)\/\d\/cardlist url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -# > 微博国际版_屏蔽hotsearch@ddgksf2013 -^https?:\/\/weibointl\.api\.weibo\.c(n|om)\/portal\.php\?a=hot_search_users url reject-dict -# > 微博国际版_屏蔽热推荐@ddgksf2013 -^https?:\/\/m?api\.weibo\.c(n|om)\/\d\/ad\/weibointl\? url reject-dict -# > 微博国际版_屏蔽searching_info@shiro -^https?:\/\/weibointl\.api\.weibo\.c(n|om)\/portal\.php.*user&a=get_searching_info url echo-response text/html echo-response https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo_search_info.json -# > 微博国际版_屏蔽search_topic@shiro -^https?:\/\/weibointl\.api\.weibo\.c(n|om)\/portal\.php.*feed&a=search_topic url echo-response text/html echo-response https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo_search_topic.json -# > 微博国际版_屏蔽开屏广告@ddgksf2013 -^https?:\/\/weibointl\.api\.weibo\.c(n|om)\/portal\.php.*get_coopen_ads url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -# > 微博国际版_屏蔽sdkad@ddgksf2013 -^https?://(sdk|wb)app\.uve\.weibo\.com(/interface/sdk/sdkad.php|/wbapplua/wbpullad.lua) url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -# > 微博国际版_趋势顶部Card去广告@ddgksf2013 -^https?:\/\/weibointl\.api\.weibo\.c(n|om)\/portal\.php.*feed&a=trends url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -# > 微博国际版_屏蔽用户VIP栏@ddgksf2013 -^https?:\/\/weibointl\.api\.weibo\.cn\/portal\.php\?a=user_center url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js -# > 微博国际版_热搜处理@ddgksf2013 -^https?:\/\/weibointl\.api\.weibo\.cn\/portal\.php\?a=search_topic url script-response-body https://cdn.jsdelivr.net/gh/sve1r/Rules-For-Quantumult-X@develop/Scripts/AdBlock/Weibo/weibo.min.js \ No newline at end of file diff --git a/Scripts/AdBlock/Weibo/weibo.js b/Scripts/AdBlock/Weibo/weibo.js index 0b08ec8..cba6b8a 100644 --- a/Scripts/AdBlock/Weibo/weibo.js +++ b/Scripts/AdBlock/Weibo/weibo.js @@ -2,7 +2,7 @@ > 应用名称:墨鱼自用微博&微博国际版净化脚本 > 脚本作者:@ddgksf2013, @Zmqcherish > 微信账号:墨鱼手记 -> 更新时间:2022-04-11 +> 更新时间:2022-04-27 > 通知频道:https://t.me/ddgksf2021 > 贡献投稿:https://t.me/ddgksf2013_bot > 原作者库:https://github.com/zmqcherish @@ -12,7 +12,7 @@ > 脚本声明:若有侵犯原作者权利,请邮箱联系删除 ***********************************************/ -const version = "V2.0.107"; +const version = "V2.0.112"; const mainConfig = { isDebug: !1, @@ -104,6 +104,7 @@ const mainConfig = { "a=get_coopen_ads": "removeIntlOpenAds", "php?a=search_topic": "removeSearchTopic", "v1/ad/realtime": "removeRealtimeAd", + "v1/ad/preload": "removeAdPreload", }; function getModifyMethod(e) { for (let t of modifyCardsUrls) if (e.indexOf(t) > -1) return "removeCards"; @@ -115,6 +116,16 @@ function getModifyMethod(e) { function removeRealtimeAd(e) { return delete e.ads, (e.code = 4016), e; } +function removeAdPreload(e) { + if (!e.ads) return e; + for (let t of ((e.last_ad_show_interval = 86400), e.ads)) + (t.start_time = 2681574400), + (t.end_time = 2681660799), + (t.display_duration = 0), + (t.daily_display_cnt = 0), + (t.total_display_cnt = 0); + return e; +} function removeIntlOpenAds(e) { return ( e.data && @@ -176,7 +187,8 @@ function removeMainTab(e) { let t = []; for (let o of e.items) isAd(o.data) || - (o.data?.common_struct && delete o.data.common_struct, + (o.data?.page_info?.video_limit && delete o.data.page_info.video_limit, + o.data?.common_struct && delete o.data.common_struct, o.category ? "group" != o.category ? t.push(o) @@ -218,7 +230,11 @@ function removeMain(e) { )), t.push(o); } - } else -1 == [202, 200].indexOf(o.data.card_type) && t.push(o); + } else { + if (o.data?.card_type && [202, 200].indexOf(o.data.card_type) > -1) + continue; + t.push(o); + } return (e.items = t), log("removeMain success"), e; } function topicHandler(e) { @@ -332,11 +348,9 @@ function removeCards(e) { if ((e.hotwords && (e.hotwords = []), !e.cards)) return; let t = []; for (let o of e.cards) { - if ( - e.cardlistInfo?.page_type == "08" && - (17 == o.card_type || 58 == o.card_type || 11 == o.card_type) - ) - continue; + e.cardlistInfo?.containerid == "232082type=1" && + (17 == o.card_type || 58 == o.card_type || 11 == o.card_type) && + (o = { card_type: o.card_type + 1 }); let i = o.card_group; if (i && i.length > 0) { let a = []; diff --git a/Scripts/AdBlock/Weibo/weibo.min.js b/Scripts/AdBlock/Weibo/weibo.min.js index 99d25af..aaa9161 100644 --- a/Scripts/AdBlock/Weibo/weibo.min.js +++ b/Scripts/AdBlock/Weibo/weibo.min.js @@ -1,4 +1,5 @@ -const version = 'V2.0.107'; + +const version = 'V2.0.112'; -const mainConfig={isDebug:!1,author:"ddgksf2013",removeHomeVip:!0,removeHomeCreatorTask:!0,removeRelate:!0,removeGood:!0,removeFollow:!0,modifyMenus:!0,removeRelateItem:!1,removeRecommendItem:!0,removeRewardItem:!0,removeLiveMedia:!0,removeNextVideo:!1,removePinedTrending:!0,removeInterestFriendInTopic:!1,removeInterestTopic:!1,removeInterestUser:!0,removeLvZhou:!0,removeSearchWindow:!0,profileSkin1:null,profileSkin2:null,tabIconVersion:0,tabIconPath:""},itemMenusConfig={creator_task:!1,mblog_menus_custom:!1,mblog_menus_video_later:!0,mblog_menus_comment_manager:!0,mblog_menus_avatar_widget:!1,mblog_menus_card_bg:!1,mblog_menus_long_picture:!0,mblog_menus_delete:!0,mblog_menus_edit:!0,mblog_menus_edit_history:!0,mblog_menus_edit_video:!0,mblog_menus_sticking:!0,mblog_menus_open_reward:!0,mblog_menus_novelty:!1,mblog_menus_favorite:!0,mblog_menus_promote:!0,mblog_menus_modify_visible:!0,mblog_menus_copy_url:!0,mblog_menus_follow:!0,mblog_menus_video_feedback:!0,mblog_menus_shield:!0,mblog_menus_report:!0,mblog_menus_apeal:!0,mblog_menus_home:!0},modifyCardsUrls=["/cardlist","video/community_tab","/searchall"],modifyStatusesUrls=["statuses/friends/timeline","statuses_unread_hot_timeline","statuses/unread_friends_timeline","statuses/unread_hot_timeline","groups/timeline","statuses/friends_timeline"],otherUrls={"/profile/me":"removeHome","/statuses/extend":"itemExtendHandler","/video/remind_info":"removeVideoRemind","/checkin/show":"removeCheckin","/live/media_homelist":"removeMediaHomelist","/comments/build_comments":"removeComments","/container/get_item":"containerHandler","/profile/container_timeline":"userHandler","/video/tiny_stream_video_list":"nextVideoHandler","/2/statuses/video_mixtimeline":"nextVideoHandler","video/tiny_stream_mid_detail":"nextVideoHandler","/!/client/light_skin":"tabSkinHandler","/littleskin/preview":"skinPreviewHandler","/search/finder":"removeSearchMain","/search/container_timeline":"removeSearch","/search/container_discover":"removeSearch","/2/messageflow":"removeMsgAd","/2/page?":"removePage","/statuses/unread_topic_timeline":"topicHandler","/square&pageDataType/":"squareHandler","/statuses/container_timeline_topic":"removeMain","/statuses/container_timeline":"removeMainTab","wbapplua/wbpullad.lua":"removeLuaScreenAds","interface/sdk/sdkad.php":"removePhpScreenAds","ct=feed&a=trends":"removeTopics",user_center:"modifiedUserCenter","a=get_coopen_ads":"removeIntlOpenAds","php?a=search_topic":"removeSearchTopic","v1/ad/realtime":"removeRealtimeAd"};function getModifyMethod(e){for(let t of modifyCardsUrls)if(e.indexOf(t)>-1)return"removeCards";for(let o of modifyStatusesUrls)if(e.indexOf(o)>-1)return"removeTimeLine";for(let[i,a]of Object.entries(otherUrls))if(e.indexOf(i)>-1)return a;return null}function removeRealtimeAd(e){return delete e.ads,e.code=4016,e}function removeIntlOpenAds(e){return e.data&&0!==e.data.length&&(e.data.ad_list=[],e.data.gdt_video_ad_ios=[],e.data.display_ad=0,e.data.ad_ios_id=null,e.data.app_ad_ios_id=null,e.data.reserve_ad_ios_id="",e.data.reserve_app_ad_ios_id="",e.data.ad_duration=604800,e.data.ad_cd_interval=604800,e.data.pic_ad=[]),e}function removeSearchTopic(e){return e.data&&0!==e.data.length&&(e.data=Object.values(e.data).filter(e=>"searchtop"!=e.type)),e}function modifiedUserCenter(e){return e.data&&0!==e.data.length&&e.data.cards&&(e.data.cards=Object.values(e.data.cards).filter(e=>"personal_vip"!=e.items[0].type)),e}function removeTopics(e){return e.data&&(e.data.order=["search_topic","native_content"]),e}function isAd(e){return!!e&&("广告"==e.mblogtypename||"热推"==e.mblogtypename||e.promotion?.type=="ad"||e.page_info?.actionlog?.source=="ad"||e.content_auth_info?.content_auth_title=="广告")}function squareHandler(e){return e.items,e}function removeMainTab(e){if(e.loadedInfo&&e.loadedInfo.headers&&delete e.loadedInfo.headers,!e.items)return e;let t=[];for(let o of e.items)isAd(o.data)||(o.data?.common_struct&&delete o.data.common_struct,o.category?"group"!=o.category?t.push(o):-1!=JSON.stringify(o.items).indexOf("profile_top")&&t.push(o):t.push(o));return e.items=t,log("removeMainTab success"),e}function removeMain(e){if(e.loadedInfo&&e.loadedInfo.headers&&delete e.loadedInfo.headers,!e.items)return e;let t=[];for(let o of e.items)if("feed"==o.category)isAd(o.data)||t.push(o);else if("group"==o.category){if(o.items.length>0&&o.items[0].data?.itemid?.includes("search_input"))o.items=o.items.filter(e=>e?.data?.itemid?.includes("mine_topics")||e?.data?.itemid?.includes("search_input")||e?.data?.card_type==202),o.items[0].data.hotwords=[{word:"搜索超话",tip:""}],t.push(o);else{if(o.items.length>0&&o.items[0].data?.itemid?.includes("top_title"))continue;o.items.length>0&&(o.items=Object.values(o.items).filter(e=>"feed"==e.category||"card"==e.category)),t.push(o)}}else -1==[202,200].indexOf(o.data.card_type)&&t.push(o);return e.items=t,log("removeMain success"),e}function topicHandler(e){let t=e.cards;if(!t||!mainConfig.removeUnfollowTopic&&!mainConfig.removeUnusedPart)return e;let o=[];for(let i of t){let a=!0;if(i.mblog){let r=i.mblog.buttons;mainConfig.removeUnfollowTopic&&r&&"follow"==r[0].type&&(a=!1)}else{if(!mainConfig.removeUnusedPart)continue;if("bottom_mix_activity"==i.itemid)a=!1;else if(i?.top?.title=="正在活跃")a=!1;else if(200==i.card_type&&i.group)a=!1;else{let n=i.card_group;if(!n)continue;if(["guess_like_title","cats_top_title","chaohua_home_readpost_samecity_title"].indexOf(n[0].itemid)>-1)a=!1;else if(n.length>1){let d=[];for(let s of n)-1==["chaohua_discovery_banner_1","bottom_mix_activity"].indexOf(s.itemid)&&d.push(s);i.card_group=d}}}a&&o.push(i)}return e.cards=o,log("topicHandler success"),e}function removeSearchMain(e){let t=e.channelInfo.channels;if(!t)return e;let o=[];for(let i of t)i.payload&&(removeSearch(i.payload),o.push(i));return e.channelInfo.channels=o,log("remove_search main success"),e}function checkSearchWindow(e){return!!mainConfig.removeSearchWindow&&"card"==e.category&&(e.data?.itemid=="finder_window"||e.data?.itemid=="more_frame"||e.data?.card_type==208||e.data?.card_type==217||e.data?.card_type==101||e.data?.card_type==19||e.data?.mblog?.page_info?.actionlog?.source?.includes("ad"))}function removeSearch(e){if(!e.items)return e;let t=[];for(let o of e.items)if("feed"==o.category)isAd(o.data)||(o.data?.page_info?.video_limit&&delete o.data.page_info.video_limit,t.push(o));else{if("group"==o.category)continue;checkSearchWindow(o)||t.push(o)}return e.items=t,e.loadedInfo&&(e.loadedInfo.searchBarContent=[],e.loadedInfo.headerBack&&(e.loadedInfo.headerBack.channelStyleMap={})),log("remove_search success"),e}function removeMsgAd(e){if(!e.messages)return;let t=[];for(let o of e.messages)!o.msg_card?.ad_tag&&t.push(o);return e.messages=t,e}function removePage(e){return removeCards(e),mainConfig.removePinedTrending&&e.cards&&e.cards.length>0&&e.cards[0].card_group&&(e.cards[0].card_group=e.cards[0].card_group.filter(e=>!(e?.actionlog?.ext?.includes("ads_word")||e?.itemid?.includes("t:51")||e?.itemid?.includes("ads_word")))),e}function removeCards(e){if(e.hotwords&&(e.hotwords=[]),!e.cards)return;let t=[];for(let o of e.cards){if(e.cardlistInfo?.page_type=="08"&&(17==o.card_type||58==o.card_type||11==o.card_type))continue;let i=o.card_group;if(i&&i.length>0){let a=[];for(let r of i)118==r.card_type||isAd(r.mblog)||-1!=JSON.stringify(r).indexOf("res_from:ads")||a.push(r);o.card_group=a,t.push(o)}else{let n=o.card_type;if([9,165].indexOf(n)>-1)isAd(o.mblog)||t.push(o);else{if([1007,180].indexOf(n)>-1)continue;t.push(o)}}}e.cards=t}function lvZhouHandler(e){if(!mainConfig.removeLvZhou||!e)return;let t=e.common_struct;if(!t)return;let o=[];for(let i of t)"绿洲"!=i.name&&o.push(i);e.common_struct=o}function isBlock(e){let t=mainConfig.blockIds||[];if(0===t.length)return!1;let o=e.user.id;for(let i of t)if(i==o)return!0;return!1}function removeTimeLine(e){for(let t of["ad","advertises","trends","headers"])e[t]&&delete e[t];if(!e.statuses)return;let o=[];for(let i of e.statuses)isAd(i)||(lvZhouHandler(i),i.common_struct&&delete i.common_struct,i.category?"group"!=i.category&&o.push(i):o.push(i));e.statuses=o}function removeHomeVip(e){return e.header&&e.header.vipView&&(e.header.vipView=null),e}function removeVideoRemind(e){e.bubble_dismiss_time=0,e.exist_remind=!1,e.image_dismiss_time=0,e.image="",e.tag_image_english="",e.tag_image_english_dark="",e.tag_image_normal="",e.tag_image_normal_dark=""}function itemExtendHandler(e){if((mainConfig.removeRelate||mainConfig.removeGood)&&e.trend&&e.trend.titles){let t=e.trend.titles.title;mainConfig.removeRelate&&"相关推荐"===t?delete e.trend:mainConfig.removeGood&&"博主好物种草"===t&&delete e.trend}mainConfig.removeFollow&&e.follow_data&&(e.follow_data=null),mainConfig.removeRewardItem&&e.reward_info&&(e.reward_info=null),e.page_alerts&&(e.page_alerts=null);try{e.trend.extra_struct.extBtnInfo.btn_picurl.indexOf("timeline_icon_ad_delete")>-1&&delete e.trend}catch(o){}if(mainConfig.modifyMenus&&e.custom_action_list){let i=[];for(let a of e.custom_action_list){let r=a.type,n=itemMenusConfig[r];void 0===n?i.push(a):"mblog_menus_copy_url"===r?i.unshift(a):n&&i.push(a)}e.custom_action_list=i}}function updateFollowOrder(e){try{for(let t of e.items)if("mainnums_friends"===t.itemId){let o=t.click.modules[0].scheme;t.click.modules[0].scheme=o.replace("231093_-_selfrecomm","231093_-_selffollowed"),log("updateFollowOrder success");return}}catch(i){console.log("updateFollowOrder fail")}}function updateProfileSkin(e,t){try{let o=mainConfig[t];if(!o)return;let i=0;for(let a of e.items)if(a.image)try{dm=a.image.style.darkMode,"alpha"!=dm&&(a.image.style.darkMode="alpha"),a.image.iconUrl=o[i++],a.dot&&(a.dot=[])}catch(r){}log("updateProfileSkin success")}catch(n){console.log("updateProfileSkin fail")}}function removeHome(e){if(!e.items)return e;let t=[];for(let o of e.items){let i=o.itemId;if("profileme_mine"==i)mainConfig.removeHomeVip&&(o=removeHomeVip(o)),o.header?.vipIcon&&delete o.header.vipIcon,updateFollowOrder(o),t.push(o);else if("100505_-_top8"==i)updateProfileSkin(o,"profileSkin1"),t.push(o);else if("100505_-_newcreator"==i)"grid"==o.type?(updateProfileSkin(o,"profileSkin2"),t.push(o)):mainConfig.removeHomeCreatorTask||t.push(o);else{if("100505_-_chaohua"!=i&&"100505_-_manage"!=i&&"100505_-_recentlyuser"!=i)continue;o.images?.length>0&&(o.images=o.images.filter(e=>"100505_-_chaohua"==e.itemId||"100505_-_recentlyuser"==e.itemId)),t.push(o)}}return e.items=t,e}function removeCheckin(e){log("remove tab1签到"),e.show=0}function removeMediaHomelist(e){mainConfig.removeLiveMedia&&(log("remove 首页直播"),e.data={})}function removeComments(e){let t=["广告","廣告","相关内容","推荐","热推","推薦"],o=e.datas||[];if(0===o.length)return;let i=[];for(let a of o){let r=a.adType||"";-1==t.indexOf(r)&&6!=a.type&&i.push(a)}log("remove 评论区相关和推荐内容"),e.datas=i}function containerHandler(e){mainConfig.removeInterestFriendInTopic&&"超话里的好友"===e.card_type_name&&(log("remove 超话里的好友"),e.card_group=[]),mainConfig.removeInterestTopic&&e.itemid&&(e.itemid.indexOf("infeed_may_interest_in")>-1?(log("remove 感兴趣的超话"),e.card_group=[]):e.itemid.indexOf("infeed_friends_recommend")>-1&&(log("remove 超话好友关注"),e.card_group=[]))}function userHandler(e){if(e=removeMainTab(e),!mainConfig.removeInterestUser||!e.items)return e;let t=[];for(let o of e.items){let i=!0;if("group"==o.category)try{"可能感兴趣的人"==o.items[0].data.desc&&(i=!1)}catch(a){}i&&(o.data?.common_struct&&delete o.data.common_struct,t.push(o))}return e.items=t,log("removeMain sub success"),e}function nextVideoHandler(e){if(!e.statuses)return e;let t=[];for(let o of e.statuses)if(!isAd(o)){let i=["forward_redpacket_info","shopping","float_info","tags"];for(let a of i)o.video_info?.[a]&&delete o.video_info[a];t.push(o)}return e.statuses=t,log("removeMainTab Success"),e}function tabSkinHandler(e){try{let t=mainConfig.tabIconVersion;if(e.data.canUse=1,!t||!mainConfig.tabIconPath||t<100)return;let o=e.data.list;for(let i of o)i.version=t,i.downloadlink=mainConfig.tabIconPath;log("tabSkinHandler success")}catch(a){log("tabSkinHandler fail")}}function skinPreviewHandler(e){e.data.skin_info.status=1}function removeLuaScreenAds(e){if(!e.cached_ad)return e;for(let t of e.cached_ad.ads)t.start_date=1893254400,t.show_count=0,t.duration=0,t.end_date=1893340799;return e}function removePhpScreenAds(e){if(!e.ads)return e;for(let t of(e.show_push_splash_ad=!1,e.background_delay_display_time=0,e.lastAdShow_delay_display_time=0,e.realtime_ad_video_stall_time=0,e.realtime_ad_timeout_duration=0,e.ads))t.displaytime=0,t.displayintervel=86400,t.allowdaydisplaynum=0,t.displaynum=0,t.displaytime=1,t.begintime="2029-12-30 00:00:00",t.endtime="2029-12-30 23:59:59";return e}function log(e){mainConfig.isDebug&&console.log(e)}var body=$response.body,url=$request.url;let method=getModifyMethod(url);if(method){log(method);var func=eval(method);let data=JSON.parse(body.match(/\{.*\}/)[0]);new func(data),body=JSON.stringify(data),"removePhpScreenAds"==method&&(body=JSON.stringify(data)+"OK")}$done({body}); \ No newline at end of file +const mainConfig={isDebug:!1,author:"ddgksf2013",removeHomeVip:!0,removeHomeCreatorTask:!0,removeRelate:!0,removeGood:!0,removeFollow:!0,modifyMenus:!0,removeRelateItem:!1,removeRecommendItem:!0,removeRewardItem:!0,removeLiveMedia:!0,removeNextVideo:!1,removePinedTrending:!0,removeInterestFriendInTopic:!1,removeInterestTopic:!1,removeInterestUser:!0,removeLvZhou:!0,removeSearchWindow:!0,profileSkin1:null,profileSkin2:null,tabIconVersion:0,tabIconPath:""},itemMenusConfig={creator_task:!1,mblog_menus_custom:!1,mblog_menus_video_later:!0,mblog_menus_comment_manager:!0,mblog_menus_avatar_widget:!1,mblog_menus_card_bg:!1,mblog_menus_long_picture:!0,mblog_menus_delete:!0,mblog_menus_edit:!0,mblog_menus_edit_history:!0,mblog_menus_edit_video:!0,mblog_menus_sticking:!0,mblog_menus_open_reward:!0,mblog_menus_novelty:!1,mblog_menus_favorite:!0,mblog_menus_promote:!0,mblog_menus_modify_visible:!0,mblog_menus_copy_url:!0,mblog_menus_follow:!0,mblog_menus_video_feedback:!0,mblog_menus_shield:!0,mblog_menus_report:!0,mblog_menus_apeal:!0,mblog_menus_home:!0},modifyCardsUrls=["/cardlist","video/community_tab","/searchall"],modifyStatusesUrls=["statuses/friends/timeline","statuses_unread_hot_timeline","statuses/unread_friends_timeline","statuses/unread_hot_timeline","groups/timeline","statuses/friends_timeline"],otherUrls={"/profile/me":"removeHome","/statuses/extend":"itemExtendHandler","/video/remind_info":"removeVideoRemind","/checkin/show":"removeCheckin","/live/media_homelist":"removeMediaHomelist","/comments/build_comments":"removeComments","/container/get_item":"containerHandler","/profile/container_timeline":"userHandler","/video/tiny_stream_video_list":"nextVideoHandler","/2/statuses/video_mixtimeline":"nextVideoHandler","video/tiny_stream_mid_detail":"nextVideoHandler","/!/client/light_skin":"tabSkinHandler","/littleskin/preview":"skinPreviewHandler","/search/finder":"removeSearchMain","/search/container_timeline":"removeSearch","/search/container_discover":"removeSearch","/2/messageflow":"removeMsgAd","/2/page?":"removePage","/statuses/unread_topic_timeline":"topicHandler","/square&pageDataType/":"squareHandler","/statuses/container_timeline_topic":"removeMain","/statuses/container_timeline":"removeMainTab","wbapplua/wbpullad.lua":"removeLuaScreenAds","interface/sdk/sdkad.php":"removePhpScreenAds","ct=feed&a=trends":"removeTopics",user_center:"modifiedUserCenter","a=get_coopen_ads":"removeIntlOpenAds","php?a=search_topic":"removeSearchTopic","v1/ad/realtime":"removeRealtimeAd","v1/ad/preload":"removeAdPreload"};function getModifyMethod(e){for(let t of modifyCardsUrls)if(e.indexOf(t)>-1)return"removeCards";for(let o of modifyStatusesUrls)if(e.indexOf(o)>-1)return"removeTimeLine";for(let[i,a]of Object.entries(otherUrls))if(e.indexOf(i)>-1)return a;return null}function removeRealtimeAd(e){return delete e.ads,e.code=4016,e}function removeAdPreload(e){if(!e.ads)return e;for(let t of(e.last_ad_show_interval=86400,e.ads))t.start_time=2681574400,t.end_time=2681660799,t.display_duration=0,t.daily_display_cnt=0,t.total_display_cnt=0;return e}function removeIntlOpenAds(e){return e.data&&0!==e.data.length&&(e.data.ad_list=[],e.data.gdt_video_ad_ios=[],e.data.display_ad=0,e.data.ad_ios_id=null,e.data.app_ad_ios_id=null,e.data.reserve_ad_ios_id="",e.data.reserve_app_ad_ios_id="",e.data.ad_duration=604800,e.data.ad_cd_interval=604800,e.data.pic_ad=[]),e}function removeSearchTopic(e){return e.data&&0!==e.data.length&&(e.data=Object.values(e.data).filter(e=>"searchtop"!=e.type)),e}function modifiedUserCenter(e){return e.data&&0!==e.data.length&&e.data.cards&&(e.data.cards=Object.values(e.data.cards).filter(e=>"personal_vip"!=e.items[0].type)),e}function removeTopics(e){return e.data&&(e.data.order=["search_topic","native_content"]),e}function isAd(e){return!!e&&("广告"==e.mblogtypename||"热推"==e.mblogtypename||e.promotion?.type=="ad"||e.page_info?.actionlog?.source=="ad"||e.content_auth_info?.content_auth_title=="广告")}function squareHandler(e){return e.items,e}function removeMainTab(e){if(e.loadedInfo&&e.loadedInfo.headers&&delete e.loadedInfo.headers,!e.items)return e;let t=[];for(let o of e.items)isAd(o.data)||(o.data?.page_info?.video_limit&&delete o.data.page_info.video_limit,o.data?.common_struct&&delete o.data.common_struct,o.category?"group"!=o.category?t.push(o):-1!=JSON.stringify(o.items).indexOf("profile_top")&&t.push(o):t.push(o));return e.items=t,log("removeMainTab success"),e}function removeMain(e){if(e.loadedInfo&&e.loadedInfo.headers&&delete e.loadedInfo.headers,!e.items)return e;let t=[];for(let o of e.items)if("feed"==o.category)isAd(o.data)||t.push(o);else if("group"==o.category){if(o.items.length>0&&o.items[0].data?.itemid?.includes("search_input"))o.items=o.items.filter(e=>e?.data?.itemid?.includes("mine_topics")||e?.data?.itemid?.includes("search_input")||e?.data?.card_type==202),o.items[0].data.hotwords=[{word:"搜索超话",tip:""}],t.push(o);else{if(o.items.length>0&&o.items[0].data?.itemid?.includes("top_title"))continue;o.items.length>0&&(o.items=Object.values(o.items).filter(e=>"feed"==e.category||"card"==e.category)),t.push(o)}}else{if(o.data?.card_type&&[202,200].indexOf(o.data.card_type)>-1)continue;t.push(o)}return e.items=t,log("removeMain success"),e}function topicHandler(e){let t=e.cards;if(!t||!mainConfig.removeUnfollowTopic&&!mainConfig.removeUnusedPart)return e;let o=[];for(let i of t){let a=!0;if(i.mblog){let r=i.mblog.buttons;mainConfig.removeUnfollowTopic&&r&&"follow"==r[0].type&&(a=!1)}else{if(!mainConfig.removeUnusedPart)continue;if("bottom_mix_activity"==i.itemid)a=!1;else if(i?.top?.title=="正在活跃")a=!1;else if(200==i.card_type&&i.group)a=!1;else{let n=i.card_group;if(!n)continue;if(["guess_like_title","cats_top_title","chaohua_home_readpost_samecity_title"].indexOf(n[0].itemid)>-1)a=!1;else if(n.length>1){let d=[];for(let s of n)-1==["chaohua_discovery_banner_1","bottom_mix_activity"].indexOf(s.itemid)&&d.push(s);i.card_group=d}}}a&&o.push(i)}return e.cards=o,log("topicHandler success"),e}function removeSearchMain(e){let t=e.channelInfo.channels;if(!t)return e;let o=[];for(let i of t)i.payload&&(removeSearch(i.payload),o.push(i));return e.channelInfo.channels=o,log("remove_search main success"),e}function checkSearchWindow(e){return!!mainConfig.removeSearchWindow&&"card"==e.category&&(e.data?.itemid=="finder_window"||e.data?.itemid=="more_frame"||e.data?.card_type==208||e.data?.card_type==217||e.data?.card_type==101||e.data?.card_type==19||e.data?.mblog?.page_info?.actionlog?.source?.includes("ad"))}function removeSearch(e){if(!e.items)return e;let t=[];for(let o of e.items)if("feed"==o.category)isAd(o.data)||(o.data?.page_info?.video_limit&&delete o.data.page_info.video_limit,t.push(o));else{if("group"==o.category)continue;checkSearchWindow(o)||t.push(o)}return e.items=t,e.loadedInfo&&(e.loadedInfo.searchBarContent=[],e.loadedInfo.headerBack&&(e.loadedInfo.headerBack.channelStyleMap={})),log("remove_search success"),e}function removeMsgAd(e){if(!e.messages)return;let t=[];for(let o of e.messages)!o.msg_card?.ad_tag&&t.push(o);return e.messages=t,e}function removePage(e){return removeCards(e),mainConfig.removePinedTrending&&e.cards&&e.cards.length>0&&e.cards[0].card_group&&(e.cards[0].card_group=e.cards[0].card_group.filter(e=>!(e?.actionlog?.ext?.includes("ads_word")||e?.itemid?.includes("t:51")||e?.itemid?.includes("ads_word")))),e}function removeCards(e){if(e.hotwords&&(e.hotwords=[]),!e.cards)return;let t=[];for(let o of e.cards){e.cardlistInfo?.containerid=="232082type=1"&&(17==o.card_type||58==o.card_type||11==o.card_type)&&(o={card_type:o.card_type+1});let i=o.card_group;if(i&&i.length>0){let a=[];for(let r of i)118==r.card_type||isAd(r.mblog)||-1!=JSON.stringify(r).indexOf("res_from:ads")||a.push(r);o.card_group=a,t.push(o)}else{let n=o.card_type;if([9,165].indexOf(n)>-1)isAd(o.mblog)||t.push(o);else{if([1007,180].indexOf(n)>-1)continue;t.push(o)}}}e.cards=t}function lvZhouHandler(e){if(!mainConfig.removeLvZhou||!e)return;let t=e.common_struct;if(!t)return;let o=[];for(let i of t)"绿洲"!=i.name&&o.push(i);e.common_struct=o}function isBlock(e){let t=mainConfig.blockIds||[];if(0===t.length)return!1;let o=e.user.id;for(let i of t)if(i==o)return!0;return!1}function removeTimeLine(e){for(let t of["ad","advertises","trends","headers"])e[t]&&delete e[t];if(!e.statuses)return;let o=[];for(let i of e.statuses)isAd(i)||(lvZhouHandler(i),i.common_struct&&delete i.common_struct,i.category?"group"!=i.category&&o.push(i):o.push(i));e.statuses=o}function removeHomeVip(e){return e.header&&e.header.vipView&&(e.header.vipView=null),e}function removeVideoRemind(e){e.bubble_dismiss_time=0,e.exist_remind=!1,e.image_dismiss_time=0,e.image="",e.tag_image_english="",e.tag_image_english_dark="",e.tag_image_normal="",e.tag_image_normal_dark=""}function itemExtendHandler(e){if((mainConfig.removeRelate||mainConfig.removeGood)&&e.trend&&e.trend.titles){let t=e.trend.titles.title;mainConfig.removeRelate&&"相关推荐"===t?delete e.trend:mainConfig.removeGood&&"博主好物种草"===t&&delete e.trend}mainConfig.removeFollow&&e.follow_data&&(e.follow_data=null),mainConfig.removeRewardItem&&e.reward_info&&(e.reward_info=null),e.page_alerts&&(e.page_alerts=null);try{e.trend.extra_struct.extBtnInfo.btn_picurl.indexOf("timeline_icon_ad_delete")>-1&&delete e.trend}catch(o){}if(mainConfig.modifyMenus&&e.custom_action_list){let i=[];for(let a of e.custom_action_list){let r=a.type,n=itemMenusConfig[r];void 0===n?i.push(a):"mblog_menus_copy_url"===r?i.unshift(a):n&&i.push(a)}e.custom_action_list=i}}function updateFollowOrder(e){try{for(let t of e.items)if("mainnums_friends"===t.itemId){let o=t.click.modules[0].scheme;t.click.modules[0].scheme=o.replace("231093_-_selfrecomm","231093_-_selffollowed"),log("updateFollowOrder success");return}}catch(i){console.log("updateFollowOrder fail")}}function updateProfileSkin(e,t){try{let o=mainConfig[t];if(!o)return;let i=0;for(let a of e.items)if(a.image)try{dm=a.image.style.darkMode,"alpha"!=dm&&(a.image.style.darkMode="alpha"),a.image.iconUrl=o[i++],a.dot&&(a.dot=[])}catch(r){}log("updateProfileSkin success")}catch(n){console.log("updateProfileSkin fail")}}function removeHome(e){if(!e.items)return e;let t=[];for(let o of e.items){let i=o.itemId;if("profileme_mine"==i)mainConfig.removeHomeVip&&(o=removeHomeVip(o)),o.header?.vipIcon&&delete o.header.vipIcon,updateFollowOrder(o),t.push(o);else if("100505_-_top8"==i)updateProfileSkin(o,"profileSkin1"),t.push(o);else if("100505_-_newcreator"==i)"grid"==o.type?(updateProfileSkin(o,"profileSkin2"),t.push(o)):mainConfig.removeHomeCreatorTask||t.push(o);else{if("100505_-_chaohua"!=i&&"100505_-_manage"!=i&&"100505_-_recentlyuser"!=i)continue;o.images?.length>0&&(o.images=o.images.filter(e=>"100505_-_chaohua"==e.itemId||"100505_-_recentlyuser"==e.itemId)),t.push(o)}}return e.items=t,e}function removeCheckin(e){log("remove tab1签到"),e.show=0}function removeMediaHomelist(e){mainConfig.removeLiveMedia&&(log("remove 首页直播"),e.data={})}function removeComments(e){let t=["广告","廣告","相关内容","推荐","热推","推薦"],o=e.datas||[];if(0===o.length)return;let i=[];for(let a of o){let r=a.adType||"";-1==t.indexOf(r)&&6!=a.type&&i.push(a)}log("remove 评论区相关和推荐内容"),e.datas=i}function containerHandler(e){mainConfig.removeInterestFriendInTopic&&"超话里的好友"===e.card_type_name&&(log("remove 超话里的好友"),e.card_group=[]),mainConfig.removeInterestTopic&&e.itemid&&(e.itemid.indexOf("infeed_may_interest_in")>-1?(log("remove 感兴趣的超话"),e.card_group=[]):e.itemid.indexOf("infeed_friends_recommend")>-1&&(log("remove 超话好友关注"),e.card_group=[]))}function userHandler(e){if(e=removeMainTab(e),!mainConfig.removeInterestUser||!e.items)return e;let t=[];for(let o of e.items){let i=!0;if("group"==o.category)try{"可能感兴趣的人"==o.items[0].data.desc&&(i=!1)}catch(a){}i&&(o.data?.common_struct&&delete o.data.common_struct,t.push(o))}return e.items=t,log("removeMain sub success"),e}function nextVideoHandler(e){if(!e.statuses)return e;let t=[];for(let o of e.statuses)if(!isAd(o)){let i=["forward_redpacket_info","shopping","float_info","tags"];for(let a of i)o.video_info?.[a]&&delete o.video_info[a];t.push(o)}return e.statuses=t,log("removeMainTab Success"),e}function tabSkinHandler(e){try{let t=mainConfig.tabIconVersion;if(e.data.canUse=1,!t||!mainConfig.tabIconPath||t<100)return;let o=e.data.list;for(let i of o)i.version=t,i.downloadlink=mainConfig.tabIconPath;log("tabSkinHandler success")}catch(a){log("tabSkinHandler fail")}}function skinPreviewHandler(e){e.data.skin_info.status=1}function removeLuaScreenAds(e){if(!e.cached_ad)return e;for(let t of e.cached_ad.ads)t.start_date=1893254400,t.show_count=0,t.duration=0,t.end_date=1893340799;return e}function removePhpScreenAds(e){if(!e.ads)return e;for(let t of(e.show_push_splash_ad=!1,e.background_delay_display_time=0,e.lastAdShow_delay_display_time=0,e.realtime_ad_video_stall_time=0,e.realtime_ad_timeout_duration=0,e.ads))t.displaytime=0,t.displayintervel=86400,t.allowdaydisplaynum=0,t.displaynum=0,t.displaytime=1,t.begintime="2029-12-30 00:00:00",t.endtime="2029-12-30 23:59:59";return e}function log(e){mainConfig.isDebug&&console.log(e)}var body=$response.body,url=$request.url;let method=getModifyMethod(url);if(method){log(method);var func=eval(method);let data=JSON.parse(body.match(/\{.*\}/)[0]);new func(data),body=JSON.stringify(data),"removePhpScreenAds"==method&&(body=JSON.stringify(data)+"OK")}$done({body}); \ No newline at end of file