X/js/4khdr.js

187 lines
5.1 KiB
JavaScript
Raw Normal View History

2023-08-15 09:49:24 +03:00
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=[]
2023-08-29 10:08:42 +03:00
let d = pdfa(html, 'div.pcb table.t_table a');
2023-08-21 09:05:17 +03:00
let tabsa = [];
let tabsq = [];
let tabsm = false;
let tabse = false;
2023-08-15 09:49:24 +03:00
d.forEach(function(it) {
2023-08-20 03:46:42 +03:00
let burl = pdfh(it, 'a&&href');
2024-04-01 12:25:22 +03:00
if (burl.startsWith("https://www.aliyundrive.com/s/") || burl.startsWith("https://www.alipan.com/s/")){
2023-09-11 10:33:14 +03:00
tabsa.push("阿里雲盤");
2023-08-21 09:05:17 +03:00
}else if (burl.startsWith("https://pan.quark.cn/s/")){
2023-09-11 10:33:14 +03:00
tabsq.push("夸克網盤");
2023-08-21 09:05:17 +03:00
}else if (burl.startsWith("magnet")){
tabsm = true;
}else if (burl.startsWith("ed2k")){
tabse = true;
2023-08-20 03:46:42 +03:00
}
2023-08-15 09:49:24 +03:00
});
2023-08-23 07:06:48 +03:00
if (tabsm === true){
TABS.push("磁力");
}
if (tabse === true){
TABS.push("電驢");
}
2023-08-30 08:49:27 +03:00
if (false && tabsa.length + tabsq.length > 1){
2023-08-28 07:55:54 +03:00
TABS.push("選擇右側綫路");
}
2023-08-21 09:05:17 +03:00
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;
});
2023-08-15 09:49:24 +03:00
log('4khdr TABS >>>>>>>>>>>>>>>>>>' + TABS);
`,
lists:`js:
log(TABS);
pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
LISTS = [];
2023-08-29 10:08:42 +03:00
let d = pdfa(html, 'div.pcb table.t_table a');
2023-08-21 09:05:17 +03:00
let lista = [];
let listq = [];
let listm = [];
let liste = [];
2023-08-20 03:46:42 +03:00
d.forEach(function(it){
let burl = pdfh(it, 'a&&href');
2023-08-21 09:05:17 +03:00
let title = pdfh(it, 'a&&Text');
2023-08-23 07:06:48 +03:00
log('4khdr title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
log('4khdr burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
2023-08-21 09:05:17 +03:00
let loopresult = title + '$' + burl;
2024-04-01 12:25:22 +03:00
if (burl.startsWith("https://www.aliyundrive.com/s/") || burl.startsWith("https://www.alipan.com/s/")){
2023-08-30 08:49:27 +03:00
if (true){
2023-08-23 07:06:48 +03:00
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);
}
2023-08-28 07:55:54 +03:00
}else{
burl = 'push://' + burl;
}
2023-08-21 09:05:17 +03:00
loopresult = title + '$' + burl;
lista.push(loopresult);
}else if (burl.startsWith("https://pan.quark.cn/s/")){
2023-08-30 08:49:27 +03:00
if (true){
2023-08-23 07:06:48 +03:00
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);
}
2023-08-28 07:55:54 +03:00
}else{
burl = 'push://' + burl;
}
2023-08-21 09:05:17 +03:00
loopresult = title + '$' + burl;
listq.push(loopresult);
}else if (burl.startsWith("magnet")){
2023-08-20 03:46:42 +03:00
listm.push(loopresult);
2023-08-21 09:05:17 +03:00
}else if (burl.startsWith("ed2k")){
liste.push(loopresult);
2023-08-20 03:46:42 +03:00
}
2023-08-15 09:49:24 +03:00
});
2023-08-20 03:46:42 +03:00
if (listm.length>0){
LISTS.push(listm);
}
2023-08-21 09:05:17 +03:00
if (liste.length>0){
LISTS.push(liste);
}
2023-08-30 08:49:27 +03:00
if (false && lista.length + listq.length > 1){
2023-08-28 07:55:54 +03:00
LISTS.push(["選擇右側綫路或3秒後自動跳過$http://127.0.0.1:10079/delay/"]);
}
2023-08-23 07:06:48 +03:00
lista.forEach(function(it){
LISTS.push([it]);
});
listq.forEach(function(it){
LISTS.push([it]);
});
2023-08-15 09:49:24 +03:00
`,
},
搜索:`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);
2023-08-28 07:55:54 +03:00
let params = 'formhash=' + formhash + '&searchsubmit=yes&srchtxt=' + encodeURIComponent(KEY);
2023-08-15 09:49:24 +03:00
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));
2024-04-01 12:25:22 +03:00
let search_html = post( HOST + '/search.php?mod=forum', _fetch_params)
2023-08-15 09:49:24 +03:00
//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 = "";
2024-04-01 12:25:22 +03:00
let content = pdfh(it, 'p:eq(2)&&Text');
let desc = pdfh(it, 'p:eq(3)&&Text');
2023-08-15 09:49:24 +03:00
let url = pd(it, 'a&&href', HOST);
d.push({
title:title,
img:img,
content:content,
desc:desc,
url:url
})
});
setResult(d);
`,
}