|
|
@ -869,23 +869,19 @@ function getErData(jkdata) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let pic = MY_PARAMS.pic; |
|
|
|
let pic = ''; |
|
|
|
let details1 = ''; |
|
|
|
let details1 = ''; |
|
|
|
let details2 = ''; |
|
|
|
let details2 = ''; |
|
|
|
let desc = '...'; |
|
|
|
let desc = '...'; |
|
|
|
let arts = []; |
|
|
|
|
|
|
|
let conts = []; |
|
|
|
|
|
|
|
let tabs = []; |
|
|
|
let tabs = []; |
|
|
|
|
|
|
|
let lists = []; |
|
|
|
let linecodes = []; |
|
|
|
let linecodes = []; |
|
|
|
let parse_api = ""; |
|
|
|
let parse_api = ""; |
|
|
|
|
|
|
|
|
|
|
|
if(html){ |
|
|
|
if(html){ |
|
|
|
let actor = ""; |
|
|
|
let arts = []; |
|
|
|
let director = ""; |
|
|
|
let conts = []; |
|
|
|
let area = ""; |
|
|
|
let actor,director,area,year,remarks,pubdate; |
|
|
|
let year = ""; |
|
|
|
|
|
|
|
let remarks = ""; |
|
|
|
|
|
|
|
let pubdate = ""; |
|
|
|
|
|
|
|
if(/cms/.test(api_type)&&isxml==1){ |
|
|
|
if(/cms/.test(api_type)&&isxml==1){ |
|
|
|
html = html.replace(/<!\[CDATA\[|\]\]>|<!\[CDATA\[|\]\]>/g,''); |
|
|
|
html = html.replace(/<!\[CDATA\[|\]\]>|<!\[CDATA\[|\]\]>/g,''); |
|
|
|
arts = xpathArray(html,`//video/dl/dt/@name`); |
|
|
|
arts = xpathArray(html,`//video/dl/dt/@name`); |
|
|
@ -893,14 +889,14 @@ function getErData(jkdata) { |
|
|
|
arts = xpathArray(html,`//video/dl/dd/@flag`); |
|
|
|
arts = xpathArray(html,`//video/dl/dd/@flag`); |
|
|
|
} |
|
|
|
} |
|
|
|
conts = xpathArray(html,`//video/dl/dd/text()`); |
|
|
|
conts = xpathArray(html,`//video/dl/dd/text()`); |
|
|
|
actor = String(xpath(html,`//video/actor/text()`)).trim().replace(/·/g,'·') || "未知"; |
|
|
|
actor = String(xpath(html,`//video/actor/text()`)).trim().replace(/·/g,'·') || ""; |
|
|
|
director = String(xpath(html,`//video/director/text()`)).trim().replace(/·/g,'·') || "未知"; |
|
|
|
director = String(xpath(html,`//video/director/text()`)).trim().replace(/·/g,'·') || ""; |
|
|
|
area = String(xpath(html,`//video/area/text()`)).trim(); |
|
|
|
area = String(xpath(html,`//video/area/text()`)).trim(); |
|
|
|
year = String(xpath(html,`//video/year/text()`)).trim(); |
|
|
|
year = String(xpath(html,`//video/year/text()`)).trim(); |
|
|
|
remarks = String(xpath(html,`//video/note/text()`)).trim() || ""; |
|
|
|
remarks = String(xpath(html,`//video/note/text()`)).trim() || ""; |
|
|
|
pubdate = String(xpath(html,`//video/type/text()`)).trim() || ""; |
|
|
|
pubdate = String(xpath(html,`//video/type/text()`)).trim() || ""; |
|
|
|
pic = pic.indexOf('picloading.gif')==-1?pic:xpath(html,`//video/pic/text()`); |
|
|
|
pic = xpath(html,`//video/pic/text()`); |
|
|
|
desc = String(xpath(html.replace('<p>','').replace('</p>',''),`//video/des/text()`)) || '...'; |
|
|
|
desc = String(xpath(html.replace('<p>','').replace('</p>',''),`//video/des/text()`)); |
|
|
|
}else if (/v1|app|v2|cms/.test(api_type)) { |
|
|
|
}else if (/v1|app|v2|cms/.test(api_type)) { |
|
|
|
let json; |
|
|
|
let json; |
|
|
|
if (/cms/.test(api_type)) { |
|
|
|
if (/cms/.test(api_type)) { |
|
|
@ -940,44 +936,44 @@ function getErData(jkdata) { |
|
|
|
api_type = "cms"; |
|
|
|
api_type = "cms"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
actor = json.vod_actor || "未知"; |
|
|
|
actor = json.vod_actor; |
|
|
|
director = json.vod_director || "未知"; |
|
|
|
director = json.vod_director; |
|
|
|
area = json.vod_area; |
|
|
|
area = json.vod_area; |
|
|
|
year = json.vod_year; |
|
|
|
year = json.vod_year; |
|
|
|
remarks = json.vod_remarks || ""; |
|
|
|
remarks = json.vod_remarks || ""; |
|
|
|
pubdate = json.vod_pubdate || json.vod_class || ""; |
|
|
|
pubdate = json.vod_pubdate || json.vod_class || ""; |
|
|
|
pic = pic.indexOf('picloading.gif')==-1?pic:json.vod_pic&&json.vod_pic.indexOf('ver.txt')==-1?json.vod_pic:pic; |
|
|
|
pic = json.vod_pic&&json.vod_pic.indexOf('ver.txt')==-1?json.vod_pic:''; |
|
|
|
desc = json.vod_blurb || '...'; |
|
|
|
desc = json.vod_blurb; |
|
|
|
}else if (/iptv/.test(api_type)) { |
|
|
|
}else if (/iptv/.test(api_type)) { |
|
|
|
actor = html.actor.join(",") || "未知"; |
|
|
|
actor = html.actor.join(","); |
|
|
|
director = html.director.join(",") || "未知"; |
|
|
|
director = html.director.join(","); |
|
|
|
area = html.area.join(","); |
|
|
|
area = html.area.join(","); |
|
|
|
year = html.pubtime; |
|
|
|
year = html.pubtime; |
|
|
|
remarks = html.trunk || ""; |
|
|
|
remarks = html.trunk || ""; |
|
|
|
pubdate = html.type.join(",") || ""; |
|
|
|
pubdate = html.type.join(",") || ""; |
|
|
|
pic = pic || html.img_url; |
|
|
|
pic = html.img_url; |
|
|
|
desc = html.intro || '...'; |
|
|
|
desc = html.intro; |
|
|
|
arts = html.videolist; |
|
|
|
arts = html.videolist; |
|
|
|
conts = arts; |
|
|
|
conts = arts; |
|
|
|
}else if (/xpath/.test(api_type)) { |
|
|
|
}else if (/xpath/.test(api_type)) { |
|
|
|
let jsondata = MY_PARAMS.data; |
|
|
|
let jsondata = MY_PARAMS.data; |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
actor = String(xpathArray(html, jsondata.dtActor).join(',')).replace('主演:','').replace(jsondata.filter?eval(jsondata.filter):"","").replace(/[\r\ \n]/g, ""); |
|
|
|
actor = String(xpathArray(html, jsondata.dtActor).join(',')).replace(jsondata.filter?eval(jsondata.filter):"","").replace(/[\r\ \n]/g, ""); |
|
|
|
}catch(e){ |
|
|
|
}catch(e){ |
|
|
|
log('xpath获取主演dtActor失败>'+e.message); |
|
|
|
log('xpath获取主演dtActor失败>'+e.message); |
|
|
|
} |
|
|
|
} |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
director = String(xpathArray(html, jsondata.dtDirector).join(',')).replace('导演:','').replace(jsondata.filter?eval(jsondata.filter):"","").replace(/[\r\ \n]/g, ""); |
|
|
|
director = String(xpathArray(html, jsondata.dtDirector).join(',')).replace(jsondata.filter?eval(jsondata.filter):"","").replace(/[\r\ \n]/g, ""); |
|
|
|
}catch(e){ |
|
|
|
}catch(e){ |
|
|
|
log('xpath获取导演dtDirector失败>'+e.message); |
|
|
|
log('xpath获取导演dtDirector失败>'+e.message); |
|
|
|
} |
|
|
|
} |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
area = String(xpath(html, jsondata.dtArea)).replace('地区:','').replace(jsondata.filter?eval(jsondata.filter):"","").replace(/[\r\ \n]/g, ""); |
|
|
|
area = String(xpath(html, jsondata.dtArea)).replace(jsondata.filter?eval(jsondata.filter):"","").replace(/[\r\ \n]/g, ""); |
|
|
|
}catch(e){ |
|
|
|
}catch(e){ |
|
|
|
log('xpath获取地区dtArea失败>'+e.message); |
|
|
|
log('xpath获取地区dtArea失败>'+e.message); |
|
|
|
} |
|
|
|
} |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
year = String(xpath(html, jsondata.dtYear)).replace('年份:','').replace(jsondata.filter?eval(jsondata.filter):"","").replace(/[\r\ \n]/g, ""); |
|
|
|
year = String(xpath(html, jsondata.dtYear)).replace(jsondata.filter?eval(jsondata.filter):"","").replace(/[\r\ \n]/g, ""); |
|
|
|
}catch(e){ |
|
|
|
}catch(e){ |
|
|
|
log('xpath获取年份dtYear失败>'+e.message); |
|
|
|
log('xpath获取年份dtYear失败>'+e.message); |
|
|
|
} |
|
|
|
} |
|
|
@ -992,7 +988,7 @@ function getErData(jkdata) { |
|
|
|
log('xpath获取备注dtMark失败>'+e.message); |
|
|
|
log('xpath获取备注dtMark失败>'+e.message); |
|
|
|
} |
|
|
|
} |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
pic = pic?pic:xpath(html, jsondata.dtImg); |
|
|
|
pic = xpath(html, jsondata.dtImg); |
|
|
|
}catch(e){ |
|
|
|
}catch(e){ |
|
|
|
log('xpath获取图片dtImg失败>'+e.message); |
|
|
|
log('xpath获取图片dtImg失败>'+e.message); |
|
|
|
} |
|
|
|
} |
|
|
@ -1058,16 +1054,13 @@ function getErData(jkdata) { |
|
|
|
getsm = "获取更新zhuangtaiqian"; |
|
|
|
getsm = "获取更新zhuangtaiqian"; |
|
|
|
pubdate = pdfh(html.split(jsondata.zhuangtaiqian.replace(/\\/g,""))[1].split(jsondata.zhuangtaihou.replace(/\\/g,""))[0],"Text").split('/')[1]||""; |
|
|
|
pubdate = pdfh(html.split(jsondata.zhuangtaiqian.replace(/\\/g,""))[1].split(jsondata.zhuangtaihou.replace(/\\/g,""))[0],"Text").split('/')[1]||""; |
|
|
|
getsm = "获取剧情简介juqingqian"; |
|
|
|
getsm = "获取剧情简介juqingqian"; |
|
|
|
desc = pdfh(html.split(jsondata.juqingqian.replace(/\\/g,""))[1].split(jsondata.juqinghou.replace(/\\/g,""))[0],"Text") || '...'; |
|
|
|
desc = pdfh(html.split(jsondata.juqingqian.replace(/\\/g,""))[1].split(jsondata.juqinghou.replace(/\\/g,""))[0],"Text"); |
|
|
|
}catch(e){ |
|
|
|
}catch(e){ |
|
|
|
log(getsm+'失败>'+e.message) |
|
|
|
log(getsm+'失败>'+e.message) |
|
|
|
}
|
|
|
|
}
|
|
|
|
}else if (/XBPQ/.test(api_type)) { |
|
|
|
}else if (/XBPQ/.test(api_type)) { |
|
|
|
let getsm = ""; |
|
|
|
|
|
|
|
try{ |
|
|
|
try{ |
|
|
|
getsm = "获取传递数据"; |
|
|
|
|
|
|
|
let extdata = extDataCache(jkdata) |
|
|
|
let extdata = extDataCache(jkdata) |
|
|
|
getsm = "获取线路"; |
|
|
|
|
|
|
|
let arthtml = html; |
|
|
|
let arthtml = html; |
|
|
|
if(extdata["线路二次截取"]){ |
|
|
|
if(extdata["线路二次截取"]){ |
|
|
|
arthtml = arthtml.split(extdata["线路二次截取"].split('&&')[0])[1].split(extdata["线路二次截取"].split('&&')[1])[0]; |
|
|
|
arthtml = arthtml.split(extdata["线路二次截取"].split('&&')[0])[1].split(extdata["线路二次截取"].split('&&')[1])[0]; |
|
|
@ -1077,7 +1070,7 @@ function getErData(jkdata) { |
|
|
|
let arttitle = artlist[i].split(extdata["线路数组"].split('&&')[0])[1].split(extdata["线路数组"].split('&&')[1])[0].split(extdata["线路标题"].split('&&')[0])[1].split(extdata["线路标题"].split('&&')[1])[0]; |
|
|
|
let arttitle = artlist[i].split(extdata["线路数组"].split('&&')[0])[1].split(extdata["线路数组"].split('&&')[1])[0].split(extdata["线路标题"].split('&&')[0])[1].split(extdata["线路标题"].split('&&')[1])[0]; |
|
|
|
arts[i] = arttitle.replace(/<\/?.+?\/?>/g,''); |
|
|
|
arts[i] = arttitle.replace(/<\/?.+?\/?>/g,''); |
|
|
|
} |
|
|
|
} |
|
|
|
getsm = "获取选集"; |
|
|
|
|
|
|
|
let conthtml = html; |
|
|
|
let conthtml = html; |
|
|
|
if(extdata["播放二次截取"]){ |
|
|
|
if(extdata["播放二次截取"]){ |
|
|
|
conthtml = conthtml.split(extdata["播放二次截取"].split('&&')[0])[1].split(extdata["播放二次截取"].split('&&')[1])[0]; |
|
|
|
conthtml = conthtml.split(extdata["播放二次截取"].split('&&')[0])[1].split(extdata["播放二次截取"].split('&&')[1])[0]; |
|
|
@ -1094,19 +1087,16 @@ function getErData(jkdata) { |
|
|
|
conts.push(cont.join("#")) |
|
|
|
conts.push(cont.join("#")) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getsm = "获取主演"; |
|
|
|
|
|
|
|
actor = getBetweenStr(html, extdata["主演"]); |
|
|
|
actor = getBetweenStr(html, extdata["主演"]); |
|
|
|
getsm = "获取导演"; |
|
|
|
|
|
|
|
director = getBetweenStr(html, extdata["导演"]); |
|
|
|
director = getBetweenStr(html, extdata["导演"]); |
|
|
|
getsm = "获取副标"; |
|
|
|
remarks = getBetweenStr(html, extdata["影片状态"]); |
|
|
|
remarks = getBetweenStr(html, extdata["副标题"]); |
|
|
|
pubdate = getBetweenStr(html, extdata["影片类型"]); |
|
|
|
getsm = "影片类型"; |
|
|
|
year = getBetweenStr(html, extdata["影片年代"]); |
|
|
|
pubdate = getBetweenStr(html, extdata["影片类型"])||getBetweenStr(html, extdata["影片状态"])||getBetweenStr(html, extdata["影片年代"]); |
|
|
|
area = getBetweenStr(html, extdata["影片地区"]); |
|
|
|
getsm = "获取剧情简介"; |
|
|
|
|
|
|
|
extdata["简介"] = extdata["简介"]&&extdata["简介"].includes('+')?extdata["简介"].split('+')[1]:extdata["简介"]; |
|
|
|
extdata["简介"] = extdata["简介"]&&extdata["简介"].includes('+')?extdata["简介"].split('+')[1]:extdata["简介"]; |
|
|
|
desc = getBetweenStr(html, extdata["简介"]) || '...'; |
|
|
|
desc = getBetweenStr(html, extdata["简介"]); |
|
|
|
}catch(e){ |
|
|
|
}catch(e){ |
|
|
|
log(getsm+'失败>'+e.message) |
|
|
|
log('失败>'+e.message) |
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
//自定义接口/web自动匹配
|
|
|
|
//自定义接口/web自动匹配
|
|
|
@ -1114,12 +1104,12 @@ function getErData(jkdata) { |
|
|
|
let data = autoerji(MY_URL, html); |
|
|
|
let data = autoerji(MY_URL, html); |
|
|
|
details1 = data.details1||'自动匹配失败'; |
|
|
|
details1 = data.details1||'自动匹配失败'; |
|
|
|
details2 = data.details2||''; |
|
|
|
details2 = data.details2||''; |
|
|
|
pic = pic.indexOf('picloading.gif')==-1?pic:data.pic; |
|
|
|
pic = data.pic; |
|
|
|
desc = data.desc||''; |
|
|
|
desc = data.desc; |
|
|
|
arts = data.arts||[]; |
|
|
|
arts = data.arts||[]; |
|
|
|
conts = data.conts||[]; |
|
|
|
conts = data.conts||[]; |
|
|
|
} |
|
|
|
} |
|
|
|
if(/xpath|biubiu|XBPQ/.test(api_type)&&html&&(arts.length==0||conts.length==0)&&getMyVar('debug','0')=="0"&&html.indexOf(MY_PARAMS.title)>-1){ |
|
|
|
if(/xpath|biubiu|XBPQ/.test(api_type)&&html&&(arts.length==0||conts.length==0)&&getMyVar('debug','0')=="0"&&html.indexOf(MY_PARAMS.pageTitle)>-1){ |
|
|
|
log('开启模板自动匹配、AI识片,获取播放选集'); |
|
|
|
log('开启模板自动匹配、AI识片,获取播放选集'); |
|
|
|
require(config.依赖.match(/http(s)?:\/\/.*\//)[0].replace('/Ju/','/master/') + 'SrcAutoTmpl.js'); |
|
|
|
require(config.依赖.match(/http(s)?:\/\/.*\//)[0].replace('/Ju/','/master/') + 'SrcAutoTmpl.js'); |
|
|
|
let data = autoerji(MY_URL, html); |
|
|
|
let data = autoerji(MY_URL, html); |
|
|
@ -1127,23 +1117,24 @@ function getErData(jkdata) { |
|
|
|
pubdate = data.details2||""; |
|
|
|
pubdate = data.details2||""; |
|
|
|
arts = data.arts; |
|
|
|
arts = data.arts; |
|
|
|
conts = data.conts; |
|
|
|
conts = data.conts; |
|
|
|
pic = pic||data.pic; |
|
|
|
pic = data.pic; |
|
|
|
} |
|
|
|
} |
|
|
|
setPagePicUrl(pic); |
|
|
|
actor = actor?actor.includes('主演')?actor:'主演:'+actor:''; |
|
|
|
actor = actor || "未知"; |
|
|
|
director = director?director.includes('导演')?director:'导演:'+director:''; |
|
|
|
director = director || "未知"; |
|
|
|
|
|
|
|
let dqnf = ""; |
|
|
|
let dqnf = ""; |
|
|
|
if(area){ |
|
|
|
if(area){ |
|
|
|
dqnf = '\n地区:' + area + (year?' 年代:' + year:'') |
|
|
|
dqnf = '\n地区:' + area + (year?' 年代:' + year:'') |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
dqnf = year?'\n年代:' + year:'' |
|
|
|
dqnf = year?'\n年代:' + year:'' |
|
|
|
} |
|
|
|
} |
|
|
|
details1 = details1?details1:'导演:' + director.substring(0, director.length<10?director.length:10) + '\n主演:' + actor.substring(0, actor.length<10||dqnf==""?actor.length:10) + dqnf; |
|
|
|
details1 = details1?details1:director.substring(0, director.length<10?director.length:10) + '\n' + actor.substring(0, actor.length<10||dqnf==""?actor.length:10) + dqnf; |
|
|
|
details2 = details2?details2:remarks.trim() + '\n' + pubdate.trim(); |
|
|
|
details2 = details2?details2:remarks.trim() + '\n' + pubdate.trim(); |
|
|
|
details1 = details1.replace(/“/g,'“').replace(/”/g,'”').replace(/·/g,'·').replace(/…/g,'…').replace(/ |♥/g,' '); |
|
|
|
details1 = details1.replace(/“/g,'“').replace(/”/g,'”').replace(/·/g,'·').replace(/…/g,'…').replace(/ |♥/g,' '); |
|
|
|
details2 = details2.replace(/“/g,'“').replace(/”/g,'”').replace(/·/g,'·').replace(/…/g,'…').replace(/ |♥/g,' '); |
|
|
|
details2 = details2.replace(/“/g,'“').replace(/”/g,'”').replace(/·/g,'·').replace(/…/g,'…').replace(/ |♥/g,' '); |
|
|
|
|
|
|
|
desc = desc || '...'; |
|
|
|
desc = desc.replace(/“/g,'“').replace(/”/g,'”').replace(/·/g,'·').replace(/…/g,'…').replace(/ |♥/g,' '); |
|
|
|
desc = desc.replace(/“/g,'“').replace(/”/g,'”').replace(/·/g,'·').replace(/…/g,'…').replace(/ |♥/g,' '); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取线路
|
|
|
|
for (var i in arts) { |
|
|
|
for (var i in arts) { |
|
|
|
let linecode; |
|
|
|
let linecode; |
|
|
|
if (/v1|app|v2/.test(api_type)) { |
|
|
|
if (/v1|app|v2/.test(api_type)) { |
|
|
@ -1184,10 +1175,7 @@ function getErData(jkdata) { |
|
|
|
} |
|
|
|
} |
|
|
|
linecodes.push(linecode); |
|
|
|
linecodes.push(linecode); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//获取选集
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let lists = []; |
|
|
|
|
|
|
|
for (var i in conts) { |
|
|
|
for (var i in conts) { |
|
|
|
if (/v1|app|v2/.test(api_type)) { |
|
|
|
if (/v1|app|v2/.test(api_type)) { |
|
|
|
if(conts[i].url){ |
|
|
|
if(conts[i].url){ |
|
|
@ -1231,6 +1219,9 @@ function getErData(jkdata) { |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
"details1": details1, |
|
|
|
"details1": details1, |
|
|
|