forked from qist/tvbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aipanso.js
126 lines (122 loc) · 3.17 KB
/
aipanso.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
var rule = {
title:'爱盘搜[夸]',
host:'https://aipanso.com',
homeUrl:'/',
url: '/forum-fyclass-fypage.html?',
filter_url:'{{fl.class}}',
filter:{
},
searchUrl: '/search?page=fypage&s=1&t=-1&k=**',
searchable:2,
quickSearch:0,
filterable:0,
headers:{
'User-Agent': PC_UA,
'Accept': '*/*',
'Referer': 'https://aipanso.com/'
},
timeout:5000,
class_name:'',
class_url:'',
play_parse:true,
play_json:[{
re:'*',
json:{
parse:0,
jx:0
}
}],
lazy:'',
limit:6,
推荐:'',
一级:'',
二级:{
title:"van-row h3&&Text",
img:"",
desc:"van-row h3&&Text",
content:"van-row h3&&Text",
tabs:`js:
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
TABS=[]
TABS.push("夸克網盤");
log('meijumi TABS >>>>>>>>>>>>>>>>>>' + TABS);
`,
lists:`js:
log(TABS);
LISTS=[];
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
let requestHeaders = {
withHeaders: true,
redirect: 0,
headers:{
Referer: MY_URL
}
};
let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
Object.assign(_fetch_params, requestHeaders);
let new_html = request ( MY_URL.replace("/s/","/cv/"), _fetch_params);
let json=JSON.parse(new_html);
let redirectUrl = "";
if (json.hasOwnProperty("Location")){
redirectUrl = json["Location"];
}else if (json.hasOwnProperty("location")){
redirectUrl = json["location"];
}
let title = pdfh(html, 'van-row h3&&Text');
LISTS.push([title + '$' + 'push://' + redirectUrl]);
`,
},
搜索:`js:
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
log("aipanso enter search >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + KEY);
let withHeaders = {
withHeaders: true
};
let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
Object.assign(_fetch_params, withHeaders);
log('aipanso search params >>>>>>>>>>>>>>>>>>>>>' + JSON.stringify(_fetch_params));
let new_html=request(rule.homeUrl + 'search?page=' + MY_PAGE + '&s=1&t=-1&k=' + encodeURIComponent(KEY) , _fetch_params);
//log('aipanso search new_html >>>>>>>>>>>>>>>>>>>>>' + new_html);
let json=JSON.parse(new_html);
let setCk=Object.keys(json).find(it=>it.toLowerCase()==="set-cookie");
let cookie="";
if (typeof setCk !== "undefined"){
let d=[];
for(const key in json[setCk]){
if (typeof json[setCk][key] === "string"){
log("aipanso header setCk key>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + json[setCk][key] + " " + (typeof json[setCk][key]));
d.push(json[setCk][key].split(";")[0]);
}
}
cookie=d.join(";");
setItem(RULE_CK, cookie);
fetch_params.headers.Cookie=cookie;
rule_fetch_params.headers.Cookie=cookie;
}
log('aipanso search cookie >>>>>>>>>>>>>>>>>>>>>' + cookie);
//log('aipanso search body >>>>>>>>>>>>>>>>>>>>>' + json['body'].substring(4096));
new_html = json['body'];
let d=[];
let dlist = pdfa(new_html, 'van-row:has(>a[href^="/s/"])');
dlist.forEach(function(it){
let title = pdfh(it, 'van-card template&&Text');
if (title.includes(KEY)){
if (searchObj.quick === true){
title = KEY;
}
let img = pd(it, 'van-card&&thumb', HOST);
let content = pdfh(it, 'van-card template:eq(1)&&Text');
let desc = pdfh(it, 'van-card template:eq(1)&&Text');
let url = pd(it, 'a&&href', HOST);
d.push({
title:title,
img:img,
content:content,
desc:desc,
url:url
})
}
});
setResult(d);
`,
}