forked from gaotianliuyun/gao
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkuba.js
188 lines (186 loc) · 5.01 KB
/
kuba.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
var rule = {
title:'酷吧[磁]',
host:'https://www.kuba222.com',
homeUrl: '/',
url: '/vodtypehtml/fyclass.html?',
filter_url:'{{fl.class}}',
filter:{
},
searchUrl: '/search/**-1.html',
searchable:2,
quickSearch:0,
filterable:0,
headers:{
'User-Agent': 'PC_UA',
'Referer': 'https://www.kuba222.com/'
},
timeout:5000,
class_name: '最新&4K&电影&动作片&喜剧片&爱情片&科幻片&恐怖片&剧情片&战争片&微电影&电视剧&动漫&纪录片',
class_url: 'new&4K&1&5&6&7&8&9&10&11&21&31&4&16',
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 = [];
let html = request(input);
let list = pdfa(html, 'ul.stui-vodlist li');
list.forEach(function (it){
d.push({
title: pdfh(it, 'a&&title'),
desc: pdfh(it, 'li&&div&&a&&span&&Text'),
pic_url: pd(it, 'a&&data-original', HOST),
url: pdfh(it, 'a&&href')
});
});
setResult(d);
`,
一级:`js:
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
let d = [];
if (MY_CATE === '4K'){
let turl = (MY_PAGE === 1)? '' : '-' + MY_PAGE;
input = rule.homeUrl + 'vodtopichtml/' + '11' + turl + '.html';
}else if (MY_CATE === 'new'){
input = rule.homeUrl + MY_CATE + '.html';
}else{
let turl = (MY_PAGE === 1)? '' : '-' + MY_PAGE;
input = rule.homeUrl + 'vodtypehtml/' + MY_CATE + turl + '.html';
}
let html = request(input);
let list = pdfa(html, 'ul.stui-vodlist li');
list.forEach(function (it){
d.push({
title: pdfh(it, 'a&&title'),
desc: pdfh(it, 'li&&div&&a&&span&&Text'),
pic_url: pd(it, 'a&&data-original', HOST),
url: pdfh(it, 'a&&href')
});
});
setResult(d);
`,
二级:{
title:"div.stui-content h3&&Text",
img:"div.stui-content a.lazyload img&&src",
desc:'div.stui-content a span&&Text',
content:'div.stui-content p.data&&Text',
tabs:`js:
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
TABS=[]
let vodUrls=[];
try{
vodUrls.push(html.match(/var GvodUrls1 *= *"([^"]*)"/)[1]);
vodUrls.push(html.match(/var GvodUrls2 *= *"([^"]*)"/)[1]);
vodUrls.push(html.match(/var GvodUrls3 *= *"([^"]*)"/)[1]);
vodUrls.push(html.match(/var GvodUrls4 *= *"([^"]*)"/)[1]);
vodUrls.push(html.match(/var GvodUrls5 *= *"([^"]*)"/)[1]);
}catch(e){
}
let index=1;
vodUrls.forEach(function (it) {
TABS.push("磁力"+index);
index = index + 1;
});
log('kuba TABS >>>>>>>>>>>>>>>>>>' + TABS);
`,
lists:`js:
log(TABS);
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
LISTS = [];
let vodUrls=[];
//log("kuba html>>>>>>>>>>>>>>>>>>>>>>" + html);
try{
vodUrls.push(html.match(/var GvodUrls1 *= *"([^"]*)"/)[1]);
vodUrls.push(html.match(/var GvodUrls2 *= *"([^"]*)"/)[1]);
vodUrls.push(html.match(/var GvodUrls3 *= *"([^"]*)"/)[1]);
vodUrls.push(html.match(/var GvodUrls4 *= *"([^"]*)"/)[1]);
vodUrls.push(html.match(/var GvodUrls5 *= *"([^"]*)"/)[1]);
}catch(e){
log('kuba tabs e>>>>>>>>>>>>>>>>>>..' + e);
}
vodUrls.forEach(function (it) {
let epos = it.split("###");
let d=[];
epos.forEach(function (it1){
if (it1.length>0){
d.push(it1);
}
});
LISTS.push(d.reverse());
});
`,
},
搜索:`js:
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
let cookie="";
if (false){
let new_html=request(HOST, {withHeaders:true});
let json=JSON.parse(new_html);
let setCk=Object.keys(json).find(it=>it.toLowerCase()==="set-cookie");
if (typeof setCk !== "undefined"){
let d=[];
for(const key in json[setCk]){
if (typeof json[setCk][key] === "string"){
log("kuba 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('kuba search cookie >>>>>>>>>>>>>>>>>>>>>' + cookie);
let params = 'wd='+ encodeURIComponent(KEY) + '&submit=';
let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
let postData = {
body: params
};
Object.assign(_fetch_params, postData);
log("kuba search postData>>>>>>>>>>>>>>>" + JSON.stringify(_fetch_params));
let search_html = post( HOST + '/index.php?m=vod-search', _fetch_params)
search_html = search_html.replace(/<script>.*?<\\/script>/g,"");
//log("kuba search result>>>>>>>>>>>>>>>" + search_html.substring(4096));
let d=[];
let dlist = pdfa(search_html, 'li.activeclearfix');
log("kuba search dlist.length>>>>>>>>>>>>>" + dlist.length);
dlist.forEach(function(it){
let title = pdfh(it, 'a&&title');
let img = pd(it, 'a&&data-original', HOST);
let content = pdfh(it, 'a&&Text');
let desc = pdfh(it, 'div.detail&&Text');
let url = pd(it, 'a&&href', HOST);
d.push({
title:title,
img:img,
content:content,
desc:desc,
url:url
});
});
dlist = pdfa(search_html, 'li.active.clearfix');
log("kuba search dlist.length>>>>>>>>>>>>>" + dlist.length);
dlist.forEach(function(it){
let title = pdfh(it, 'a&&title');
let img = pd(it, 'a&&data-original', HOST);
let content = pdfh(it, 'a&&Text');
let desc = pdfh(it, 'div.detail&&Text');
let url = pd(it, 'a&&href', HOST);
d.push({
title:title,
img:img,
content:content,
desc:desc,
url:url
});
});
setResult(d);
`,
}