- 支持自定义响应头的值, 修复翻译功能, 感谢 @forevernight7 的贡献
已收录到 LoonKissSurge Repository
- ❤️8
#!name=智慧苏州 去广告
#!desc=去开屏, 去 banner, 去瀑布流
#!category=xream
[General]
force-http-engine-hosts = %APPEND% newapp2.szsmk.com
[MITM]
hostname = %APPEND%, newapp2.szsmk.com
[Map Local]
^https?:\/\/newapp2\.szsmk\.com\/app\/config\/queryMainAd data-type=text data='{"message":"操作成功","main_ad_list":[],"code":"000000"}' header='Content-Type:application/json'
^https?:\/\/newapp2\.szsmk\.com\/app\/config\/(queryCarousel|queryRecommendation)\/ data-type=text data='{"code":"000000","message":"操作成功","list":[]}' header='Content-Type:application/json'#!name=小爱音箱 去广告
#!desc=去开屏 去 banner
#!category=xream
[General]
force-http-engine-hosts = %APPEND% info.mina.xiaoaisound.com
[MITM]
hostname = %APPEND%, info.mina.xiaoaisound.com
[Map Local]
^https?:\/\/info\.mina\.xiaoaisound\.com\/(advertise|payGuide)\/ data-type=text data='{ "code": 0, "message": "Success", "data": [] }' header='Content-Type:application/json'#!name=催眠大师 去广告
#!desc=去开屏
#!category=xream
[General]
force-http-engine-hosts = %APPEND% cmds.omesoft.com
[MITM]
hostname = %APPEND%, cmds.omesoft.com
[Body Rewrite]
http-response ^https?:\/\/cmds\.omesoft\.com\/HypnotistWS\.asmx '<GetADResult>.*?</GetADResult>' '<GetADResult>{"ret":0,"msg":"正常","err_code":0,"data":{"ad":[]}}</GetADResult>'#!name=粉象生活 去广告
#!desc=先去个开屏玩玩(JQ 版)
#!category=xream
[General]
force-http-engine-hosts = %APPEND% api.fenxianglife.com
[MITM]
hostname = %APPEND%, api.fenxianglife.com
[Body Rewrite]
http-response-jq ^https?:\/\/api\.fenxianglife\.com\/njia\/index\/popup\/v2 '.data.list = []'#!name=Reddit 去广告
#!desc=过滤推广, 关 NSFW 提示(JQ 版)
#!category=xream
[General]
force-http-engine-hosts = %APPEND% gql.reddit.com, gql-fed.reddit.com
[MITM]
hostname = %APPEND%, gql.reddit.com, gql-fed.reddit.com
[Body Rewrite]
http-response-jq ^https?:\/\/gql(-fed)?\.reddit\.com 'walk( if type == "object" then (if .isNsfw == true then .isNsfw = false else . end) | (if .isNsfwMediaBlocked == true then .isNsfwMediaBlocked = false else . end) | (if .isNsfwContentShown == false then .isNsfwContentShown = true else . end) | (if (.commentsPageAds | type == "array") then (.commentsPageAds = []) else . end) | (if ( (.node | type == "object") and (.node.cells | type == "array") and (.node.cells | any(.__typename? == "AdMetadataCell" or .isAdPost? == true)) ) then empty else . end) | (if (.node | type == "object") and (.node.adPayload | type == "object") then empty else . end) | (if .__typename == "AdPost" then empty else . end) else . end)'#!name = Reddit 去广告
#!desc = 过滤推广, 关 NSFW 提示(JQ 版)
#!openUrl = https://apps.apple.com/app/id1064216828
#!author = xream[https://github.com/xream]
#!tag = 去广告
#!system =
#!system_version =
#!loon_version = 3.2.4(769)
#!homepage = https://github.com/luestr/ProxyResource/blob/main/README.md
#!icon = https://raw.githubusercontent.com/luestr/IconResource/main/App_icon/120px/Reddit.png
#!date = 2024-10-26 03:35:00
[Rewrite]
^https?:\/\/gql(-fed)?\.reddit\.com response-body-json-jq 'walk( if type == "object" then (if .isNsfw == true then .isNsfw = false else . end) | (if .isNsfwMediaBlocked == true then .isNsfwMediaBlocked = false else . end) | (if .isNsfwContentShown == false then .isNsfwContentShown = true else . end) | (if (.commentsPageAds | type == "array") then (.commentsPageAds = []) else . end) | (if ( (.node | type == "object") and (.node.cells | type == "array") and (.node.cells | any(.__typename? == "AdMetadataCell" or .isAdPost? == true)) ) then empty else . end) | (if (.node | type == "object") and (.node.adPayload | type == "object") then empty else . end) | (if .__typename == "AdPost" then empty else . end) else . end)'
[MitM]
hostname = gql.reddit.com, gql-fed.reddit.com# > 分流修正
RULE-SET,http://script.hub/file/_start_/https://raw.githubusercontent.com/fmz200/wool_scripts/main/QuantumultX/filter/fenliuxiuzheng.list/_end_/qx_fmz200_fenliuxiuzheng.list?type=rule-set&target=surge-rule-set&x=cdn.jsdelivr.net,🇨🇳 国内
# > RuCu6
RULE-SET,http://script.hub/file/_start_/https://raw.githubusercontent.com/RuCu6/QuanX/main/Rules/MyBlockAds.list/_end_/qx_RuCu6_MyBlockAds.list?type=rule-set&target=surge-rule-set&x=mall.bilibili.com&del=true,🚫 拦截
# > fmz200 分流去广告
RULE-SET,http://script.hub/file/_start_/https://raw.githubusercontent.com/fmz200/wool_scripts/main/QuantumultX/filter/fenliu.list/_end_/qx_fmz200_fenliu.list?type=rule-set&target=surge-rule-set&x=jpush%2Bt.uc.cn%2Bapi.taobao.com%2Bai.m.taobao.com,🚫 拦截
模块#!name=Reddit
#!desc=过滤推广, 关 NSFW 提示 @xream
[General]
force-http-engine-hosts = %APPEND% gql.reddit.com, gql-fed.reddit.com
[Script]
Reddit = type=http-response,pattern=^https?:\/\/gql(-fed)?\.reddit\.com,requires-body=1,max-size=0,timeout=30,script-path=reddit.js
[MITM]
hostname = %APPEND%, gql.reddit.com, gql-fed.reddit.com
② reddit.jslet body;
try {
body = JSON.parse($response.body.replace(/"isNsfw":true/g, '"isNsfw":false'))
if (body.data?.children?.commentsPageAds) {
body.data.children.commentsPageAds = []
}
for (const [k, v] of Object.entries(body.data)) {
if (v?.elements?.edges) {
body.data[k].elements.edges = v.elements.edges.filter(
i =>
!['AdPost'].includes(i?.node?.__typename) &&
!i?.node?.cells?.some(j => j?.__typename === 'AdMetadataCell') &&
!i?.node?.adPayload
);
}
}
} catch (e) {
console.log(e);
} finally {
$done(body ? { body: JSON.stringify(body) } : {});
}#!name=Reddit
#!desc=过滤推广, 关 NSFW 提示 @xream
[General]
force-http-engine-hosts = %APPEND% gql.reddit.com, gql-fed.reddit.com
[Script]
Reddit = type=http-response,pattern=^https?:\/\/gql(-fed)?\.reddit\.com,requires-body=1,max-size=0,timeout=30,script-path=reddit.js
[MITM]
hostname = %APPEND%, gql.reddit.com, gql-fed.reddit.com
② reddit.jslet body;
try {
if (/"(isNsfw|AdPost|AdMetadataCell|adPayload)"/.test($response.body)) {
body = $response.body.replace(
/(")(isNsfw|AdPost|AdMetadataCell|adPayload)(")/gi,
'$1_$2$3'
);
}
} catch (e) {
console.log(e);
} finally {
$done(body ? { body } : {});
}
相关: 如何使用 Gist 创建私有脚本/模块