forked from qist/tvbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkkpans.js
162 lines (157 loc) · 4.64 KB
/
kkpans.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
var rule = {
title:'KK網盤[磁]',
host:'https://www.kkpans.com',
homeUrl:'/',
url: '/forum-fyclass-fypage.html?',
//host:'http://192.168.101.1:10078',
//homeUrl:'/p/0/s/https://www.kkpans.com/',
//url: '/p/0/s/https://www.kkpans.com/forum-fyclass-fypage.html?',
filter_url:'{{fl.class}}',
filter:{
},
searchUrl: '/search',
searchable:2,
quickSearch:0,
filterable:0,
headers:{
'User-Agent': 'Mozilla/5.0 (Linux; Android 10; SM-G981B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Mobile Safari/537.36',
'Accept': '*/*',
'Referer': 'https://www.kkpans.com/'
},
timeout:5000,
class_name:'国外电影&国外电视剧&纪录片资源&综艺资源&动漫资源&音乐资源',
class_url:'39&40&41&42&46&43',
play_parse:true,
play_json:[{
re:'*',
json:{
parse:0,
jx:0
}
}],
lazy:'',
limit:6,
推荐:'',
一级:`js:
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
let d = [];
log("kkpans input>>>>>>>>>>>>>>"+input);
let html = request(input);
//log("kkpans 1level html>>>>>>>>>>>>>>"+html);
let list = pdfa(html, 'div.threadlist ul li.list');
list.forEach(function(it) {
d.push({
title: pdfh(it, 'div.threadlist_tit&&Text'),
desc: pdfh(it, 'div.threadlist_top div:has(>h3) span&&Text'),
pic_url: '',
url: pd(it, 'li.list&&a[href^="forum.php"]:eq(1)&&href', HOST)
});
})
setResult(d);
`,
二级:{
title:"div.viewthread&&div.view_tit&&Text",
img:"div.viewthread div.message&&img&&src",
desc:"div.viewthread div.message&&Text",
content:"div.viewthread div.message&&Text",
tabs:`js:
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
TABS=[]
let d = pdfa(html, 'div.viewthread div.message a[href^="https://pan.quark.cn/s/"]');
let index = 1;
if (false && d.length>1){
TABS.push("選擇右側綫路");
}
d.forEach(function(it) {
TABS.push("夸克網盤" + index);
index = index + 1;
});
log('meijumi TABS >>>>>>>>>>>>>>>>>>' + TABS);
`,
lists:`js:
log(TABS);
LISTS=[];
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
let d = pdfa(html, 'div.viewthread div.message a[href^="https://pan.quark.cn/s/"]');
let index = 1;
if (false && d.length>1){
LISTS.push(["選擇右側綫路,或3秒後自動跳過$http://127.0.0.1:10079/delay/"]);
}
d.forEach(function(it) {
let burl = pdfh(it, 'a&&href');
if (true){
if (d.length==1){
burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&confirm=0&url=" + encodeURIComponent(burl);
}else{
burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&url=" + encodeURIComponent(burl);
}
}else{
burl = "push://" + burl;
}
let title = pdfh(it, 'a&&Text');
LISTS.push([title + '$' + burl]);
});
`,
},
搜索:`js:
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
let withHeaders = {
withHeaders: true
};
let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
Object.assign(_fetch_params, withHeaders);
let new_html=request(rule.homeUrl + 'search.php?mod=forum', _fetch_params);
log('kkpans 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("kkpans header setCk key>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + json[setCk][key] + " " + (typeof json[setCk][key]));
d.push(json[setCk][key].split(";")[0]);
}
}
cookie=d.join(";");
}
fetch_params.headers.Cookie=cookie;
rule_fetch_params.headers.Cookie=cookie;
log('kkpans search cookie >>>>>>>>>>>>>>>>>>>>>' + cookie);
//log('kkpans search body >>>>>>>>>>>>>>>>>>>>>' + json['body']);
new_html = json['body'];
let formhash = pdfh(new_html, 'input[name="formhash"]&&value');
log("kkpans formhash>>>>>>>>>>>>>>>" + formhash);
let params = 'formhash=' + formhash + '&searchsubmit=yes&srchtxt=' + encodeURIComponent(KEY);
_fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
let postData = {
body: params
};
Object.assign(_fetch_params, postData);
log("kkpans search postData>>>>>>>>>>>>>>>" + JSON.stringify(_fetch_params));
let search_html = post(rule.homeUrl + 'search.php?mod=forum', _fetch_params)
//log("kkpans search result>>>>>>>>>>>>>>>" + search_html);
let d=[];
let dlist = pdfa(search_html, 'div.threadlist ul li.list');
dlist.forEach(function(it){
let title = pdfh(it, 'div.threadlist_tit&&Text');
if (searchObj.quick === true){
if (title.includes(KEY)){
title = KEY;
}
}
let img = "";
let content = pdfh(it, 'div.threadlist_top div:has(>h3) span&&Text');
let desc = pdfh(it, 'div.threadlist_top div:has(>h3) span&&Text');
let url = pd(it, 'a[href^="forum.php?mod=viewthread"]&&href', HOST);
d.push({
title:title,
img:img,
content:content,
desc:desc,
url:url
})
});
setResult(d);
`,
}