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 cfgfile = "hiker://files/rules/Src/Juying/config.json";
var Juyingcfg=fetch(cfgfile);
if(Juyingcfg != ""){
eval("var JYconfig=" + Juyingcfg+ ";");
}else{
var JYconfig= {};
}
var filepath = "hiker://files/rules/Src/Juying/jiekou.json";
var datafile = fetch(filepath);
if(datafile != ""){
eval("var datalist=" + datafile+ ";");
}else{
var datalist = [];
}
datalist = datalist.filter(item => {
return item.type!="xpath" && item.type!="biubiu";
})
var Juyingcfg=fetch(cfgfile);
if(Juyingcfg != ""){
eval("var JYconfig=" + Juyingcfg+ ";");
}else{
var JYconfig= {};
}
var filepath = "hiker://files/rules/Src/Juying/jiekou.json";
var datafile = fetch(filepath);
if(datafile != ""){
eval("var datalist=" + datafile+ ";");
}else{
var datalist = [];
}
datalist = datalist.filter(item => {
return item.type!="xpath" && item.type!="biubiu";
})
var api_type = "cms";
var api_url = "http://49.232.165.26/hi.php/provide/vod/";
var api_ua = MOBILE_UA;
var xunmitimeout = 5;
if (api_type=="v1") {
let date = new Date();
let mm = date.getMonth()+1;
let dd = date.getDate();
let key = (mm<10?"0"+mm:mm)+""+(dd<10?"0"+dd:dd);
} else if (api_type=="app") {
var url = api_url + 'video_detail?id=';
} else if (api_type=="v2") {
var url = api_url + 'video_detail?id=';
} else if (api_type=="iptv") {
var url = api_url + '?ac=detail&ids=';
} else if (api_type=="cms") {
var url = api_url + '?ac=detail&ids=';
var classurl = api_url + "?ac=list";
var listurl = api_url + '?ac=videolist&pg=';
} else {
log('api类型错误')
}
var api_url = "http://49.232.165.26/hi.php/provide/vod/";
var api_ua = MOBILE_UA;
var xunmitimeout = 5;
if (api_type=="v1") {
let date = new Date();
let mm = date.getMonth()+1;
let dd = date.getDate();
let key = (mm<10?"0"+mm:mm)+""+(dd<10?"0"+dd:dd);
var url = api_url + '/detail?&key='+key+'&vod_id=';
var typeurl = api_url + "/types";
var listurl = api_url + '?type=' + getMyVar('SrcJuying$type_id','1') + '&page=';
} else if (api_type=="app") {
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=="v2") {
var url = api_url + 'video_detail?id=';
var typeurl = api_url + "?ac=list";
var listurl = api_url + '?ac=videolist&t=' + getMyVar('SrcJuying$type_id','1') + '&pg=';
} else if (api_type=="iptv") {
var url = api_url + '?ac=detail&ids=';
var typeurl = api_url + "/?ac=flitter";
var listurl = api_url + '?ac=list&class=' + getMyVar('SrcJuying$type_id','1') + '&page=';
} 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){
const Color = "#3399cc";
var api_class = JSON.parse(request(classurl, { headers: { 'User-Agent': api_ua }, timeout:xunmitimeout*1000 })).class;
if(!getMyVar('SrcJuying$api_type_id')){putMyVar('SrcJuying$api_type_id',''+api_class[0].type_id)}
let type_pids = [];
for(let i in api_class){
if(type_pids.indexOf(api_class[i].type_pid)==-1){type_pids.push(api_class[i].type_pid)}
try{
var typehtml = JSON.parse(request(typeurl, { headers: { 'User-Agent': api_ua }, timeout:xunmitimeout*1000 }));
if (api_type=="v1") {
} 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){
type_pids.sort((a, b) => {
return a - b
})
};
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'
});
}
if(typeclass.length>0){
if(!getMyVar('SrcJuying$type_id')){putMyVar('SrcJuying$type_id',''+typeclass[0].type_id)}
let type_pids = [];
for(let i in typeclass){
if(type_pids.indexOf(typeclass[i].type_pid)==-1){type_pids.push(typeclass[i].type_pid)}
}
d.push({
col_type: "blank_block"
});
if(type_pids.length > 0){
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 });

Loading…
Cancel
Save