提交 72fdfee5 编写于 作者: H hjdhnx

升级3.9.6

上级 45049da0
3.9.5
\ No newline at end of file
3.9.6
\ No newline at end of file
......@@ -28,7 +28,7 @@ var rule = {
// 一级:'json:data.hitDocs;title;img;updateInfo;playPartId',
二级:'',
二级:'js:log(input);',
二级:'js:fetch_params.headers.Referer="https://www.mgtv.com";fetch_params.headers["User-Agent"]=UA;pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;VOD={};let d=[];let html=request(input);let json=JSON.parse(html);let host="https://www.mgtv.com";let ourl=json.data.list.length>0?json.data.list[0].url:json.data.series[0].url;if(!/^http/.test(ourl)){ourl=host+ourl}fetch_params.headers["User-Agent"]=MOBILE_UA;html=request(ourl);if(html.includes("window.location =")){print("开始获取ourl");ourl=pdfh(html,"meta[http-equiv=refresh]&&content").split("url=")[1];print("获取到ourl:"+ourl);html=request(ourl)}try{let details=pdfh(html,".m-details&&Html").replace(/h1>/,"h6>").replace(/div/g,"br");let actor="",director="",time="";if(/播出时间/.test(details)){actor=pdfh(html,"p:eq(5)&&Text").substr(0,25);director=pdfh(html,"p:eq(4)&&Text");time=pdfh(html,"p:eq(3)&&Text")}else{actor=pdfh(html,"p:eq(4)&&Text").substr(0,25);director=pdfh(html,"p:eq(3)&&Text");time="已完结"}let _img=pd(html,".video-img&&img&&src");let JJ=pdfh(html,".desc&&Text").split("简介:")[1];let _desc=time;VOD.vod_name=pdfh(html,".vt-txt&&Text");VOD.type_name=pdfh(html,"p:eq(0)&&Text").substr(0,6);VOD.vod_area=pdfh(html,"p:eq(1)&&Text");VOD.vod_actor=actor;VOD.vod_director=director;VOD.vod_remarks=_desc;VOD.vod_pic=_img;VOD.vod_content=JJ}catch(e){log("获取影片信息发生错误:"+e.message)}function getRjpg(imgUrl,xs){xs=xs||3;let picSize=/jpg_/.test(imgUrl)?imgUrl.split("jpg_")[1].split(".")[0]:false;let rjpg=false;if(picSize){let a=parseInt(picSize.split("x")[0])*xs;let b=parseInt(picSize.split("x")[1])*xs;rjpg=a+"x"+b+".jpg"}let img=/jpg_/.test(imgUrl)&&rjpg?imgUrl.replace(imgUrl.split("jpg_")[1],rjpg):imgUrl;return img}if(json.data.total===1&&json.data.list.length===1){let data=json.data.list[0];let url="https://www.mgtv.com"+data.url;d.push({title:data.t4,desc:data.t2,pic_url:getRjpg(data.img),url:url})}else if(json.data.list.length>1){for(let i=1;i<=json.data.total_page;i++){if(i>1){json=JSON.parse(fetch(input.replace("page=1","page="+i),{}))}json.data.list.forEach(function(data){let url="https://www.mgtv.com"+data.url;if(data.isIntact=="1"){d.push({title:data.t4,desc:data.t2,pic_url:getRjpg(data.img),url:url})}})}}else{print(input+"暂无片源")}VOD.vod_play_from="mgtv";VOD.vod_play_url=d.map(function(it){return it.title+"$"+it.url}).join("#");setResult(d);',
二级:'js:fetch_params.headers.Referer="https://www.mgtv.com";fetch_params.headers["User-Agent"]=UA;pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;VOD={};let d=[];let html=request(input);let json=JSON.parse(html);let host="https://www.mgtv.com";let ourl=json.data.list.length>0?json.data.list[0].url:json.data.series[0].url;if(!/^http/.test(ourl)){ourl=host+ourl}fetch_params.headers["User-Agent"]=MOBILE_UA;html=request(ourl);if(html.includes("window.location =")){print("开始获取ourl");ourl=pdfh(html,"meta[http-equiv=refresh]&&content").split("url=")[1];print("获取到ourl:"+ourl);html=request(ourl)}try{let details=pdfh(html,".m-details&&Html").replace(/h1>/,"h6>").replace(/div/g,"br");print(details);let actor="",director="",time="";if(/播出时间/.test(details)){actor=pdfh(html,"p:eq(5)&&Text").substr(0,25);director=pdfh(html,"p:eq(4)&&Text");time=pdfh(html,"p:eq(3)&&Text")}else{actor=pdfh(html,"p:eq(4)&&Text").substr(0,25);director=pdfh(html,"p:eq(3)&&Text");time="已完结"}let _img=pd(html,".video-img&&img&&src");let JJ=pdfh(html,".desc&&Text").split("简介:")[1];let _desc=time;VOD.vod_name=pdfh(html,".vt-txt&&Text");VOD.type_name=pdfh(html,"p:eq(0)&&Text").substr(0,6);VOD.vod_area=pdfh(html,"p:eq(1)&&Text");VOD.vod_actor=actor;VOD.vod_director=director;VOD.vod_remarks=_desc;VOD.vod_pic=_img;VOD.vod_content=JJ}catch(e){log("获取影片信息发生错误:"+e.message)}function getRjpg(imgUrl,xs){xs=xs||3;let picSize=/jpg_/.test(imgUrl)?imgUrl.split("jpg_")[1].split(".")[0]:false;let rjpg=false;if(picSize){let a=parseInt(picSize.split("x")[0])*xs;let b=parseInt(picSize.split("x")[1])*xs;rjpg=a+"x"+b+".jpg"}let img=/jpg_/.test(imgUrl)&&rjpg?imgUrl.replace(imgUrl.split("jpg_")[1],rjpg):imgUrl;return img}if(json.data.total===1&&json.data.list.length===1){let data=json.data.list[0];let url="https://www.mgtv.com"+data.url;d.push({title:data.t4,desc:data.t2,pic_url:getRjpg(data.img),url:url})}else if(json.data.list.length>1){for(let i=1;i<=json.data.total_page;i++){if(i>1){json=JSON.parse(fetch(input.replace("page=1","page="+i),{}))}json.data.list.forEach(function(data){let url="https://www.mgtv.com"+data.url;if(data.isIntact=="1"){d.push({title:data.t4,desc:data.t2,pic_url:getRjpg(data.img),url:url})}})}}else{print(input+"暂无片源")}VOD.vod_play_from="mgtv";VOD.vod_play_url=d.map(function(it){return it.title+"$"+it.url}).join("#");setResult(d);',
搜索:'',
搜索:'js:fetch_params.headers.Referer="https://www.mgtv.com";fetch_params.headers["User-Agent"]=UA;let d=[];let html=request(input);let json=JSON.parse(html);json.data.contents.forEach(function(data){if(data.data.sourceList||data.data.yearList){let list=data.data.sourceList?data.data.sourceList:data.data.yearList[0].sourceList;let desc="";list.forEach(function(it){desc+=it.name+"\\t"});if(list[0].source==="imgo"){let img=data.data.pic?data.data.pic:data.data.yearList[0].pic;d.push({title:data.data.title?data.data.title:data.data.yearList[0].title,img:img,content:data.data.story?data.data.story:data.data.yearList[0].story,desc:data.data.playTime,url:list[0].vid})}}});setResult(d);',
}
\ No newline at end of file
......@@ -412,6 +412,26 @@ function urljoin(fromPath, nowPath) {
}
var urljoin2 = urljoin;
// 内置 pdfh,pdfa,pd
const defaultParser = {
pdfh:pdfh,
pdfa:pdfa,
pd(html,parse,uri){
let ret = this.pdfh(html,parse);
if(typeof(uri)==='undefined'||!uri){
uri = '';
}
if(DOM_CHECK_ATTR.test(parse)){
if(/http/.test(ret)){
ret = ret.substr(ret.indexOf('http'));
}else{
ret = urljoin(MY_URL,ret)
}
}
return ret
},
};
/**
* pdfh原版优化,能取style属性里的图片链接
* @param html 源码
......@@ -419,7 +439,7 @@ var urljoin2 = urljoin;
* @returns {string|*}
*/
function pdfh2(html,parse){
let result = pdfh(html,parse);
let result = defaultParser.pdfh(html,parse);
let option = parse.includes('&&')?parse.split('&&').slice(-1)[0]:parse.split(' ').slice(-1)[0];
if(/style/.test(option.toLowerCase())&&/url\(/.test(result)){
try {
......@@ -430,13 +450,13 @@ function pdfh2(html,parse){
}
/**
* 重写pd方法-增加自动urljoin(没法重写,改个名继续骗)
* pd原版方法重写-增加自动urljoin
* @param html
* @param parse
* @param uri
* @returns {*}
*/
function pD(html,parse,uri){
function pd2(html,parse,uri){
let ret = pdfh2(html,parse);
if(typeof(uri)==='undefined'||!uri){
uri = '';
......@@ -456,8 +476,8 @@ function pD(html,parse,uri){
const parseTags = {
jsp:{
pdfh:pdfh2,
pdfa:pdfa,
pd:pD,
pdfa:defaultParser.pdfa,
pd:pd2,
},
json:{
pdfh(html, parse) {
......
此差异已折叠。
......@@ -27,6 +27,7 @@ if(html.includes('window.location =')){
try{
// print(html);
let details = pdfh(html, '.m-details&&Html').replace(/h1>/,'h6>').replace(/div/g, 'br');//详情网页
print(details);
let actor='',director='',time='';
if (/播出时间/.test(details)) {
actor = pdfh(html, 'p:eq(5)&&Text').substr(0,25);
......
......@@ -51,6 +51,7 @@
- [X] 3.9.5修复凌云影视源并增加短视模板
- [X] 增加秋霞影视,ddys等半成品(优化代码兼容取style属性的情况自动提取链接)
- [X] 更新drpy.js,drpy.min.js等本地js运行支持库
- [X] 3.9.6修复drpy的一个严重bug(pdfh死循环)
###### 2022/10/12
- [X] js模式2动态配置链接支持多种壳子
- [X] 增加/lives?path=base/live.txt路由
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册