Update SrcJuying.js

pull/1/head
jevons0411 3 years ago
parent 106dd9c77f
commit e916319bb5
  1. 29
      SrcJuying.js

@ -118,26 +118,29 @@ function jiekouyiji() {
const Color = "#3399cc"; const Color = "#3399cc";
try{ try{
var typehtml = JSON.parse(request(typeurl, { headers: { 'User-Agent': api_ua }, timeout:xunmitimeout*1000 })); let gethtml = request(typeurl, { headers: { 'User-Agent': api_ua }, timeout:xunmitimeout*1000 });
if (api_type=="v1") { if(api_type=="cms"&&/^<\?xml/.test(gethtml)){
let typelist = typehtml.data.list||typehtml.data.typelist; let typelist = pdfa(gethtml,'class&&ty');
var typeclass = typelist.map((list)=>{ var typeclass = typelist.map((list)=>{
return { return {
"type_id": list.type_id, "type_id": String(xpath(list,`//ty/@id`)).trim(),
"type_pid": list.type_pid, "type_pid": 0,
"type_name": list.type_name "type_name": String(xpath(list,`//ty/text()`)).trim()
} }
}) })
} else if (api_type=="app") { }else if (api_type=="v1") {
var typeclass = typehtml.list.map((list)=>{ let typehtml = JSON.parse(gethtml);
let typelist = typehtml.data.list||typehtml.data.typelist;
var typeclass = typelist.map((list)=>{
return { return {
"type_id": list.type_id, "type_id": list.type_id,
"type_pid": 0, "type_pid": list.type_pid,
"type_name": list.type_name "type_name": list.type_name
} }
}) })
} else if (api_type=="v2") { } else if (/app|v2/.test(api_type)) {
var typeclass = typehtml.data.map((list)=>{ let typehtml = JSON.parse(gethtml);
var typeclass = typehtml.list.map((list)=>{
return { return {
"type_id": list.type_id, "type_id": list.type_id,
"type_pid": 0, "type_pid": 0,
@ -155,6 +158,7 @@ function jiekouyiji() {
oumeiju: '欧美剧', oumeiju: '欧美剧',
tiyu: '体育' tiyu: '体育'
}; };
let typehtml = JSON.parse(gethtml);
var typeclass = typehtml.map((list)=>{ var typeclass = typehtml.map((list)=>{
if(type_dict[list]){ if(type_dict[list]){
return { return {
@ -166,6 +170,7 @@ function jiekouyiji() {
}) })
typeclass = typeclass.filter(n => n); typeclass = typeclass.filter(n => n);
} else if (api_type=="cms") { } else if (api_type=="cms") {
let typehtml = JSON.parse(gethtml);
var typeclass = typehtml.class; var typeclass = typehtml.class;
} else { } else {
log('api类型错误') log('api类型错误')
@ -174,7 +179,7 @@ function jiekouyiji() {
log(api_name+' 接口访问异常,请更换接口!获取分类失败>'+e.message); log(api_name+' 接口访问异常,请更换接口!获取分类失败>'+e.message);
var typeclass = []; var typeclass = [];
} }
log(typeclass)
if(typeclass&&typeclass.length>0){ if(typeclass&&typeclass.length>0){
let type_pids = []; let type_pids = [];
let type_ids = []; let type_ids = [];

Loading…
Cancel
Save