forked from ihaoljy/Rewrite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cutisan.js
42 lines (31 loc) · 1.04 KB
/
Cutisan.js
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
39
40
41
/*
cutisan 壁纸
[rewrite_local]
^https:\/\/cutisanapi\.imuuzi\.com\/api\/(Home\/index|Index\/index) url script-response-body https://raw.githubusercontent.com/Yu9191/Rewrite/main/Cutisan.js
[mitm]
hostname = cutisanapi.imuuzi.com
*/
var url = $request.url;
if (url.indexOf("https://cutisanapi.imuuzi.com/api/Home/index") !== -1) {
var obj = JSON.parse($response.body);
// 遍历每个数组
for (var i = 0; i < obj.data.length; i++) {
//如果是空属性
if (obj.data[i].download_url === "") {
// 用 "thumb_url" 的值来填充
obj.data[i].download_url = obj.data[i].thumb_url;
}
if (obj.data[i].open !== 1) {
obj.data[i].open = 1;
}
}
$done({body: JSON.stringify(obj)});
} else if (url.indexOf("https://cutisanapi.imuuzi.com/api/Index/index") !== -1) {
let obj = JSON.parse($response.body);
obj.data.sex = 1;
obj.data.type = 2;
obj.data.expire_time = 6707091199;
$done({body: JSON.stringify(obj)});
} else {
$done({});
}