forked from qist/tvbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
4khdr.js
186 lines (185 loc) · 5.11 KB
/
4khdr.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
var rule = {
title:'4KHDR[磁]',
host:'https://www.4khdr.cn',
homeUrl: "/forum.php?mod=forumdisplay&fid=2&page=1",
url: '/forum.php?mod=forumdisplay&fid=2&filter=typeid&typeid=fyclass&page=fypage',
filter_url:'{{fl.class}}',
filter:{
},
searchUrl: '/search.php#searchsubmit=yes&srchtxt=**;post',
searchable:2,
quickSearch:1,
filterable:0,
headers:{
'User-Agent': 'PC_UA',
'Cookie':'http://127.0.0.1:9978/file:///tvbox/JS/lib/4khdr.txt',
},
timeout:5000,
class_name: "4K电影&4K美剧&4K华语&4K动画&4K纪录片&4K日韩印&蓝光电影&蓝光美剧&蓝光华语&蓝光动画&蓝光日韩印",
class_url:"3&8&15&6&11&4&29&31&33&32&34",
play_parse:true,
play_json:[{
re:'*',
json:{
parse:0,
jx:0
}
}],
lazy:'',
limit:6,
推荐:'ul#waterfall li;a&&title;img&&src;div.auth.cl&&Text;a&&href',
一级:'ul#waterfall li;a&&title;img&&src;div.auth.cl&&Text;a&&href',
二级:{
title:"#thead_subject&&Text",
img:"img.zoom&&src",
desc:'td[id^="postmessage_"] font&&Text',
content:'td[id^="postmessage_"] font&&Text',
tabs:`js:
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
TABS=[]
let d = pdfa(html, 'div.pcb table.t_table a');
let tabsa = [];
let tabsq = [];
let tabsm = false;
let tabse = false;
d.forEach(function(it) {
let burl = pdfh(it, 'a&&href');
if (burl.startsWith("https://www.aliyundrive.com/s/") || burl.startsWith("https://www.alipan.com/s/")){
tabsa.push("阿里雲盤");
}else if (burl.startsWith("https://pan.quark.cn/s/")){
tabsq.push("夸克網盤");
}else if (burl.startsWith("magnet")){
tabsm = true;
}else if (burl.startsWith("ed2k")){
tabse = true;
}
});
if (tabsm === true){
TABS.push("磁力");
}
if (tabse === true){
TABS.push("電驢");
}
if (false && tabsa.length + tabsq.length > 1){
TABS.push("選擇右側綫路");
}
let tmpIndex;
tmpIndex=1;
tabsa.forEach(function(it){
TABS.push(it + tmpIndex);
tmpIndex = tmpIndex + 1;
});
tmpIndex=1;
tabsq.forEach(function(it){
TABS.push(it + tmpIndex);
tmpIndex = tmpIndex + 1;
});
log('4khdr TABS >>>>>>>>>>>>>>>>>>' + TABS);
`,
lists:`js:
log(TABS);
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
LISTS = [];
let d = pdfa(html, 'div.pcb table.t_table a');
let lista = [];
let listq = [];
let listm = [];
let liste = [];
d.forEach(function(it){
let burl = pdfh(it, 'a&&href');
let title = pdfh(it, 'a&&Text');
log('4khdr title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
log('4khdr burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
let loopresult = title + '$' + burl;
if (burl.startsWith("https://www.aliyundrive.com/s/") || burl.startsWith("https://www.alipan.com/s/")){
if (true){
if (TABS.length==1){
burl = "http://127.0.0.1:9978/proxy?do=ali&type=push&confirm=0&url=" + encodeURIComponent(burl);
}else{
burl = "http://127.0.0.1:9978/proxy?do=ali&type=push&url=" + encodeURIComponent(burl);
}
}else{
burl = 'push://' + burl;
}
loopresult = title + '$' + burl;
lista.push(loopresult);
}else if (burl.startsWith("https://pan.quark.cn/s/")){
if (true){
if (TABS.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;
}
loopresult = title + '$' + burl;
listq.push(loopresult);
}else if (burl.startsWith("magnet")){
listm.push(loopresult);
}else if (burl.startsWith("ed2k")){
liste.push(loopresult);
}
});
if (listm.length>0){
LISTS.push(listm);
}
if (liste.length>0){
LISTS.push(liste);
}
if (false && lista.length + listq.length > 1){
LISTS.push(["選擇右側綫路,或3秒後自動跳過$http://127.0.0.1:10079/delay/"]);
}
lista.forEach(function(it){
LISTS.push([it]);
});
listq.forEach(function(it){
LISTS.push([it]);
});
`,
},
搜索:`js:
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
if (rule_fetch_params.headers.Cookie.startsWith("http")){
rule_fetch_params.headers.Cookie=fetch(rule_fetch_params.headers.Cookie);
let cookie = rule_fetch_params.headers.Cookie;
setItem(RULE_CK, cookie);
};
log('4khdr search cookie>>>>>>>>>>>>>>>' + rule_fetch_params.headers.Cookie);
let new_host= HOST + '/search.php';
let new_html=request(new_host);
let formhash = pdfh(new_html, 'input[name="formhash"]&&value');
log("4khdr formhash>>>>>>>>>>>>>>>" + formhash);
let params = 'formhash=' + formhash + '&searchsubmit=yes&srchtxt=' + encodeURIComponent(KEY);
let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
let postData = {
body: params
};
Object.assign(_fetch_params, postData);
log("4khdr search postData>>>>>>>>>>>>>>>" + JSON.stringify(_fetch_params));
let search_html = post( HOST + '/search.php?mod=forum', _fetch_params)
//log("4khdr search result>>>>>>>>>>>>>>>" + search_html);
let d=[];
let dlist = pdfa(search_html, 'div#threadlist ul li');
dlist.forEach(function(it){
let title = pdfh(it, 'h3&&Text');
if (searchObj.quick === true){
if (title.includes(KEY)){
title = KEY;
}
}
let img = "";
let content = pdfh(it, 'p:eq(2)&&Text');
let desc = pdfh(it, 'p:eq(3)&&Text');
let url = pd(it, 'a&&href', HOST);
d.push({
title:title,
img:img,
content:content,
desc:desc,
url:url
})
});
setResult(d);
`,
}