Update SrcJuying.js

pull/1/head
jevons0411 3 years ago
parent 4332655758
commit 527abcc7b3
  1. 163
      SrcJuying.js

@ -8,82 +8,107 @@ function jiekouyiji() {
*/ */
var d = []; var d = [];
var cfgfile = "hiker://files/rules/Src/Juying/config.json"; var cfgfile = "hiker://files/rules/Src/Juying/config.json";
var Juyingcfg=fetch(cfgfile); var Juyingcfg=fetch(cfgfile);
if(Juyingcfg != ""){ if(Juyingcfg != ""){
eval("var JYconfig=" + Juyingcfg+ ";"); eval("var JYconfig=" + Juyingcfg+ ";");
}else{ }else{
var JYconfig= {}; var JYconfig= {};
} }
var filepath = "hiker://files/rules/Src/Juying/jiekou.json"; var filepath = "hiker://files/rules/Src/Juying/jiekou.json";
var datafile = fetch(filepath); var datafile = fetch(filepath);
if(datafile != ""){ if(datafile != ""){
eval("var datalist=" + datafile+ ";"); eval("var datalist=" + datafile+ ";");
}else{ }else{
var datalist = []; var datalist = [];
} }
datalist = datalist.filter(item => { datalist = datalist.filter(item => {
return item.type!="xpath" && item.type!="biubiu"; return item.type!="xpath" && item.type!="biubiu";
}) })
var api_type = "cms"; var api_type = "cms";
var api_url = "http://49.232.165.26/hi.php/provide/vod/"; var api_url = "http://49.232.165.26/hi.php/provide/vod/";
var api_ua = MOBILE_UA; var api_ua = MOBILE_UA;
var xunmitimeout = 5; var xunmitimeout = 5;
if (api_type=="v1") { if (api_type=="v1") {
let date = new Date(); let date = new Date();
let mm = date.getMonth()+1; let mm = date.getMonth()+1;
let dd = date.getDate(); let dd = date.getDate();
let key = (mm<10?"0"+mm:mm)+""+(dd<10?"0"+dd:dd); let key = (mm<10?"0"+mm:mm)+""+(dd<10?"0"+dd:dd);
var url = api_url + '/detail?&key='+key+'&vod_id=';
} else if (api_type=="app") { var typeurl = api_url + "/types";
var url = api_url + 'video_detail?id='; var listurl = api_url + '?type=' + getMyVar('SrcJuying$type_id','1') + '&page=';
} else if (api_type=="app") {
} else if (api_type=="v2") { var url = api_url + 'video_detail?id=';
var url = api_url + 'video_detail?id='; var typeurl = api_url + "/nav";
var listurl = api_url + '/video?tid=' + getMyVar('SrcJuying$type_id','1') + '&pg=';
} else if (api_type=="iptv") { } else if (api_type=="v2") {
var url = api_url + '?ac=detail&ids='; var url = api_url + 'video_detail?id=';
var typeurl = api_url + "?ac=list";
} else if (api_type=="cms") { var listurl = api_url + '?ac=videolist&t=' + getMyVar('SrcJuying$type_id','1') + '&pg=';
var url = api_url + '?ac=detail&ids='; } else if (api_type=="iptv") {
var classurl = api_url + "?ac=list"; var url = api_url + '?ac=detail&ids=';
var listurl = api_url + '?ac=videolist&pg='; var typeurl = api_url + "/?ac=flitter";
} else { var listurl = api_url + '?ac=list&class=' + getMyVar('SrcJuying$type_id','1') + '&page=';
log('api类型错误') } else if (api_type=="cms") {
} var url = api_url + '?ac=detail&ids=';
var typeurl = api_url + "?ac=list";
var listurl = api_url + '?ac=videolist&t=' + getMyVar('SrcJuying$type_id','1') + '&pg=';
} else {
log('api类型错误')
}
if(MY_PAGE==1){ if(MY_PAGE==1){
const Color = "#3399cc"; const Color = "#3399cc";
var api_class = JSON.parse(request(classurl, { headers: { 'User-Agent': api_ua }, timeout:xunmitimeout*1000 })).class; try{
if(!getMyVar('SrcJuying$api_type_id')){putMyVar('SrcJuying$api_type_id',''+api_class[0].type_id)} var typehtml = JSON.parse(request(typeurl, { headers: { 'User-Agent': api_ua }, timeout:xunmitimeout*1000 }));
let type_pids = []; if (api_type=="v1") {
for(let i in api_class){
if(type_pids.indexOf(api_class[i].type_pid)==-1){type_pids.push(api_class[i].type_pid)} } else if (api_type=="app") {
} else if (api_type=="v2") {
} else if (api_type=="iptv") {
} else if (api_type=="cms") {
var typeclass = typehtml.class;
} else {
log('api类型错误')
}
}catch(e){
log(e.message);
return "toast://访问异常,请更换接口";
} }
if(type_pids.length > 0){ if(typeclass.length>0){
type_pids.sort((a, b) => { if(!getMyVar('SrcJuying$type_id')){putMyVar('SrcJuying$type_id',''+typeclass[0].type_id)}
return a - b let type_pids = [];
}) for(let i in typeclass){
}; if(type_pids.indexOf(typeclass[i].type_pid)==-1){type_pids.push(typeclass[i].type_pid)}
for (var j in type_pids) {
for (var i in api_class) {
if(api_class[i].type_pid==type_pids[j]){
d.push({
title: getMyVar('SrcJuying$api_type_id')==api_class[i].type_id?'““””<b><span style="color:' + Color + '">' + api_class[i].type_name + '</span></b>':api_class[i].type_name,
url: $('#noLoading#').lazyRule((type_id) => {
putMyVar('SrcJuying$api_type_id', type_id);
refreshPage(false);
return "hiker://empty";
}, api_class[i].type_id),
col_type: 'scroll_button'
});
}
} }
d.push({ if(type_pids.length > 0){
col_type: "blank_block" type_pids.sort((a, b) => {
}); return a - b
})
};
for (var j in type_pids) {
for (var i in typeclass) {
if(typeclass[i].type_pid==type_pids[j]){
d.push({
title: getMyVar('SrcJuying$type_id')==typeclass[i].type_id?'““””<b><span style="color:' + Color + '">' + typeclass[i].type_name + '</span></b>':typeclass[i].type_name,
url: $('#noLoading#').lazyRule((type_id) => {
putMyVar('SrcJuying$type_id', type_id);
refreshPage(false);
return "hiker://empty";
}, typeclass[i].type_id),
col_type: 'scroll_button'
});
}
}
d.push({
col_type: "blank_block"
});
}
} }
} }
MY_URL = listurl + MY_PAGE + '&t=' + getMyVar('SrcJuying$api_type_id','1'); MY_URL = listurl + MY_PAGE;
var html = request(MY_URL, { headers: { 'User-Agent': api_ua }, timeout:xunmitimeout*1000 }); var html = request(MY_URL, { headers: { 'User-Agent': api_ua }, timeout:xunmitimeout*1000 });

Loading…
Cancel
Save