-
Notifications
You must be signed in to change notification settings - Fork 0
/
Zhihu.sgmodule
33 lines (24 loc) · 1.68 KB
/
Zhihu.sgmodule
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!name=知乎网页版
#!desc=最后更新时间 2021-10-11 18:50:10
#!system=ios
[Rule]
# https://www.v2ex.com/t/730727
# eg: https://static.zhihu.com/heifetz/main.signflow.8981b23e28b3de684698.js
# https://www.v2ex.com/t/784612
# eg: https://static.zhihu.com/heifetz/column.signflow.288f3addd8e584a7bca6.js
URL-REGEX, ^https://static\.zhihu\.com/[^/]+/(main|column)\.signflow\.[^.]+.js, REJECT
// https://github.com/blackmatrix7/ios_rule_script/issues/156
// 知乎的广告拦截,依赖于拦截 118.89.204.198:443 这个地址的请求,迫使知乎 APP 回退到以 api.zhihu.com 请求数据,才能进行 MITM 清理广告内容。
DOMAIN,118.89.204.198,REJECT
URL-REGEX,https://api\.zhihu\.com/commercial_api,REJECT
[Script]
// 首页 -> 关注
http-response ^https://api\.zhihu\.com/moments/recommend requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/zhihu/zhihu_moments_recommend.js
// 首页 -> 推荐
http-response ^https://api\.zhihu\.com/topstory/recommend requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/zhihu/zhihu_topstory_recommend.js
// 知乎某问题的页面
http-response ^https://api\.zhihu\.com/v4/questions/\d+/answers requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/zhihu/zhihu_question_answers.js
// 回答最下方的广告
http-response ^https://www\.zhihu\.com/api/v4/answers/\d+/recommendations requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/yjqiang/surge_scripts/main/scripts/zhihu/zhihu_answer.js
[MITM]
hostname = %APPEND% static.zhihu.com, api.zhihu.com, www.zhihu.com