更新 'SrcJyData.js'

master
src48597962 9 months ago
parent c340b50502
commit 1aef9a4cf1
  1. 65
      SrcJyData.js

@ -769,7 +769,9 @@ function getYiData(jkdata) {
log('api类型错误') log('api类型错误')
} }
} }
let lists = []; //影片列表
if(MY_PAGE==1){ if(MY_PAGE==1){
let recommends =[];
if(classurl){ if(classurl){
const Color = "#3399cc"; const Color = "#3399cc";
let typeclass = []; let typeclass = [];
@ -851,7 +853,10 @@ function getYiData(jkdata) {
}) })
}else{ }else{
let typehtml = JSON.parse(gethtml); let typehtml = JSON.parse(gethtml);
typeclass = typehtml.class; typeclass = typehtml.class;//分类列表
if(getMyVar('SrcJu_dianbo$cate_id','0')=='0'){
lists = typehtml.list;//推荐影片
}
} }
if(jkdata.categories){ if(jkdata.categories){
@ -870,7 +875,17 @@ function getYiData(jkdata) {
}catch(e){ }catch(e){
log(api_name+'>访问异常,请更换源接口!获取分类失败>'+e.message); log(api_name+'>访问异常,请更换源接口!获取分类失败>'+e.message);
} }
if(recommends.length>0){
d.push({
title: getMyVar('SrcJu_dianbo$cate_id')=='0'?'““””<b><span style="color:' + Color + '">' + '推荐' + '</span></b>':'推荐',
url: $('#noLoading#').lazyRule(() => {
putMyVar('SrcJu_dianbo$cate_id', '0');
refreshPage(true);
return "hiker://empty";
}),
col_type: 'scroll_button'
});
}
if(typeclass.length>0){ if(typeclass.length>0){
let cates = typeclass.filter(it=>{ let cates = typeclass.filter(it=>{
return it.type_pid==0; return it.type_pid==0;
@ -893,11 +908,10 @@ function getYiData(jkdata) {
}); });
let cate_id = getMyVar('SrcJu_dianbo$cate_id', cates[0].type_id.toString()); let cate_id = getMyVar('SrcJu_dianbo$cate_id', cates[0].type_id.toString());
log(cate_id);
let types = typeclass.filter(it=>{ let types = typeclass.filter(it=>{
return it.type_pid==cate_id; return it.type_pid==cate_id;
}) })
log("2");
types.forEach(it=>{ types.forEach(it=>{
d.push({ d.push({
title: getMyVar('SrcJu_dianbo$type_id')==it.type_id?'““””<b><span style="color:' + Color + '">' + it.type_name + '</span></b>':it.type_name, title: getMyVar('SrcJu_dianbo$type_id')==it.type_id?'““””<b><span style="color:' + Color + '">' + it.type_name + '</span></b>':it.type_name,
@ -912,7 +926,6 @@ function getYiData(jkdata) {
d.push({ d.push({
col_type: "blank_block" col_type: "blank_block"
}); });
log("3");
/* /*
let type_pids = []; let type_pids = [];
let type_ids = []; let type_ids = [];
@ -973,10 +986,8 @@ function getYiData(jkdata) {
}); });
} }
} }
log(d.length);
return d; if(listurl && lists.length==0){
if(typeof(listurl) != "undefined"){
let lists = [];
try{ try{
if(api_type=="XBPQ"){ if(api_type=="XBPQ"){
MY_URL = listurl.replace('{catePg}',extdata["起始页"]?MY_PAGE>extdata["起始页"]?MY_PAGE:"":MY_PAGE).replace('{cateId}',getMyVar('SrcJu_dianbo$type_id','1')); MY_URL = listurl.replace('{catePg}',extdata["起始页"]?MY_PAGE>extdata["起始页"]?MY_PAGE:"":MY_PAGE).replace('{cateId}',getMyVar('SrcJu_dianbo$type_id','1'));
@ -994,8 +1005,8 @@ function getYiData(jkdata) {
} }
} }
} }
try {
var gethtml = request(MY_URL, { headers: { 'User-Agent': api_ua }, timeout:5000 }); let gethtml = request(MY_URL, { headers: { 'User-Agent': api_ua }, timeout:5000 });
if(api_type=="XBPQ"){ if(api_type=="XBPQ"){
jkdata["二次截取"] = jkdata["二次截取"] || (gethtml.indexOf(`<ul class="stui-vodlist`)>-1?`<ul class="stui-vodlist&&</ul>`:gethtml.indexOf(`<ul class="myui-vodlist`)>-1?`<ul class="myui-vodlist&&</ul>`:""); jkdata["二次截取"] = jkdata["二次截取"] || (gethtml.indexOf(`<ul class="stui-vodlist`)>-1?`<ul class="stui-vodlist&&</ul>`:gethtml.indexOf(`<ul class="myui-vodlist`)>-1?`<ul class="myui-vodlist&&</ul>`:"");
if(jkdata["二次截取"]){ if(jkdata["二次截取"]){
@ -1066,11 +1077,18 @@ function getYiData(jkdata) {
lists = json.list||json.data.list||json.data||[]; lists = json.list||json.data.list||json.data||[];
} }
} }
} catch (e) { }catch(e){
log(api_name+' 接口访问异常,请更换接口!获取影片失败>'+e.message)
} }
}
let videolist = lists.map((list)=>{ if(lists.length==0){
d.push({
title: '接口访问异常,请更换接口!',
url: '#noHistory#hiker://empty',
col_type: 'text_center_1'
});
}else{
lists.forEach((list)=>{
let vodname = list.vod_name||list.title; let vodname = list.vod_name||list.title;
if(vodname){ if(vodname){
let vodpic = list.vod_pic||list.pic; let vodpic = list.vod_pic||list.pic;
@ -1088,7 +1106,7 @@ function getYiData(jkdata) {
list['play'] = list.vod_play_url; list['play'] = list.vod_play_url;
} }
} }
return { d.push({
title: vodname, title: vodname,
desc: voddesc, desc: voddesc,
pic_url: vodpic, pic_url: vodpic,
@ -1103,21 +1121,10 @@ function getYiData(jkdata) {
pageTitle: vodname, pageTitle: vodname,
data: jkdata data: jkdata
} }
} })
} }
}); });
videolist = videolist.filter(n => n);
d = d.concat(videolist);
}catch(e){
if(lists.length==0){
d.push({
title: '接口访问异常,请更换接口!',
url: '#noHistory#hiker://empty',
col_type: 'text_center_1'
});
}
log(api_name+' 接口访问异常,请更换接口!获取影片失败>'+e.message)
}
} }
return d; return d;
} }
Loading…
Cancel
Save