You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0 lines
36 KiB

  1. import cheerio from"assets://js/lib/cheerio.min.js";import"assets://js/lib/crypto-js.js";import 模板 from"./模板.js";import{gbkTool}from"./gbk.js";function init_test(){console.log("init_test_start"),console.log("当前版本号:"+VERSION),console.log(RKEY),console.log(JSON.stringify(rule)),console.log("init_test_end")}function pre(){if("string"==typeof rule.预处理&&rule.预处理&&rule.预处理.trim()){let code=rule.预处理.trim();console.log("执行预处理代码:"+code),code.startsWith("js:")&&(code=code.replace("js:",""));try{eval(code)}catch(e){console.log("预处理执行失败:"+e.message)}}}let rule={},vercode="function"==typeof pdfl?"drpy2.1":"drpy2";const VERSION=vercode+" 3.9.49beta2 20231122",MOBILE_UA="Mozilla/5.0 (Linux; Android 11; M2007J3SC Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045714 Mobile Safari/537.36",PC_UA="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36",UA="Mozilla/5.0",UC_UA="Mozilla/5.0 (Linux; U; Android 9; zh-CN; MI 9 Build/PKQ1.181121.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.5.5.1035 Mobile Safari/537.36",IOS_UA="Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1",RULE_CK="cookie",CATE_EXCLUDE="首页|留言|APP|下载|资讯|新闻|动态",TAB_EXCLUDE="猜你|喜欢|下载|剧情|热播",OCR_RETRY=3,OCR_API="http://drpy.nokia.press:8028/ocr/drpy/text";if(void 0===MY_URL)var MY_URL;var HOST,RKEY,fetch,print,log,rule_fetch_params,fetch_params,oheaders,_pdfh,_pdfa,_pd;const DOM_CHECK_ATTR=/(url|src|href|-original|-src|-play|-url|style)$/,SPECIAL_URL=/^(ftp|magnet|thunder|ws):/,NOADD_INDEX=/:eq|:lt|:gt|:first|:last|^body$|^#/,URLJOIN_ATTR=/(url|src|href|-original|-src|-play|-url|style)$/,SELECT_REGEX=/:eq|:lt|:gt|#/g,SELECT_REGEX_A=/:eq|:lt|:gt/g;function 是否正版(e){return new RegExp("qq.com|iqiyi.com|youku.com|mgtv.com|bilibili.com|sohu.com|ixigua.com|pptv.com|miguvideo.com|le.com|1905.com|fun.tv").test(e)}function urlDeal(e){return e?是否正版(e)?(/miguvideo/.test(e)||(e=e.split("#")[0].split("?")[0]),e):e:""}function setResult(e){return Array.isArray(e)?(VODS=[],e.forEach(function(e){let t={vod_id:e.url||"",vod_name:e.title||"",vod_remarks:e.desc||"",vod_content:e.content||"",vod_pic:e.pic_url||e.img||""},r=Object.keys(e);r.includes("tname")&&(t.type_name=e.tname||""),r.includes("tid")&&(t.type_id=e.tid||""),r.includes("year")&&(t.vod_year=e.year||""),r.includes("actor")&&(t.vod_actor=e.actor||""),r.includes("director")&&(t.vod_director=e.director||""),r.includes("area")&&(t.vod_area=e.area||""),VODS.push(t)}),VODS):[]}function setResult2(e){return VODS=e.list||[]}function setHomeResult(e){return e&&"object"==typeof e?setResult(e.list):[]}function rc(e){if("maomi_aes.js"===e){var t=CryptoJS.enc.Utf8.parse("625222f9149e961d"),r=CryptoJS.enc.Utf8.parse("5efdtf6060e2o330");return{De:function(e){return e=CryptoJS.enc.Hex.parse(e),CryptoJS.AES.decrypt(CryptoJS.enc.Base64.stringify(e),t,{iv:r,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8)},En:function(e){return CryptoJS.AES.encrypt(e,t,{iv:r,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).ciphertext.toString()}}}return{}}function maoss(jxurl,ref,key){fetch_params=JSON.parse(JSON.stringify(rule_fetch_params)),eval(getCryptoJS());try{var getVideoInfo=function(e){return CryptoJS.AES.decrypt(e,key,{iv:iv,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8)},token_key=null==key?"dvyYRQlnPRCMdQSe":key;if(ref)var html=request(jxurl,{headers:{Referer:ref}});else var html=request(jxurl);-1!=html.indexOf("&btwaf=")&&(html=request(jxurl+"&btwaf"+html.match(/&btwaf(.*?)"/)[1],{headers:{Referer:ref}}));var token_iv=html.split('_token = "')[1].split('"')[0],key=CryptoJS.enc.Utf8.parse(token_key),iv=CryptoJS.enc.Utf8.parse(token_iv);return eval(html.match(/var config = {[\s\S]*?}/)[0]+""),config.url.startsWith("http")||(conf