forked from adsproo/txnews
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDiyidan.js
More file actions
38 lines (31 loc) · 1.26 KB
/
Diyidan.js
File metadata and controls
38 lines (31 loc) · 1.26 KB
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
34
35
36
37
38
/*
第一弹 去广告+原画 (By Miao Miao)
Surge4:
http-response ^https:\/\/api\.diyidan\.net\/v0\.3\/(user\/personal_homepage|vip_user\/info|tv_series\/index\?appChanne) requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/nzw9314/QuantumultX/master/Script/Diyidan.js
QuantumultX(远程):
^https:\/\/api\.diyidan\.net\/v0\.3\/(user\/personal_homepage|vip_user\/info|tv_series\/index\?appChanne) url script-response-body https://raw.githubusercontent.com/nzw9314/QuantumultX/master/Script/Diyidan.js
QuantumultX(本地):
^https:\/\/api\.diyidan\.net\/v0\.3\/(user\/personal_homepage|vip_user\/info|tv_series\/index\?appChanne) url script-response-body Diyidan.js
*/
let url = $request.url;
const path1 = "user/personal_homepage";
const path2 = "vip_user/info";
const path3 = "tv_series/index?appChannel";
let obj = JSON.parse($response.body);
if (url.indexOf(path1) != -1) {
// 去广告
delete obj["data"]["vipArticle"];
delete obj["data"]["bannerList"];
obj["data"]["iconList"] = obj["data"]["iconList"].filter(i => {
return ![5, 25, 27].includes(i.functionId);
});
}
if (url.indexOf(path2) != -1) {
obj["data"]["isMember"] = true;
}
if (url.indexOf(path3) != -1) {
delete obj["data"]["advertisement"];
}
$done({
body: JSON.stringify(obj)
});