diff --git a/0821.json b/0821.json index 46ad9e19..80d4a3a6 100644 --- a/0821.json +++ b/0821.json @@ -1,5 +1,5 @@ { -"spider":"./jar/fan.txt;md5;050512c9db356ad449af9d37dde8c5f0", +"spider":"./jar/fan.txt;md5;5769450f1eccd0c8dc347327736e870a", "logo":"https://avatars.githubusercontent.com/u/58679624?v=4", "lives":[{"name":"初秋语•ipv4","type":0,"url":"./list.txt","playerType":2,"epg":"http://epg.112114.xyz/?ch={name}&date={date}","logo":"https://epg.112114.xyz/logo/{name}.png"}, {"name":"YanG•综合","type":0,"url":"https://github.moeyy.xyz/https://raw.githubusercontent.com/YanG-1989/m3u/main/Gather.m3u","playerType":1,"epg":"http://epg.112114.xyz/?ch={name}&date={date}","logo":"https://epg.112114.xyz/logo/{name}.png"}, @@ -48,7 +48,6 @@ {"key":"萌米","name":"萌米┃多线","type":3,"api":"csp_AppTT","timeout":15,"playerType":1,"ext":"AO7TcBkd8Iifux0Y8Qze6tVlMg=="}, {"key":"南瓜","name":"南瓜┃多线","type":3,"api":"csp_NanGua","timeout":15,"playerType":2,"searchable":1,"quickSearch":1,"changeable":1}, {"key":"可可","name":"可可┃多线","type":3,"api":"csp_Kekys","timeout":15,"playerType":2,"searchable":1,"quickSearch":1,"changeable":1}, -{"key":"樱花","name":"樱花┃多线","type":3,"api":"csp_Yh007","timeout":15,"searchable":1,"quickSearch":1,"changeable":1}, {"key":"zxzj","name":"在线┃外剧","type":3,"api":"csp_Zxzj","timeout":15,"searchable":1,"quickSearch":1,"changeable":1,"ext":"https://www.zxzjhd.com/"}, {"key":"低端","name":"低端┃外剧","type":3,"api":"csp_Ddrk","playerType":"2","searchable":1,"quickSearch":1,"changeable":1}, {"key":"贱贱","name":"贱贱┃P2P","type":3,"searchable":1,"quickSearch":1,"changeable":1,"playerType":"1","api":"https://gitlab.com/fantaiying/ext/-/raw/main/drpy2.min.js","ext":"https://gitlab.com/fantaiying/ext/-/raw/main/jp.js"}, @@ -60,9 +59,9 @@ {"key":"Ysj","name":"异界┃动漫","type":3,"api":"csp_Ysj","searchable":1,"quickSearch":1,"changeable":1}, {"key":"Anime1","name":"日本┃动漫","type": 3,"api": "csp_Anime1","searchable": 1,"quickSearch": 1,"changeable":1}, +{"key":"Sso","name":"盘他┃三盘","type":3,"api":"csp_PanSso","searchable":1,"quickSearch":1,"changeable":0,"ext": {"Cloud-drive":"tvfan/Cloud-drive.txt","from":"4k|auto"}}, {"key":"夸搜","name":"夸搜┃狸夸","type":3,"api":"csp_PanSearch","searchable":1,"quickSearch":1,"changeable":0,"ext": {"pan":"quark","Cloud-drive":"tvfan/Cloud-drive.txt","from":"4k|auto"}}, {"key":"YiSo","name":"易搜┃阿狸","type":3,"api":"csp_YiSo","searchable":1,"quickSearch":1,"changeable":0,"ext": {"Cloud-drive":"tvfan/Cloud-drive.txt","from":"4k|auto"}}, -{"key":"PanSou","name":"盘搜┃阿狸","type":3,"api":"csp_PanSou","searchable":1,"quickSearch":1,"changeable":0,"ext": {"Cloud-drive":"tvfan/Cloud-drive.txt","from":"4k|auto"}}, {"key":"PanSearch","name":"盘Se┃阿狸","type":3,"api":"csp_PanSearch","searchable":1,"quickSearch":1,"changeable":0,"ext": {"Cloud-drive":"tvfan/Cloud-drive.txt","from":"4k|auto"}}, {"key":"push_agent","name":"手机┃推送","type":3,"api":"csp_Push","searchable":0,"quickSearch":0,"ext": {"Cloud-drive":"tvfan/Cloud-drive.txt","from":"4k|auto"}}, diff --git a/0825.json b/0825.json index 607431b0..390d1bc7 100644 --- a/0825.json +++ b/0825.json @@ -1,5 +1,5 @@ { -"spider":"./jar/pg.jar;md5;e635dc6194fc68f0bee81e3bec34ea86", +"spider":"./jar/pg.jar;md5;988ca838860b1f359a048e2b177cd8a0", "lives":[{"name":"初秋语•综合","type":0,"url":"./list.txt","playerType":2,"epg":"http://epg.112114.xyz/?ch={name}&date={date}","logo":"https://epg.112114.xyz/logo/{name}.png"}, {"name":"Ray•综合","type":0,"url":"https://github.moeyy.xyz/https://raw.githubusercontent.com/dxawi/0/main/tvlive.txt","playerType":1,"epg":"http://epg.112114.xyz/?ch={name}&date={date}","logo":"https://epg.112114.xyz/logo/{name}.png"}, {"name":"俊于•综合","type":0,"url":"http://home.jundie.top:81/Cat/tv/live.txt","playerType":1,"epg":"http://epg.112114.xyz/?ch={name}&date={date}","logo": "https://epg.112114.xyz/logo/{name}.png"}, diff --git a/0826.json b/0826.json index 59c633e5..c58d8727 100644 --- a/0826.json +++ b/0826.json @@ -1,5 +1,5 @@ { -"spider":"./jar/fan.txt;md5;050512c9db356ad449af9d37dde8c5f0", +"spider":"./jar/fan.txt;md5;5769450f1eccd0c8dc347327736e870a", "wallpaper":"https://深色壁纸.xxooo.cf/", "sites":[ @@ -19,7 +19,6 @@ {"key":"萌米","name":"👀萌米┃多线","type":3,"api":"csp_AppTT","timeout":15,"playerType":1,"ext":"AO7TcBkd8Iifux0Y8Qze6tVlMg=="}, {"key":"南瓜","name":"🎃南瓜┃多线","type":3,"api":"csp_NanGua","timeout":15,"playerType":2,"searchable":1,"quickSearch":1,"changeable":1}, {"key":"可可","name":"👻可可┃多线","type":3,"api":"csp_Kekys","timeout":15,"playerType":2,"searchable":1,"quickSearch":1,"changeable":1}, -{"key":"樱花","name":"💥樱花┃多线","type":3,"api":"csp_Yh007","timeout":15,"searchable":1,"quickSearch":1,"changeable":1}, {"key":"zxzj","name":"🍊在线┃外剧","type":3,"api":"csp_Zxzj","timeout":15,"searchable":1,"quickSearch":1,"changeable":1,"ext":"https://www.zxzjhd.com/"}, {"key":"低端","name":"⏮️低端┃外剧","type":3,"api":"csp_Ddrk","playerType":"2","searchable":1,"quickSearch":1,"changeable":1}, {"key":"贱贱","name":"🐭贱贱┃P2P","type":3,"searchable":1,"quickSearch":1,"changeable":1,"playerType":"1","api":"https://gitlab.com/fantaiying/ext/-/raw/main/drpy2.min.js","ext":"https://gitlab.com/fantaiying/ext/-/raw/main/jp.js"}, @@ -47,9 +46,9 @@ {"key":"有声小说js","name":"🎧有声┃小说","type":3,"api":"https://gitlab.com/fantaiying/ext/-/raw/main/drpy2.min.js","ext":"https://gitlab.com/fantaiying/ext/-/raw/main/有声小说吧.js","style":{"type":"rect","ratio":1},"searchable": 0,"quickSearch": 0,"changeable":0}, {"key":"Aid","name":"🚑急救┃教学","type":3,"api":"csp_FirstAid","searchable":0,"quickSearch":0,"changeable":0,"style": { "type": "rect", "ratio":3.8}}, +{"key":"Sso","name":"🐌盘他┃三盘","type":3,"api":"csp_PanSso","searchable":1,"quickSearch":1,"changeable":0,"ext": {"Cloud-drive":"tvfan/Cloud-drive.txt","from":"4k|auto"}}, {"key":"夸搜","name":"🐟夸搜┃狸夸","type":3,"api":"csp_PanSearch","searchable":1,"quickSearch":1,"changeable":0,"ext": {"pan":"quark","Cloud-drive":"tvfan/Cloud-drive.txt","from":"4k|auto"}}, {"key":"YiSo","name":"😹易搜┃阿狸","type":3,"api":"csp_YiSo","searchable":1,"quickSearch":1,"changeable":0,"ext": {"Cloud-drive":"tvfan/Cloud-drive.txt","from":"4k|auto"}}, -//{"key":"UpYun","name":"😻Up搜┃阿狸","type":3,"api":"csp_UpYun","searchable":1,"quickSearch":1,"changeable":0,"ext": {"Cloud-drive":"tvfan/Cloud-drive.txt","from":"4k|auto"}}, {"key":"PanSearch","name":"🙀盘Se┃阿狸","type":3,"api":"csp_PanSearch","searchable":1,"quickSearch":1,"changeable":0,"ext": {"Cloud-drive":"tvfan/Cloud-drive.txt","from":"4k|auto"}}, {"key":"push_agent","name":"🛴手机┃推送","type":3,"api":"csp_Push","searchable":0,"quickSearch":0,"ext": {"Cloud-drive":"tvfan/Cloud-drive.txt","from":"4k|auto"}}, @@ -66,8 +65,7 @@ "logo":"https://fs-im-kefu.7moor-fs1.com/ly/4d2c3f00-7d4c-11e5-af15-41bf63ae4ea0/1716545739254/fc1b89e152cd4aa28d295107cb6c56c9.gif", "lives":[ -{"name":"live","type":0,"url":"https://mirror.ghproxy.com/raw.githubusercontent.com/ssili126/tv/main/itvlist.txt","playerType":1,"epg":"http://epg.51zmt.top:8000/api/diyp/?ch={name}&date={date}","logo": "https://live.fanmingming.com/tv/{name}.png"}, -{"name":"TV","type":0,"url":"https://mirror.ghproxy.com/https://raw.githubusercontent.com/wwb521/live/main/tv.m3u","playerType":1 }, -{"name":"IPV6","type":0,"url":"https://live.fanmingming.com/tv/m3u/ipv6.m3u","playerType":1 }] - +{"name":"LIVE","type":0,"url":"https://mirror.ghproxy.com/https://raw.githubusercontent.com/wwb521/live/main/tv.m3u","playerType":1,"epg":"http://epg.51zmt.top:8000/api/diyp/?ch={name}&date={date}","logo": "https://live.fanmingming.com/tv/{name}.png"}, +{"name":"IPV6","type":0,"url":"https://live.fanmingming.com/tv/m3u/ipv6.m3u","playerType":1 }, +{"name":"IPV4","type":0,"url":"https://mirror.ghproxy.com/raw.githubusercontent.com/ssili126/tv/main/itvlist.txt","playerType":1 }] } diff --git a/0827.json b/0827.json index 62c2f105..a8461835 100644 --- a/0827.json +++ b/0827.json @@ -1,5 +1,5 @@ { - "spider": "./jar/custom_spider.jar;md5;9420d75153250b3e5d548637b60f66ee", + "spider": "./jar/custom_spider.jar;md5;41c87635d7592069884a5dafa12acabe", "wallpaper": "http://饭太硬.top/深色壁纸/api.php", "sites": [ { diff --git a/FTY/drpy2.min.js b/FTY/drpy2.min.js index 4a792a49..7a9dc10c 100644 --- a/FTY/drpy2.min.js +++ b/FTY/drpy2.min.js @@ -1 +1,73 @@ -import cheerio from"assets://js/lib/cheerio.min.js";import"assets://js/lib/crypto-js.js";import 模板 from"https://fs-im-kefu.7moor-fs1.com/ly/4d2c3f00-7d4c-11e5-af15-41bf63ae4ea0/1720319227738/%E6%A8%A1%E6%9D%BF.txt";import{gbkTool}from"https://fs-im-kefu.7moor-fs1.com/ly/4d2c3f00-7d4c-11e5-af15-41bf63ae4ea0/1720319220141/gbk.txt";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")||(config.url=CryptoJS.AES.decrypt(config.url,key,{iv:iv,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8)),config.url}catch(e){return""}}function urlencode(e){return e=(e+"").toString(),encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")}function base64Encode(e){return CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(e))}function base64Decode(e){return CryptoJS.enc.Utf8.stringify(CryptoJS.enc.Base64.parse(e))}function md5(e){return CryptoJS.MD5(e).toString()}function encodeStr(e,t){if((t=t||"gbk").startsWith("gb")){e=gbkTool().encode(e)}return e}function decodeStr(e,t){if((t=t||"gbk").startsWith("gb")){e=gbkTool().decode(e)}return e}function getCryptoJS(){return'console.log("CryptoJS已装载");'}"function"!=typeof Object.assign&&(Object.assign=function(){for(var e=arguments[0],t=1;tthis.length)&&-1!==this.indexOf(e,t)}),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var r=Object(this),l=r.length>>>0;if(0===l)return!1;for(var o=0|t,s=Math.max(o>=0?o:l-Math.abs(o),0);s=o)return e;let s=e[l],a=e[o];if(t)try{s=s[t],a=a[t]}catch(e){}if(r&&"function"==typeof r)try{s=r(s),a=r(a)}catch(e){}if(a+="",(s+="").match(/(\d+)/)&&a.match(/(\d+)/)){Number(s.match(/(\d+)/)[1])>Number(a.match(/(\d+)/)[1])&&e.reverse()}return e}let VODS=[],VOD={},TABS=[],LISTS=[];function urljoin(e,t){return e=e||"",t=t||"",joinUrl(e,t)}globalThis.encodeUrl=urlencode,globalThis.urlencode=urlencode;var urljoin2=urljoin;const defaultParser={pdfh:pdfh,pdfa:pdfa,pd:pd};function pdfh2(e,t){let r=e;try{"string"!=typeof e&&(r=e.rr(e.ele).toString())}catch(e){print("html对象转文本发生了错误:"+e.message)}let l=defaultParser.pdfh(r,t),o=t.includes("&&")?t.split("&&").slice(-1)[0]:t.split(" ").slice(-1)[0];if(/style/.test(o.toLowerCase())&&/url\(/.test(l))try{l=(l=l.match(/url\((.*?)\)/)[1]).replace(/^['|"](.*)['|"]$/,"$1")}catch(e){}return l}function pdfa2(e,t){let r=e;try{"string"!=typeof e&&(r=e.rr(e.ele).toString())}catch(e){print("html对象转文本发生了错误:"+e.message)}return defaultParser.pdfa(r,t)}function pd2(e,t,r){let l=pdfh2(e,t);return void 0!==r&&r||(r=""),DOM_CHECK_ATTR.test(t)&&!SPECIAL_URL.test(l)&&(l=/http/.test(l)?l.substr(l.indexOf("http")):urljoin(MY_URL,l)),l}const parseTags={jsp:{pdfh:pdfh2,pdfa:pdfa2,pd:pd2},json:{pdfh(e,t){if(!t||!t.trim())return"";"string"==typeof e&&(e=JSON.parse(e)),(t=t.trim()).startsWith("$.")||(t="$."+t),t=t.split("||");for(let r of t){let t=cheerio.jp(r,e);if((t=Array.isArray(t)?t[0]||"":t||"")&&"string"!=typeof t&&(t=t.toString()),t)return t}return""},pdfa(e,t){if(!t||!t.trim())return"";"string"==typeof e&&(e=JSON.parse(e)),(t=t.trim()).startsWith("$.")||(t="$."+t);let r=cheerio.jp(t,e);return Array.isArray(r)&&Array.isArray(r[0])&&1===r.length?r[0]||[]:r||[]},pd(e,t){let r=parseTags.json.pdfh(e,t);return r?urljoin(MY_URL,r):r}},jq:{pdfh(e,t){if(!e||!t||!t.trim())return"";return t=t.trim(),defaultParser.pdfh(e,t)},pdfa(e,t){if(!e||!t||!t.trim())return[];t=t.trim();let r=defaultParser.pdfa(e,t);return print(`pdfa解析${t}=>${r.length}`),r},pd:(e,t,r)=>e&&t&&t.trim()?(t=t.trim(),r=r||MY_URL,defaultParser.pd(e,t,r)):""},getParse(e){return e.startsWith("jsp:")?this.jsp:e.startsWith("json:")?this.json:(e.startsWith("jq:"),this.jq)}},stringify=JSON.stringify,jsp=parseTags.jsp,jq=parseTags.jq;function readFile(e){e=e||"./uri.min.js";var t=os.open(e),r=new ArrayBuffer(1024),l=os.read(t,r,0,1024);console.log(l);let o=String.fromCharCode.apply(null,new Uint8Array(r));return console.log(o),o}function dealJson(e){try{(e=e.trim()).startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")||(e="{"+e.match(/.*?\{(.*)\}/m)[1]+"}")}catch(e){}try{e=JSON.parse(e)}catch(e){}return e}var OcrApi={api:OCR_API,classification:function(e){let t="";try{log("通过drpy_ocr验证码接口过验证..."),t=request(OCR_API,{data:{img:e},headers:{"User-Agent":PC_UA},method:"POST"},!0)||""}catch(e){log(`OCR识别验证码发生错误:${e.message}`)}return t}};function verifyCode(e){let t=0,r=getHome(e),l="";for(;t"set-cookie"===e.toLowerCase());l=e?s[e].split(";")[0]:""}console.log("cookie:"+l);let a=s.body,i=OcrApi.classification(a);console.log(`第${t+1}次验证码识别结果:${i}`);let n=`${r}/index.php/ajax/verify_check?type=search&verify=${i}`;console.log(n);let p=request(n,{headers:{Cookie:l,"User-Agent":MOBILE_UA},method:"POST"});if("ok"===(p=JSON.parse(p)).msg)return console.log(`第${t+1}次验证码提交成功`),l;"ok"!==p.msg&&t+1>=OCR_RETRY&&(l="")}catch(e){console.log(`第${t+1}次验证码提交失败:${e.message}`),t+1>=OCR_RETRY&&(l="")}t+=1}return l}function setItem(e,t){local.set(RKEY,e,t),console.log(`规则${RKEY}设置${e} => ${t}`)}function getItem(e,t){return local.get(RKEY,e)||t}function clearItem(e){local.delete(RKEY,e)}function getHome(e){if(!e)return"";let t=e.split("//");e=t[0]+"//"+t[1].split("/")[0];try{e=decodeURIComponent(e)}catch(e){}return e}function buildUrl(e,t){t=t||{},e.indexOf("?")<0&&(e+="?");let r=[],l=Object.keys(t);l.forEach(e=>{r.push(e+"="+t[e])});let o=r.join("&");return l.length>0&&!e.endsWith("?")&&(e+="&"),e+=o}function require(url){eval(request(url))}function request(e,t,r){if(r=r||!1,void 0!==t&&t&&t!=={}){let r=t.headers||{},l=Object.keys(r).map(e=>e.toLowerCase());l.includes("user-agent")||(r["User-Agent"]=MOBILE_UA),l.includes("referer")||(r.Referer=getHome(e)),t.headers=r}else{if(!fetch_params||!fetch_params.headers){let e={"User-Agent":MOBILE_UA};rule.headers&&Object.assign(e,rule.headers),fetch_params||(fetch_params={}),fetch_params.headers=e}fetch_params.headers.Referer||(fetch_params.headers.Referer=getHome(e)),t=fetch_params}if(rule.encoding&&"utf-8"!==rule.encoding&&!r&&(t.headers.hasOwnProperty("Content-Type")||t.headers.hasOwnProperty("content-type")||(t.headers["Content-Type"]="text/html; charset="+rule.encoding)),void 0!==t.body&&t.body&&"string"==typeof t.body?t.headers.hasOwnProperty("Content-Type")||t.headers.hasOwnProperty("content-type")||(t.headers["Content-Type"]="application/x-www-form-urlencoded; charset="+rule.encoding):void 0!==t.body&&t.body&&"object"==typeof t.body&&(t.data=t.body,delete t.body),!e)return t.withHeaders?"{}":"";t.toBase64&&(t.buffer=2,delete t.toBase64),console.log(JSON.stringify(t.headers)),console.log("request:"+e+`|method:${t.method||"GET"}|body:${t.body||""}`);let l=req(e,t),o=l.content||"";if(t.withHeaders){let e=l.headers;return e.body=o,JSON.stringify(e)}return o}function post(e,t){return t.method="POST",request(e,t)}function checkHtml(e,t,r){if(/\?btwaf=/.test(e)){let l=e.match(/btwaf(.*?)"/)[1];t=t.split("#")[0]+"?btwaf"+l,print("宝塔验证访问链接:"+t),e=request(t,r)}return e}function getCode(e,t){let r=request(e,t);return r=checkHtml(r,e,t)}function getHtml(e){let t={};rule.headers&&(t.headers=rule.headers);let r=getItem(RULE_CK,"");return r&&(t.headers&&!Object.keys(t.headers).map(e=>e.toLowerCase()).includes("cookie")?(log("历史无cookie,新增过验证后的cookie"),t.headers.Cookie=r):t.headers&&t.headers.cookie&&t.headers.cookie!==r?(t.headers.Cookie=r,log("历史有小写过期的cookie,更新过验证后的cookie")):t.headers&&t.headers.Cookie&&t.headers.Cookie!==r?(t.headers.Cookie=r,log("历史有大写过期的cookie,更新过验证后的cookie")):t.headers||(t.headers={Cookie:r},log("历史无headers,更新过验证后的含cookie的headers"))),getCode(e,t)}function homeParse(e){fetch_params=JSON.parse(JSON.stringify(rule_fetch_params));let t=[];if(e.class_name&&e.class_url){let r=e.class_name.split("&"),l=e.class_url.split("&"),o=Math.min(r.length,l.length);for(let e=0;e=3)try{let l=getHtml(e.MY_URL);if(l){homeHtmlCache=l;let o=_pdfa(l,r[0]);o&&o.length>0&&o.forEach((l,o)=>{try{let s=_pdfh(l,r[1]);if(e.cate_exclude&&new RegExp(e.cate_exclude).test(s))return;let a=_pd(l,r[2]);if(r.length>3&&r[3]){let e=new RegExp(r[3]);a=a.match(e)[1]}t.push({type_id:a.trim(),type_name:s.trim()})}catch(e){console.log(`分类列表定位第${o}个元素正常报错:${e.message}`)}})}}catch(e){console.log(e.message)}}let r={class:t=t.filter(t=>!e.cate_exclude||!new RegExp(e.cate_exclude).test(t.type_name))};return e.filter&&(r.filters=e.filter),console.log(JSON.stringify(r)),JSON.stringify(r)}function getPP(e,t,r,l){try{return"*"===e[t]&&r.length>l?r[l]:e[t]}catch(e){return""}}function homeVodParse(homeVodObj){fetch_params=JSON.parse(JSON.stringify(rule_fetch_params));let d=[];MY_URL=homeVodObj.homeUrl,console.log(MY_URL);let t1=(new Date).getTime(),p=homeVodObj.推荐;if(print("p:"+p),"*"===p&&rule.一级&&(p=rule.一级,homeVodObj.double=!1),!p||"string"!=typeof p)return"{}";p=p.trim();let pp=rule.一级.split(";");if(p.startsWith("js:")){const TYPE="home";var input=MY_URL;HOST=rule.host,eval(p.replace("js:","")),d=VODS}else{if(p=p.split(";"),!homeVodObj.double&&p.length<5)return"{}";if(homeVodObj.double&&p.length<6)return"{}";let e=getPP(p,0,pp,0),t=parseTags.getParse(e);_pdfa=t.pdfa,_pdfh=t.pdfh,_pd=t.pd;let r=e.startsWith("json:");e=e.replace(/^(jsp:|json:|jq:)/,"");let l=homeHtmlCache||getHtml(MY_URL);homeHtmlCache=void 0,r&&(l=dealJson(l));try{if(console.log("double:"+homeVodObj.double),homeVodObj.double){let t=_pdfa(l,e),r=getPP(p,1,pp,0),o=getPP(p,2,pp,1),s=getPP(p,3,pp,2),a=getPP(p,4,pp,3),i=getPP(p,5,pp,4),n=getPP(p,6,pp,5);for(let e of t){let t=_pdfa(e,r);for(let e of t)try{let t=_pdfh(e,o),r="";try{r=_pd(e,s)}catch(e){}let l="";try{l=_pdfh(e,a)}catch(e){}let u=[],c;for(let t of i.split("+")){let r=homeVodObj.detailUrl?_pdfh(e,t):_pd(e,t,MY_URL);u.push(r)}c=p.length>6&&p[6]?_pdfh(e,n):"";let f=u.join("$");"*"===rule.二级&&(f=f+"@@"+t+"@@"+r);let h={vod_name:t,vod_pic:r,vod_remarks:l,vod_content:c,vod_id:f};d.push(h)}catch(e){console.log("首页列表双层定位处理发生错误:"+e.message)}}}else{let t=_pdfa(l,e),r=getPP(p,1,pp,1),o=getPP(p,2,pp,2),s=getPP(p,3,pp,3),a=getPP(p,4,pp,4),i=getPP(p,5,pp,5);for(let e of t)try{let t=_pdfh(e,r),l="";try{l=_pd(e,o,MY_URL)}catch(e){}let n="";try{n=_pdfh(e,s)}catch(e){}let u=[],c;for(let t of a.split("+")){let r=homeVodObj.detailUrl?_pdfh(e,t):_pd(e,t,MY_URL);u.push(r)}c=p.length>5&&p[5]?_pdfh(e,i):"";let f=u.join("$");"*"===rule.二级&&(f=f+"@@"+t+"@@"+l);let h={vod_name:t,vod_pic:l,vod_remarks:n,vod_content:c,vod_id:f};d.push(h)}catch(e){console.log("首页列表单层定位处理发生错误:"+e.message)}}}catch(e){}}let t2=(new Date).getTime();return console.log("加载首页推荐耗时:"+(t2-t1)+"毫秒"),rule.图片来源&&d.forEach(e=>{e.vod_pic&&e.vod_pic.startsWith("http")&&(e.vod_pic=e.vod_pic+rule.图片来源)}),d.length>0&&print(d.slice(0,2)),JSON.stringify({list:d})}function categoryParse(cateObj){fetch_params=JSON.parse(JSON.stringify(rule_fetch_params));let p=cateObj.一级;if(!p||"string"!=typeof p)return"{}";let d=[],url=cateObj.url.replaceAll("fyclass",cateObj.tid);if(1===cateObj.pg&&url.includes("[")&&url.includes("]")?url=url.split("[")[1].split("]")[0]:cateObj.pg>1&&url.includes("[")&&url.includes("]")&&(url=url.split("[")[0]),rule.filter_url){/fyfilter/.test(url)?url=url.replace("fyfilter",rule.filter_url):(url.endsWith("&")||rule.filter_url.startsWith("&")||(url+="&"),url+=rule.filter_url);let e=cateObj.filter?cateObj.extend:{},t;if(rule.filter_def&&"object"==typeof rule.filter_def)try{if(Object.keys(rule.filter_def).length>0&&rule.filter_def.hasOwnProperty(cateObj.tid)){let t=rule.filter_def[cateObj.tid];if(t&&"object"==typeof t){let r=JSON.parse(JSON.stringify(t));e=Object.assign(r,e)}}}catch(e){print("合并不同分类对应的默认筛选出错:"+e.message)}t=cheerio.jinja2(url,{fl:e}),url=t}if(/fypage/.test(url))if(url.includes("(")&&url.includes(")")){let url_rep=url.match(/.*?\((.*)\)/)[1],cnt_page=url_rep.replaceAll("fypage",cateObj.pg),cnt_pg=eval(cnt_page);url=url.replaceAll(url_rep,cnt_pg).replaceAll("(","").replaceAll(")","")}else url=url.replaceAll("fypage",cateObj.pg);MY_URL=url,console.log(MY_URL),p=p.trim();const MY_CATE=cateObj.tid;if(p.startsWith("js:")){var MY_FL=cateObj.extend;const TYPE="cate";var input=MY_URL;const MY_PAGE=cateObj.pg;var desc="";eval(p.trim().replace("js:","")),d=VODS}else{if(p=p.split(";"),p.length<5)return"{}";let e=parseTags.getParse(p[0]);_pdfa=e.pdfa,_pdfh=e.pdfh,_pd=e.pd;let t=p[0].startsWith("json:");p[0]=p[0].replace(/^(jsp:|json:|jq:)/,"");try{let e=getHtml(MY_URL);if(e){t&&(e=dealJson(e));let r=_pdfa(e,p[0]);r.forEach(e=>{let t=p[4].split("+").map(t=>rule.detailUrl?_pdfh(e,t):_pd(e,t,MY_URL)).join("$"),r=rule.detailUrl?MY_CATE+"$"+t:t,l=_pdfh(e,p[1]).replace(/\n|\t/g,"").trim(),o=_pd(e,p[2],MY_URL);"*"===rule.二级&&(r=r+"@@"+l+"@@"+o),d.push({vod_id:r,vod_name:l,vod_pic:o,vod_remarks:_pdfh(e,p[3]).replace(/\n|\t/g,"").trim()})})}}catch(e){console.log(e.message)}}rule.图片来源&&d.forEach(e=>{e.vod_pic&&e.vod_pic.startsWith("http")&&(e.vod_pic=e.vod_pic+rule.图片来源)}),d.length>0&&print(d.slice(0,2));let pagecount=0;rule.pagecount&&"object"==typeof rule.pagecount&&rule.pagecount.hasOwnProperty(MY_CATE)&&(print(`MY_CATE:${MY_CATE},pagecount:${JSON.stringify(rule.pagecount)}`),pagecount=parseInt(rule.pagecount[MY_CATE]));let nodata={list:[{vod_name:"无数据,防无限请求",vod_id:"no_data",vod_remarks:"不要点,会崩的",vod_pic:"https://ghproxy.net/https://raw.githubusercontent.com/hjdhnx/dr_py/main/404.jpg"}],total:1,pagecount:1,page:1,limit:1},vod=d.length<1?JSON.stringify(nodata):JSON.stringify({page:parseInt(cateObj.pg),pagecount:pagecount||999,limit:20,total:999,list:d});return vod}function searchParse(searchObj){fetch_params=JSON.parse(JSON.stringify(rule_fetch_params));let d=[];if(!searchObj.searchUrl)return"{}";let p="*"===searchObj.搜索&&rule.一级?rule.一级:searchObj.搜索;if(!p||"string"!=typeof p)return"{}";p=p.trim();let pp=rule.一级.split(";"),url=searchObj.searchUrl.replaceAll("**",searchObj.wd);if(1===searchObj.pg&&url.includes("[")&&url.includes("]")&&!url.includes("#")?url=url.split("[")[1].split("]")[0]:searchObj.pg>1&&url.includes("[")&&url.includes("]")&&!url.includes("#")&&(url=url.split("[")[0]),/fypage/.test(url))if(url.includes("(")&&url.includes(")")){let url_rep=url.match(/.*?\((.*)\)/)[1],cnt_page=url_rep.replaceAll("fypage",searchObj.pg),cnt_pg=eval(cnt_page);url=url.replaceAll(url_rep,cnt_pg).replaceAll("(","").replaceAll(")","")}else url=url.replaceAll("fypage",searchObj.pg);if(MY_URL=url,console.log(MY_URL),p.startsWith("js:")){const TYPE="search",MY_PAGE=searchObj.pg,KEY=searchObj.wd;var input=MY_URL,detailUrl=rule.detailUrl||"";eval(p.trim().replace("js:","")),d=VODS}else{if(p=p.split(";"),p.length<5)return"{}";let e=getPP(p,0,pp,0),t=parseTags.getParse(e);_pdfa=t.pdfa,_pdfh=t.pdfh,_pd=t.pd;let r=e.startsWith("json:");e=e.replace(/^(jsp:|json:|jq:)/,"");try{let t=MY_URL.split(";").length>1?MY_URL.split(";")[1].toLowerCase():"get",l;if("post"===t){let e=MY_URL.split(";")[0].split("#"),t=e[0],r=e.length>1?e[1]:"";print(`post=》rurl:${t},params:${r}`);let o=JSON.parse(JSON.stringify(rule_fetch_params)),s={body:r};Object.assign(o,s),l=post(t,o)}else if("postjson"===t){let e=MY_URL.split(";")[0].split("#"),t=e[0],r=e.length>1?e[1]:"";print(`postjson-》rurl:${t},params:${r}`);try{r=JSON.parse(r)}catch(e){r="{}"}let o=JSON.parse(JSON.stringify(rule_fetch_params)),s={body:r};Object.assign(o,s),l=post(t,o)}else l=getHtml(MY_URL);if(l){if(/系统安全验证|输入验证码/.test(l)){let e=verifyCode(MY_URL);e?(console.log(`本次成功过验证,cookie:${e}`),setItem(RULE_CK,e)):console.log(`本次自动过搜索验证失败,cookie:${e}`),l=getHtml(MY_URL)}l.includes(searchObj.wd)||(console.log("搜索结果源码未包含关键字,疑似搜索失败,正为您打印结果源码"),console.log(l)),r&&(l=dealJson(l));let t=_pdfa(l,e),o=getPP(p,1,pp,1),s=getPP(p,2,pp,2),a=getPP(p,3,pp,3),i=getPP(p,4,pp,4),n=getPP(p,5,pp,5);t.forEach(e=>{let t,r=i.split("+").map(t=>rule.detailUrl?_pdfh(e,t):_pd(e,t,MY_URL)).join("$");t=p.length>5&&p[5]?_pdfh(e,n):"";let l=r,u=_pdfh(e,o).replace(/\n|\t/g,"").trim(),c=_pd(e,s,MY_URL);"*"===rule.二级&&(l=l+"@@"+u+"@@"+c);let f={vod_id:l,vod_name:u,vod_pic:c,vod_remarks:_pdfh(e,a).replace(/\n|\t/g,"").trim(),vod_content:t.replace(/\n|\t/g,"").trim()};d.push(f)})}}catch(e){return print("搜索发生错误:"+e.message),"{}"}}return rule.图片来源&&d.forEach(e=>{e.vod_pic&&e.vod_pic.startsWith("http")&&(e.vod_pic=e.vod_pic+rule.图片来源)}),JSON.stringify({page:parseInt(searchObj.pg),pagecount:10,limit:20,total:100,list:d})}function detailParse(detailObj){let t1=(new Date).getTime();fetch_params=JSON.parse(JSON.stringify(rule_fetch_params));let orId=detailObj.orId,vod_name="片名",vod_pic="",vod_id=orId;if("*"===rule.二级){let e=orId.split("@@");vod_name=e.length>1?e[1]:vod_name,vod_pic=e.length>2?e[2]:vod_pic}let vod={vod_id:vod_id,vod_name:vod_name,vod_pic:vod_pic,type_name:"类型",vod_year:"年份",vod_area:"地区",vod_remarks:"更新信息",vod_actor:"主演",vod_director:"导演",vod_content:"简介"},p=detailObj.二级,url=detailObj.url,detailUrl=detailObj.detailUrl,fyclass=detailObj.fyclass,tab_exclude=detailObj.tab_exclude,html=detailObj.html||"";if(MY_URL=url,detailObj.二级访问前)try{print(`尝试在二级访问前执行代码:${detailObj.二级访问前}`),eval(detailObj.二级访问前.trim().replace("js:",""))}catch(e){print(`二级访问前执行代码出现错误:${e.message}`)}if("*"===p)vod.vod_play_from="免费分享",vod.vod_remarks=detailUrl,vod.vod_actor="没有二级,只有一级链接直接嗅探播放",vod.vod_content=MY_URL,vod.vod_play_url="嗅探播放$"+MY_URL.split("@@")[0];else if("string"==typeof p&&p.trim().startsWith("js:")){const TYPE="detail";var input=MY_URL,play_url="";eval(p.trim().replace("js:","")),vod=VOD,console.log(JSON.stringify(vod))}else if(p&&"object"==typeof p){let tt1=(new Date).getTime(),_ps;html||(html=getHtml(MY_URL)),print(`二级${MY_URL}仅获取源码耗时:${(new Date).getTime()-tt1}毫秒`),p.is_json?(print("二级是json"),_ps=parseTags.json,html=dealJson(html)):p.is_jsp?(print("二级是jsp"),_ps=parseTags.jsp):p.is_jq?(print("二级是jq"),_ps=parseTags.jq):(print("二级默认jq"),_ps=parseTags.jq);let tt2=(new Date).getTime();if(print(`二级${MY_URL}获取并装载源码耗时:${tt2-tt1}毫秒`),_pdfa=_ps.pdfa,_pdfh=_ps.pdfh,_pd=_ps.pd,p.title){let e=p.title.split(";");vod.vod_name=_pdfh(html,e[0]).replace(/\n|\t/g,"").trim();let t=e.length>1?_pdfh(html,e[1]).replace(/\n|\t/g,"").replace(/ /g,"").trim():"";vod.type_name=t||vod.type_name}if(p.desc)try{let e=p.desc.split(";");vod.vod_remarks=_pdfh(html,e[0]).replace(/\n|\t/g,"").trim(),vod.vod_year=e.length>1?_pdfh(html,e[1]).replace(/\n|\t/g,"").trim():"",vod.vod_area=e.length>2?_pdfh(html,e[2]).replace(/\n|\t/g,"").trim():"",vod.vod_actor=e.length>3?_pdfh(html,e[3]).replace(/\n|\t/g,"").trim():"",vod.vod_director=e.length>4?_pdfh(html,e[4]).replace(/\n|\t/g,"").trim():""}catch(e){}if(p.content)try{let e=p.content.split(";");vod.vod_content=_pdfh(html,e[0]).replace(/\n|\t/g,"").trim()}catch(e){}if(p.img)try{let e=p.img.split(";");vod.vod_pic=_pd(html,e[0],MY_URL)}catch(e){}let vod_play_from="$$$",playFrom=[];if(p.重定向&&p.重定向.startsWith("js:")&&(print("开始执行重定向代码:"+p.重定向),html=eval(p.重定向.replace("js:",""))),p.tabs){if(p.tabs.startsWith("js:")){print("开始执行tabs代码:"+p.tabs);var input=MY_URL;eval(p.tabs.replace("js:","")),playFrom=TABS}else{let e=p.tabs.split(";")[0],t=_pdfa(html,e);console.log(t.length);let r=p.tab_text||"body&&Text",l={};for(let e of t){let t=_pdfh(e,r).trim();console.log(t),tab_exclude&&new RegExp(tab_exclude).test(t)||(l.hasOwnProperty(t)?l[t]+=1:l[t]=1,l[t]>1&&(t+=Number(l[t]-1)),playFrom.push(t))}}console.log(JSON.stringify(playFrom))}else playFrom=["免费分享"];vod.vod_play_from=playFrom.join(vod_play_from);let vod_play_url="$$$",vod_tab_list=[];if(p.lists)if(p.lists.startsWith("js:")){print("开始执行lists代码:"+p.lists);try{var input=MY_URL,play_url="";eval(p.lists.replace("js:",""));for(let e in LISTS)if(LISTS.hasOwnProperty(e))try{LISTS[e]=LISTS[e].map(e=>e.split("$").slice(0,2).join("$"))}catch(e){print("格式化LISTS发生错误:"+e.message)}vod_play_url=LISTS.map(e=>e.join("#")).join(vod_play_url)}catch(e){print("js执行lists: 发生错误:"+e.message)}}else{let e=p.list_text||"body&&Text",t=p.list_url||"a&&href",r=p.tabs.trim().startsWith("js:");for(let l=0;l1&&!r?p.tabs.split(";")[1]:"",a=p.lists.replaceAll("#idv",o).replaceAll("#id",l);s=s.replaceAll("#idv",o).replaceAll("#id",l);let i=s?_pdfh(html,s):o;console.log(i);let n=[],u=(new Date).getTime();if("function"==typeof pdfl)n=pdfl(html,a,e,t,MY_URL);else{let r=[];try{r=_pdfa(html,a),console.log("len(vodList):"+r.length)}catch(e){}for(let l=0;l0&&(n=forceOrder(n,"",e=>e.split("$")[0]),console.log(`drpy影响性能代码共计列表数循环次数:${n.length},耗时:${(new Date).getTime()-u}毫秒`));let c=n.join("#");vod_tab_list.push(c)}vod_play_url=vod_tab_list.join(vod_play_url)}vod.vod_play_url=vod_play_url}rule.图片来源&&vod.vod_pic&&vod.vod_pic.startsWith("http")&&(vod.vod_pic=vod.vod_pic+rule.图片来源),(!vod.vod_id||vod_id.includes("$")&&vod.vod_id!==vod_id)&&(vod.vod_id=vod_id);let t2=(new Date).getTime();return console.log(`加载二级界面${MY_URL}耗时:${t2-t1}毫秒`),vod=vodDeal(vod),void 0!==vod.type_name?vod.type_name=vod.type_name+" | 免费分享":vod.type_name="免费分享",JSON.stringify({list:[vod]})}function get_tab_index(e){let t={};return e.vod_play_from.split("$$$").forEach((e,r)=>{t[e]=r}),t}function vodDeal(e){let t=e.vod_play_from.split("$$$"),r=e.vod_play_url.split("$$$"),l=t,o=t,s=t,a=t,i=r;if(rule.tab_remove&&rule.tab_remove.length>0||rule.tab_order&&rule.tab_order.length>0){let s=get_tab_index(e);if(rule.tab_remove&&rule.tab_remove.length>0&&(a=l=t.filter(e=>!rule.tab_remove.includes(e))),rule.tab_order&&rule.tab_order.length>0){let e=rule.tab_order;a=o=l.sort((t,r)=>(-1===e.indexOf(t)?9999:e.indexOf(t))-(-1===e.indexOf(r)?9999:e.indexOf(r)))}i=a.map(e=>r[s[e]])}return rule.tab_rename&&"object"==typeof rule.tab_rename&Object.keys(rule.tab_rename).length>0&&(a=s=a.map(e=>rule.tab_rename[e]||e)),e.vod_play_from=a.join("$$$"),e.vod_play_url=i.join("$$$"),e}function tellIsJx(e){try{return!/\.(m3u8|mp4|m4a)$/.test(e.split("?")[0])&&是否正版(e)?1:0}catch(e){return 1}}function playParse(playObj){if(fetch_params=JSON.parse(JSON.stringify(rule_fetch_params)),MY_URL=playObj.url,!/http/.test(MY_URL))try{MY_URL=base64Decode(MY_URL)}catch(e){}MY_URL=decodeURIComponent(MY_URL);var input=MY_URL;let common_play={parse:1,url:input,jx:tellIsJx(input)},lazy_play;if(rule.play_parse&&rule.lazy)if(rule.play_parse&&rule.lazy&&"string"==typeof rule.lazy)try{let lazy_code=rule.lazy.replace("js:","").trim();print("开始执行js免嗅=>"+lazy_code),eval(lazy_code),lazy_play="object"==typeof input?input:{parse:1,jx:tellIsJx(input),url:input}}catch(e){print("js免嗅错误:"+e.message),lazy_play=common_play}else lazy_play=common_play;else lazy_play=common_play;if(Array.isArray(rule.play_json)&&rule.play_json.length>0){let e=lazy_play.url;for(let t of rule.play_json)if(t.re&&("*"===t.re||e.match(new RegExp(t.re)))&&t.json&&"object"==typeof t.json){let e=t.json;lazy_play=Object.assign(lazy_play,e);break}}else if(rule.play_json&&!Array.isArray(rule.play_json)){let e={jx:1,parse:1};lazy_play=Object.assign(lazy_play,e)}else if(!rule.play_json){let e={jx:0,parse:1};lazy_play=Object.assign(lazy_play,e)}return console.log(JSON.stringify(lazy_play)),JSON.stringify(lazy_play)}function proxyParse(proxyObj){var input=proxyObj.params;if(!proxyObj.proxy_rule)return[404,"text/plain","Not Found"];log("准备执行本地代理规则:\n"+proxyObj.proxy_rule);try{return eval(proxyObj.proxy_rule),input&&input!==proxyObj.params&&Array.isArray(input)&&3===input.length?input:[404,"text/plain","Not Found"]}catch(e){return[500,"text/plain","代理规则错误:"+e.message]}}function isVideoParse(isVideoObj){var input=isVideoObj.url;if(!isVideoObj.t){let e=new RegExp(isVideoObj.isVideo,"i");return e.test(input)}try{return eval(isVideoObj.isVideo),"boolean"==typeof input&&input}catch(e){return log("执行嗅探规则发生错误:"+e.message),!1}}function init(ext){console.log("init");try{let muban=模板.getMubans();if("object"==typeof ext)rule=ext;else if("string"==typeof ext)if(ext.startsWith("http")){let js=request(ext,{method:"GET"});js.startsWith("**")&&(js=base64Decode(js.substring(2))),js&&eval(js.replace("var rule","rule"))}else eval(ext.replace("var rule","rule"));rule.模板&&muban.hasOwnProperty(rule.模板)&&(print("继承模板:"+rule.模板),rule=Object.assign(muban[rule.模板],rule));let rule_cate_excludes=(rule.cate_exclude||"").split("|").filter(e=>e.trim()),rule_tab_excludes=(rule.tab_exclude||"").split("|").filter(e=>e.trim());if(rule_cate_excludes=rule_cate_excludes.concat(CATE_EXCLUDE.split("|").filter(e=>e.trim())),rule_tab_excludes=rule_tab_excludes.concat(TAB_EXCLUDE.split("|").filter(e=>e.trim())),rule.cate_exclude=rule_cate_excludes.join("|"),rule.tab_exclude=rule_tab_excludes.join("|"),rule.host=(rule.host||"").rstrip("/"),HOST=rule.host,rule.hostJs){console.log("检测到hostJs,准备执行...");try{eval(rule.hostJs),rule.host=HOST.rstrip("/")}catch(e){console.log(`执行${rule.hostJs}获取host发生错误:`+e.message)}}if(rule.url=rule.url||"",rule.double=rule.double||!1,rule.homeUrl=rule.homeUrl||"",rule.detailUrl=rule.detailUrl||"",rule.searchUrl=rule.searchUrl||"",rule.homeUrl=rule.host&&rule.homeUrl?urljoin(rule.host,rule.homeUrl):rule.homeUrl||rule.host,rule.detailUrl=rule.host&&rule.detailUrl?urljoin(rule.host,rule.detailUrl):rule.detailUrl,rule.二级访问前=rule.二级访问前||"",rule.url.includes("[")&&rule.url.includes("]")){let e=rule.url.split("[")[0],t=rule.url.split("[")[1].split("]")[0];rule.url=rule.host&&rule.url?urljoin(rule.host,e)+"["+urljoin(rule.host,t)+"]":rule.url}else rule.url=rule.host&&rule.url?urljoin(rule.host,rule.url):rule.url;if(rule.searchUrl.includes("[")&&rule.searchUrl.includes("]")&&!rule.searchUrl.includes("#")){let e=rule.searchUrl.split("[")[0],t=rule.searchUrl.split("[")[1].split("]")[0];rule.searchUrl=rule.host&&rule.searchUrl?urljoin(rule.host,e)+"["+urljoin(rule.host,t)+"]":rule.searchUrl}else rule.searchUrl=rule.host&&rule.searchUrl?urljoin(rule.host,rule.searchUrl):rule.searchUrl;if(rule.timeout=rule.timeout||5e3,rule.encoding=rule.编码||rule.encoding||"utf-8",rule.search_encoding=rule.搜索编码||rule.search_encoding||"",rule.图片来源=rule.图片来源||"",rule.play_json=rule.hasOwnProperty("play_json")?rule.play_json:[],rule.pagecount=rule.hasOwnProperty("pagecount")?rule.pagecount:{},rule.proxy_rule=rule.hasOwnProperty("proxy_rule")?rule.proxy_rule:"",rule.sniffer=rule.hasOwnProperty("sniffer")?rule.sniffer:"",rule.sniffer=!(!rule.sniffer||"0"===rule.sniffer||"false"===rule.sniffer),rule.isVideo=rule.hasOwnProperty("isVideo")?rule.isVideo:"",rule.tab_remove=rule.hasOwnProperty("tab_remove")?rule.tab_remove:[],rule.tab_order=rule.hasOwnProperty("tab_order")?rule.tab_order:[],rule.tab_rename=rule.hasOwnProperty("tab_rename")?rule.tab_rename:{},rule.headers&&"object"==typeof rule.headers)try{let header_keys=Object.keys(rule.headers);for(let k of header_keys)if("user-agent"===k.toLowerCase()){let v=rule.headers[k];console.log(v),["MOBILE_UA","PC_UA","UC_UA","IOS_UA","UA"].includes(v)&&(rule.headers[k]=eval(v))}else if("cookie"===k.toLowerCase()){let e=rule.headers[k];if(e&&e.startsWith("http")){console.log(e);try{e=fetch(e),console.log(e),rule.headers[k]=e}catch(t){console.log(`从${e}获取cookie发生错误:`+t.message)}}}}catch(e){console.log("处理headers发生错误:"+e.message)}rule_fetch_params={headers:rule.headers||!1,timeout:rule.timeout,encoding:rule.encoding},oheaders=rule.headers||{},RKEY="undefined"!=typeof key&&key?key:"drpy_"+(rule.title||rule.host),pre(),init_test()}catch(e){console.log("init_test发生错误:"+e.message)}}fetch=request,print=function(e){if("object"==typeof(e=e||"")&&Object.keys(e).length>0)try{e=JSON.stringify(e),console.log(e)}catch(t){return void console.log(typeof e+":"+e.length)}else"object"==typeof e&&Object.keys(e).length<1?console.log("null object"):console.log(e)},log=print;let homeHtmlCache=void 0;function home(e){return console.log("home"),homeParse({filter:rule.filter||!1,MY_URL:rule.homeUrl,class_name:rule.class_name||"",class_url:rule.class_url||"",class_parse:rule.class_parse||"",cate_exclude:rule.cate_exclude})}function homeVod(e){return console.log("homeVod"),homeVodParse({"推荐":rule.推荐,double:rule.double,homeUrl:rule.homeUrl,detailUrl:rule.detailUrl})}function category(e,t,r,l){return categoryParse({url:rule.url,"一级":rule.一级,tid:e,pg:parseInt(t),filter:r,extend:l})}function detail(e){let t=e,r="";if(log("orId:"+t),e.indexOf("$")>-1){let t=e.split("$");r=t[0],e=t[1]}let l,o=e.split("@@")[0];return detailParse({orId:t,url:l=o.startsWith("http")||o.includes("/")?o.includes("/")?urljoin(rule.homeUrl,o):o:rule.detailUrl.replaceAll("fyid",o).replaceAll("fyclass",r),"二级":rule.二级,"二级访问前":rule.二级访问前,detailUrl:o,fyclass:r,tab_exclude:rule.tab_exclude})}function play(e,t,r){return playParse({url:t,flag:e,flags:r})}function search(e,t,r){return rule.search_encoding?"utf-8"!==rule.search_encoding.toLowerCase()&&(e=encodeStr(e,rule.search_encoding)):rule.encoding&&"utf-8"!==rule.encoding.toLowerCase()&&(e=encodeStr(e,rule.encoding)),searchParse({searchUrl:rule.searchUrl,"搜索":rule.搜索,wd:e,pg:r||1,quick:t})}function proxy(e){return rule.proxy_rule&&rule.proxy_rule.trim()&&(rule.proxy_rule=rule.proxy_rule.trim()),rule.proxy_rule.startsWith("js:")&&(rule.proxy_rule=rule.proxy_rule.replace("js:","")),proxyParse({params:e,proxy_rule:rule.proxy_rule})}function sniffer(){let e=rule.sniffer||!1;return e&&log("开始执行辅助嗅探代理规则..."),e}function isVideo(e){let t,r=0;rule.isVideo&&rule.isVideo.trim()&&(t=rule.isVideo.trim()),t.startsWith("js:")&&(t=t.replace("js:",""),r=1);let l=isVideoParse({url:e,isVideo:t,t:r});return l&&log("成功执行辅助嗅探规则并检测到视频地址:\n"+rule.isVideo),l}function DRPY(){return{init:init,home:home,homeVod:homeVod,category:category,detail:detail,play:play,search:search,proxy:proxy,sniffer:sniffer,isVideo:isVideo}}export default{init:init,home:home,homeVod:homeVod,category:category,detail:detail,play:play,search:search,proxy:proxy,sniffer:sniffer,isVideo:isVideo,DRPY:DRPY}; +import cheerio from"assets://js/lib/cheerio.min.js";import"assets://js/lib/crypto-js.js";import"./node-rsa.js";import"./pako.min.js";import 模板 from"./模板.js";import{gbkTool}from"./gbk.js";import"./json5.js";import"./jinja.js";const _jinja2=cheerio.jinja2;cheerio.jinja2=function(template,obj){try{return jinja.render(template,obj)}catch(e){console.log("新的jinja2库渲染失败,换回原始cheerio:"+e.message);return _jinja2(template,obj)}};function init_test(){console.log("init_test_start");console.log("当前版本号:"+VERSION);console.log("本地代理地址:"+getProxyUrl());console.log(RKEY);console.log(JSON.stringify(rule));console.log("init_test_end")}function ocr_demo_test(){let img_base64=`iVBORw0KGgoAAAANSUhEUgAAAIAAAAAoBAMAAADEX+97AAAAG1BMVEXz+/4thQTa7N6QwIFFkyNeokKozqDB3b93sWHFR+MEAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABN0lEQVRIie2TQU+DQBCFt9vScvQpxR4xrcSjJCZ67JDGXsX+AdR4B3vpsSYm/m2HXaRLmuySepR3Gdidb/btDAjRq5dT96eCMlfBuzi1QLZUoZy2yz5sOvI+9iomaPEZ6nWnEtxqIyiM1RcAy44GNDhBXUjot/VVNweV1ah68FqWRyjKIOqAcyYF6rGcmpYnHzGt3fycNoMw0d3/THFu7hFSJ/8OXO6iTM8/KSg09obAzIHLO250LgQ0txOZSfgrV4Exdw98uGycJ0ErAeExZGhOmFHV9zHO6qVSj0MpLq7xZON56o++MjlsEgfVhbQWWME+xQX7J4V6zfi9A1Ly9rP1BvEXp+BbVJ/M77n+wfOIDVp51pZ4iBxvmj9AGrtvry6emwfKnVkW+ZRKd5ZNMvob36vXP9YPDmQki8QiCFAAAAAASUVORK5CYII=`;OcrApi.api=OCR_API;let code=OcrApi.classification(img_base64);log("测试验证码图片的ocr识别结果为:"+code)}function rsa_demo_test(){let t1=(new Date).getTime();let pkcs1_public=` +-----BEGIN RSA PUBLIC KEY----- +MEgCQQCrI0pQ/ERRpJ3Ou190XJedFq846nDYP52rOtXyDxlFK5D3p6JJu2RwsKwy +lsQ9xY0xYPpRZUZKMEeR7e9gmRNLAgMBAAE= +-----END RSA PUBLIC KEY----- +`.trim();let pkcs1_public_pem=` +MEgCQQCrI0pQ/ERRpJ3Ou190XJedFq846nDYP52rOtXyDxlFK5D3p6JJu2RwsKwy +lsQ9xY0xYPpRZUZKMEeR7e9gmRNLAgMBAAE= +`.trim();let pkcs8_public=` +-----BEGIN PUBLIC KEY----- +MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKsjSlD8RFGknc67X3Rcl50WrzjqcNg/ +nas61fIPGUUrkPenokm7ZHCwrDKWxD3FjTFg+lFlRkowR5Ht72CZE0sCAwEAAQ== +-----END PUBLIC KEY-----`.trim();let pkcs8_public_pem=` +MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKsjSlD8RFGknc67X3Rcl50WrzjqcNg/ +nas61fIPGUUrkPenokm7ZHCwrDKWxD3FjTFg+lFlRkowR5Ht72CZE0sCAwEAAQ== +`.trim();let pkcs1_private=` +-----BEGIN RSA PRIVATE KEY----- +MIIBOAIBAAJBAKsjSlD8RFGknc67X3Rcl50WrzjqcNg/nas61fIPGUUrkPenokm7 +ZHCwrDKWxD3FjTFg+lFlRkowR5Ht72CZE0sCAwEAAQI/b6OV1z65UokQaMvSeRXt +0Yv6wiYtduQI9qpq5nzy/ytaqsbBfClNTi/HifKPKxlRouWFkc518EQI8LBxoarJ +AiEA4DaONMplV8PQNa3TKn2F+SDEvLOCjdL0kHKdN90Ti28CIQDDZnTBaHgZwZbA +hS7Bbf5yvwjWMhO6Y7l04/Qm7R+35QIgPuQuqXIoUSD080mp1N5WyRW++atksIF+ +5lGv9e6GP/MCICnj8y/rl6Pd7tXDN6zcSeqLrfdNsREKhB3dKOCXgW9JAiAFYtFS +EJNBXVRTK42SNsZ2hJ/9xLwOwnH2epT8Q43s3Q== +-----END RSA PRIVATE KEY----- +`.trim();let pkcs8_private=` +-----BEGIN PRIVATE KEY----- +MIIBUgIBADANBgkqhkiG9w0BAQEFAASCATwwggE4AgEAAkEAqyNKUPxEUaSdzrtf +dFyXnRavOOpw2D+dqzrV8g8ZRSuQ96eiSbtkcLCsMpbEPcWNMWD6UWVGSjBHke3v +YJkTSwIDAQABAj9vo5XXPrlSiRBoy9J5Fe3Ri/rCJi125Aj2qmrmfPL/K1qqxsF8 +KU1OL8eJ8o8rGVGi5YWRznXwRAjwsHGhqskCIQDgNo40ymVXw9A1rdMqfYX5IMS8 +s4KN0vSQcp033ROLbwIhAMNmdMFoeBnBlsCFLsFt/nK/CNYyE7pjuXTj9CbtH7fl +AiA+5C6pcihRIPTzSanU3lbJFb75q2SwgX7mUa/17oY/8wIgKePzL+uXo93u1cM3 +rNxJ6out902xEQqEHd0o4JeBb0kCIAVi0VIQk0FdVFMrjZI2xnaEn/3EvA7CcfZ6 +lPxDjezd +-----END PRIVATE KEY----- +`.trim();let data=` +NodeRsa +这是node-rsa 现在修改集成在drpy里使用`.trim();let encryptedWithPublic=NODERSA.encryptRSAWithPublicKey(data,pkcs1_public,{outputEncoding:"base64",options:{environment:"browser",encryptionScheme:"pkcs1_oaep"}});console.log("公钥加密");console.log(encryptedWithPublic);let decryptedWithPrivate=NODERSA.decryptRSAWithPrivateKey(encryptedWithPublic,pkcs1_private,{options:{environment:"browser",encryptionScheme:"pkcs1_oaep"}});console.log("私钥解密");console.log(decryptedWithPrivate);let pkcs1_sha256_sign=NODERSA.sign("1",pkcs1_private,{outputEncoding:"base64",options:{environment:"browser",encryptionScheme:"pkcs1",signingScheme:"pkcs1-sha256"}});console.log("pkcs1_sha256_sign");console.log(pkcs1_sha256_sign);let pkcs1_sha256_sign_verify=NODERSA.verify("1","Oulx2QrgeipKYBtqEDqFb2s/+ndk2cGQxO4CkhU7iBM1vyNmmvqubpsmeoUuN3waGrYZLknSEdwBkfv0tUMpFQ==",pkcs1_private,{options:{environment:"browser",encryptionScheme:"pkcs1",signingScheme:"pkcs1-sha256"}});console.log("pkcs1_sha256_sign_verify");console.log(pkcs1_sha256_sign_verify);let pkcs1_oaep_sha256=NODERSA.encryptRSAWithPublicKey(data,`-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEA5KOq1gRNyllLNWKQy8sGpZE3Q1ULLSmzZw+eaAhj9lvqn7IsT1du +SYn08FfoOA2qMwtz+1O2l1mgzNoSVCyVpVabnTG+C9XKeZXAnJHd8aYA7l7Sxhdm +kte+iymYZ0ZBPzijo8938iugtVvqi9UgDmnY3u/NlQDqiL5BGqSxSTd/Sgmy3zD8 +PYzEa3wD9vehQ5fZZ45vKIq8GNVh2Z8+IGO85FF1OsN7+b2yGJa/FmDDNn0+HP+m +PfI+kYBqEVpo0Ztbc3UdxgFwGC8O1n8AQyriwHnSOtIiuBH62J/7qyC/3LEAApRb +Dd9YszqzmODjQUddZKHmvc638VW+azc0EwIDAQAB +-----END RSA PUBLIC KEY----- +`,{outputEncoding:"base64",options:{environment:"browser",encryptionScheme:{scheme:"pkcs1_oaep",hash:"sha256"}}});console.log("pkcs1_oaep_sha256");console.log(pkcs1_oaep_sha256);decryptedWithPrivate=NODERSA.decryptRSAWithPrivateKey("kSZesAAyYh2hdsQnYMdGqb6gKAzTauBKouvBzWcc4+F8RvGd0nwO6mVkUMVilPgUuNxjEauHayHiY8gI3Py45UI3+km0rSGyHrS6dHiHgCkMejXHieglYzAB0IxX3Jkm4z/66bdB/D+GFy0oct5fGCMI1UHPjEAYOsazJDa8lBFNbjiWFeb/qiZtIx3vGM7KYPAZzyRf/zPbbQ8zy9xOmRuOl5nnIxgo0Okp3KO/RIPO4GZOSBA8f2lx1UtNwwrXAMpcNavtoqHVcjJ/9lcotXYQFrn5b299pSIRf2gVm8ZJ31SK6Z8cc14nKtvgnmsgClDzIXJ1o1RcDK+knVAySg==",`-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA5KOq1gRNyllLNWKQy8sGpZE3Q1ULLSmzZw+eaAhj9lvqn7Is +T1duSYn08FfoOA2qMwtz+1O2l1mgzNoSVCyVpVabnTG+C9XKeZXAnJHd8aYA7l7S +xhdmkte+iymYZ0ZBPzijo8938iugtVvqi9UgDmnY3u/NlQDqiL5BGqSxSTd/Sgmy +3zD8PYzEa3wD9vehQ5fZZ45vKIq8GNVh2Z8+IGO85FF1OsN7+b2yGJa/FmDDNn0+ +HP+mPfI+kYBqEVpo0Ztbc3UdxgFwGC8O1n8AQyriwHnSOtIiuBH62J/7qyC/3LEA +ApRbDd9YszqzmODjQUddZKHmvc638VW+azc0EwIDAQABAoIBADZ/QGgUzInvsLp/ +zO2WbfYm39o/uhNAvk9RbLt1TIZbMFhyOpeKynHi3Swwd9xsfWX/U9zS/lGi/m31 +iKrhmaW4OA1G3vqpMcK7TBbFufYwUEaA+ZJX344euH8pIfdzyneMQ4z3Far2dS7l +QsmjuilVV2kEFadveXewiYoVOWCu00w6bN8wy2SIHlQn+kIL6HQhWz12iKKflIKu +eGRdzLHsKmBt6WbY1Wuhx7HU0fAKdlBDPxCHNlI+kybUYE9o5C2vJiaVM5wqJBgZ +8Dz8kt1QbLJ910JoLXkLVQ8uC8NJKQwFtqQjTGPnEq0+wbgz6Ij599rKZkwW/xq9 +l6KoUiECgYEA6Ah42tVdkNW047f03xVYXFH96RgorHRS36mR8Y+ONUq1fwKidovC +WjwVujt4OPf3l1W6iyn/F6cu/bsmvPrSc3HTN0B1V31QK4OjgetxQ2PSbTldH02J +NPzkt+v+cPxXpx/P5mgt7Weefw5txU547KubGrHUV5rBKFtIx9pj16MCgYEA/EF0 +o19+D24DZAPwlDS5VbEd7FStnwY4oQ5PqbuNOSbSJLMWU0AqzXcRokp8UTyCZ0X3 +ATkS1REq97kShCuR+npTR6a6DlY7sdpPI1SMLNajgB2tkx0EOzX+PfNIbHUd4jpJ +I0ZMAHv/OOtkzQHDaeTWBTrzsWm6/nTiykfduNECgYEA46AMD4HpPECqKAs66e5i +tI6q7JSKskObWVdcmQEfnSAhVOwcvPb2Ptda6UuV8S0xcwDi88rLOUUFUFzc79+P +vTkY38cYVi/VChsluDpk7ptqv0PbGu5Rf+3n4pZdEjI7OvR2W64wAAn67uIUxc7p +yiO/ET0K9rYWb6S9jXGtKMkCgYEA2kPAqoO7zZoBMQ7/oR0lp/HC1HRIbiqx4RlC +8Lgpb+QZPEwA6zPAVVvLVENi4d+bbcRp/xLlKpraNNJcJSSWAMbLPFoU7sbKjA87 +HnTPfRSTEA2d3Ibk3F7Rh8TzS3Ti0JZiJjVzGZAwu41iAMifzwaD8K6boUy80eNN +QH2CaaECgYBUsLYvC/MiYg3w+LGOONuQongoVUXjGqnw2bjVa9RK7lwRdXPUqJ51 +MpVO98IkoLvGSI/0sGNP3GKNhC+eMGjJAVwFyEuOn+JsmMv9Y9uStIVi5tIHIhKw +m7mp8il0kaftHdSxTbspG3tZ2fjIiFIZkLEOmRpd7ogWumgOajzUdA== +-----END RSA PRIVATE KEY-----`,{options:{environment:"browser",encryptionScheme:"pkcs1_oaep"}});console.log("decryptedWithPrivate");console.log(decryptedWithPrivate);(()=>{let key=new NODERSA.NodeRSA({b:1024});key.setOptions({encryptionScheme:"pkcs1"});let text=`你好drpy node-ras`;let encrypted=key.encrypt(text,"base64");console.log("encrypted: ",encrypted);const decrypted=key.decrypt(encrypted,"utf8");console.log("decrypted: ",decrypted)})();let t2=(new Date).getTime();console.log("rsa_demo_test 测试耗时:"+(t2-t1)+"毫秒")}function pre(){if(typeof rule.预处理==="string"&&rule.预处理&&rule.预处理.trim()){let code=rule.预处理.trim();console.log("执行预处理代码:"+code);if(code.startsWith("js:")){code=code.replace("js:","")}try{eval(code)}catch(e){console.log(`预处理执行失败:${e.message}`)}}}let rule={};let vercode=typeof pdfl==="function"?"drpy2.1":"drpy2";const VERSION=vercode+" 3.9.51beta2 20240711";const MOBILE_UA="Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.91 Mobile Safari/537.36";const 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";const UA="Mozilla/5.0";const 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";const 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";const RULE_CK="cookie";const CATE_EXCLUDE="首页|留言|APP|下载|资讯|新闻|动态";const TAB_EXCLUDE="猜你|喜欢|下载|剧情|榜|评论";const OCR_RETRY=3;const OCR_API="https://api.nn.ci/ocr/b64/text";if(typeof MY_URL==="undefined"){var MY_URL}var HOST;var RKEY;var fetch;var print;var log;var rule_fetch_params;var fetch_params;var oheaders;var _pdfh;var _pdfa;var _pd;const DOM_CHECK_ATTR=/(url|src|href|-original|-src|-play|-url|style)$/;const SPECIAL_URL=/^(ftp|magnet|thunder|ws):/;const NOADD_INDEX=/:eq|:lt|:gt|:first|:last|^body$|^#/;const URLJOIN_ATTR=/(url|src|href|-original|-src|-play|-url|style)$|^(data-|url-|src-)/;const SELECT_REGEX=/:eq|:lt|:gt|#/g;const SELECT_REGEX_A=/:eq|:lt|:gt/g;const $js={toString(func){let strfun=func.toString();return strfun.replace(/^\(\)(\s+)?=>(\s+)?\{/,"js:").replace(/\}$/,"")}};function window_b64(){let b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";let base64DecodeChars=new Array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1);function btoa(str){var out,i,len;var c1,c2,c3;len=str.length;i=0;out="";while(i>2);out+=b64map.charAt((c1&3)<<4);out+="==";break}c2=str.charCodeAt(i++);if(i==len){out+=b64map.charAt(c1>>2);out+=b64map.charAt((c1&3)<<4|(c2&240)>>4);out+=b64map.charAt((c2&15)<<2);out+="=";break}c3=str.charCodeAt(i++);out+=b64map.charAt(c1>>2);out+=b64map.charAt((c1&3)<<4|(c2&240)>>4);out+=b64map.charAt((c2&15)<<2|(c3&192)>>6);out+=b64map.charAt(c3&63)}return out}function atob(str){var c1,c2,c3,c4;var i,len,out;len=str.length;i=0;out="";while(i>4);do{c3=str.charCodeAt(i++)&255;if(c3==61)return out;c3=base64DecodeChars[c3]}while(i>2);do{c4=str.charCodeAt(i++)&255;if(c4==61)return out;c4=base64DecodeChars[c4]}while(ithis.length){return false}else{return this.indexOf(search,start)!==-1}}}if(!Array.prototype.includes){Object.defineProperty(Array.prototype,"includes",{value:function(searchElement,fromIndex){if(this==null){throw new TypeError('"this" is null or not defined')}var o=Object(this);var len=o.length>>>0;if(len===0){return false}var n=fromIndex|0;var k=Math.max(n>=0?n:len-Math.abs(n),0);while(k>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:out+=String.fromCharCode(c);break;case 12:case 13:char2=array[i++];out+=String.fromCharCode((c&31)<<6|char2&63);break;case 14:char2=array[i++];char3=array[i++];out+=String.fromCharCode((c&15)<<12|(char2&63)<<6|(char3&63)<<0);break}}return out}function gzip(str){let arr=pako.gzip(str,{});return uint8ArrayToBase64(arr)}function ungzip(b64Data){let strData=atob(b64Data);const charData=strData.split("").map(function(x){return x.charCodeAt(0)});const binData=new Uint8Array(charData);const data=pako.inflate(binData);return Utf8ArrayToStr(data)}function encodeStr(input,encoding){encoding=encoding||"gbk";if(encoding.startsWith("gb")){const strTool=gbkTool();input=strTool.encode(input)}return input}function decodeStr(input,encoding){encoding=encoding||"gbk";if(encoding.startsWith("gb")){const strTool=gbkTool();input=strTool.decode(input)}return input}function getCryptoJS(){return'console.log("CryptoJS已装载");'}const RSA={decode:function(data,key,option){option=option||{};if(typeof JSEncrypt==="function"){let chunkSize=option.chunkSize||117;let privateKey=this.getPrivateKey(key);const decryptor=new JSEncrypt;decryptor.setPrivateKey(privateKey);let uncrypted="";uncrypted=decryptor.decryptUnicodeLong(data);return uncrypted}else{return false}},encode:function(data,key,option){option=option||{};if(typeof JSEncrypt==="function"){let chunkSize=option.chunkSize||117;let publicKey=this.getPublicKey(key);const encryptor=new JSEncrypt;encryptor.setPublicKey(publicKey);let encrypted="";encrypted=encryptor.encryptUnicodeLong(data);return encrypted}else{return false}},fixKey(key,prefix,endfix){if(!key.includes(prefix)){key=prefix+key}if(!key.includes(endfix)){key+=endfix}return key},getPrivateKey(key){let prefix="-----BEGIN RSA PRIVATE KEY-----";let endfix="-----END RSA PRIVATE KEY-----";return this.fixKey(key,prefix,endfix)},getPublicKey(key){let prefix="-----BEGIN PUBLIC KEY-----";let endfix="-----END PUBLIC KEY-----";return this.fixKey(key,prefix,endfix)}};function getProxyUrl(){if(typeof getProxy==="function"){return getProxy(true)}else{return"http://127.0.0.1:9978/proxy?do=js"}}function fixAdM3u8(m3u8_text,m3u8_url,ad_remove){if(!m3u8_text&&!m3u8_url||!m3u8_text&&m3u8_url&&!m3u8_url.startsWith("http")){return""}if(!m3u8_text){log("m3u8_url:"+m3u8_url);m3u8_text=request(m3u8_url)}log("len(m3u8_text):"+m3u8_text.length);if(!ad_remove){return m3u8_text}if(ad_remove.startsWith("reg:")){ad_remove=ad_remove.slice(4)}else if(ad_remove.startsWith("js:")){ad_remove=ad_remove.slice(3)}let m3u8_start=m3u8_text.slice(0,m3u8_text.indexOf("#EXTINF")).trim();let m3u8_body=m3u8_text.slice(m3u8_text.indexOf("#EXTINF"),m3u8_text.indexOf("#EXT-X-ENDLIST")).trim();let m3u8_end=m3u8_text.slice(m3u8_text.indexOf("#EXT-X-ENDLIST")).trim();let murls=[];let m3_body_list=m3u8_body.split("\n");let m3_len=m3_body_list.length;let i=0;while(i{new_m3u8_body.push(it)})}}new_m3u8_body=new_m3u8_body.join("\n").trim();m3u8_text=[m3u8_start,new_m3u8_body,m3u8_end].join("\n").trim();return m3u8_text}function fixAdM3u8Ai(m3u8_url,headers){let ts=(new Date).getTime();let option=headers?{headers:headers}:{};function b(s1,s2){let i=0;while(iit.startsWith("#")?it:urljoin(m3u8_url,it)).join("\n");m3u8=m3u8.replace(/\n\n/gi,"\n");let last_url=m3u8.split("\n").slice(-1)[0];if(last_url.length<5){last_url=m3u8.split("\n").slice(-2)[0]}if(last_url.includes(".m3u8")&&last_url!==m3u8_url){m3u8_url=urljoin2(m3u8_url,last_url);log("嵌套的m3u8_url:"+m3u8_url);m3u8=request(m3u8_url,option)}let s=m3u8.trim().split("\n").filter(it=>it.trim()).join("\n");let ss=s.split("\n");let firststr="";let maxl=0;let kk=0;let kkk=2;let secondstr="";for(let i=0;i1){if(maxl>b(firststr,s)){if(secondstr.length<5)secondstr=s;kkk=kkk+2}else{maxl=b(firststr,s);kkk++}}kk++;if(kk>=20)break}}if(kkk>30)firststr=secondstr;let firststrlen=firststr.length;let ml=Math.round(ss.length/2).toString().length;let maxc=0;let laststr=ss.toReversed().find(x=>{if(!x.startsWith("#")){let k=b(reverseString(firststr),reverseString(x));maxl=b(firststr,x);maxc++;if(firststrlen-maxl<=ml+k||maxc>10){return true}}return false});log("最后一条切片:"+laststr);let ad_urls=[];for(let i=0;i=end){return lists}let first=lists[start];let second=lists[end];if(key){try{first=first[key];second=second[key]}catch(e){}}if(option&&typeof option==="function"){try{first=option(first);second=option(second)}catch(e){}}first+="";second+="";if(first.match(/(\d+)/)&&second.match(/(\d+)/)){let num1=Number(first.match(/(\d+)/)[1]);let num2=Number(second.match(/(\d+)/)[1]);if(num1>num2){lists.reverse()}}return lists}let VODS=[];let VOD={};let TABS=[];let LISTS=[];function getQuery(url){try{if(url.indexOf("?")>-1){url=url.slice(url.indexOf("?")+1)}let arr=url.split("#")[0].split("&");const resObj={};arr.forEach(item=>{let arr1=item.split("=");let key=arr1[0];let value=arr1.slice(1).join("=");resObj[key]=value});return resObj}catch(err){log(`getQuery发生错误:${e.message}`);return{}}}function urljoin(fromPath,nowPath){fromPath=fromPath||"";nowPath=nowPath||"";return joinUrl(fromPath,nowPath)}var urljoin2=urljoin;const defaultParser={pdfh:pdfh,pdfa:pdfa,pd:pd};function pdfh2(html,parse){let html2=html;try{if(typeof html!=="string"){html2=html.rr(html.ele).toString()}}catch(e){print(`html对象转文本发生了错误:${e.message}`)}let result=defaultParser.pdfh(html2,parse);let option=parse.includes("&&")?parse.split("&&").slice(-1)[0]:parse.split(" ").slice(-1)[0];if(/style/.test(option.toLowerCase())&&/url\(/.test(result)){try{result=result.match(/url\((.*?)\)/)[1];result=result.replace(/^['|"](.*)['|"]$/,"$1")}catch(e){}}return result}function pdfa2(html,parse){let html2=html;try{if(typeof html!=="string"){html2=html.rr(html.ele).toString()}}catch(e){print(`html对象转文本发生了错误:${e.message}`)}return defaultParser.pdfa(html2,parse)}function pd2(html,parse,uri){let ret=pdfh2(html,parse);if(typeof uri==="undefined"||!uri){uri=""}if(DOM_CHECK_ATTR.test(parse)&&!SPECIAL_URL.test(ret)){if(/http/.test(ret)){ret=ret.slice(ret.indexOf("http"))}else{ret=urljoin(MY_URL,ret)}}return ret}const parseTags={jsp:{pdfh:pdfh2,pdfa:pdfa2,pd:pd2},json:{pdfh(html,parse){if(!parse||!parse.trim()){return""}if(typeof html==="string"){html=JSON.parse(html)}parse=parse.trim();if(!parse.startsWith("$.")){parse="$."+parse}parse=parse.split("||");for(let ps of parse){let ret=cheerio.jp(ps,html);if(Array.isArray(ret)){ret=ret[0]||""}else{ret=ret||""}if(ret&&typeof ret!=="string"){ret=ret.toString()}if(ret){return ret}}return""},pdfa(html,parse){if(!parse||!parse.trim()){return""}if(typeof html==="string"){html=JSON.parse(html)}parse=parse.trim();if(!parse.startsWith("$.")){parse="$."+parse}let ret=cheerio.jp(parse,html);if(Array.isArray(ret)&&Array.isArray(ret[0])&&ret.length===1){return ret[0]||[]}return ret||[]},pd(html,parse){let ret=parseTags.json.pdfh(html,parse);if(ret){return urljoin(MY_URL,ret)}return ret}},jq:{pdfh(html,parse){if(!html||!parse||!parse.trim()){return""}parse=parse.trim();let result=defaultParser.pdfh(html,parse);return result},pdfa(html,parse){if(!html||!parse||!parse.trim()){return[]}parse=parse.trim();let result=defaultParser.pdfa(html,parse);print(`pdfa解析${parse}=>${result.length}`);return result},pd(html,parse,base_url){if(!html||!parse||!parse.trim()){return""}parse=parse.trim();base_url=base_url||MY_URL;return defaultParser.pd(html,parse,base_url)}},getParse(p0){if(p0.startsWith("jsp:")){return this.jsp}else if(p0.startsWith("json:")){return this.json}else if(p0.startsWith("jq:")){return this.jq}else{return this.jq}}};const stringify=JSON.stringify;const jsp=parseTags.jsp;const jq=parseTags.jq;function readFile(filePath){filePath=filePath||"./uri.min.js";var fd=os.open(filePath);var buffer=new ArrayBuffer(1024);var len=os.read(fd,buffer,0,1024);console.log(len);let text=String.fromCharCode.apply(null,new Uint8Array(buffer));console.log(text);return text}function dealJson(html){try{html=html.trim();if(!(html.startsWith("{")&&html.endsWith("}")||html.startsWith("[")&&html.endsWith("]"))){html="{"+html.match(/.*?\{(.*)\}/m)[1]+"}"}}catch(e){}try{html=JSON.parse(html)}catch(e){}return html}var OcrApi={api:OCR_API,classification:function(img){let code="";try{log("通过drpy_ocr验证码接口过验证...");let html="";if(this.api.endsWith("drpy/text")){html=request(this.api,{data:{img:img},headers:{"User-Agent":PC_UA},method:"POST"},true)}else{html=post(this.api,{body:img})}code=html||""}catch(e){log(`OCR识别验证码发生错误:${e.message}`)}return code}};function verifyCode(url){let cnt=0;let host=getHome(url);let cookie="";while(cntit.toLowerCase()==="set-cookie");cookie=setCk?json[setCk].split(";")[0]:""}console.log("cookie:"+cookie);let img=json.body;let code=OcrApi.classification(img);console.log(`第${cnt+1}次验证码识别结果:${code}`);let submit_url=`${host}/index.php/ajax/verify_check?type=search&verify=${code}`;console.log(submit_url);let html=request(submit_url,{headers:{Cookie:cookie},method:"POST"});html=JSON.parse(html);if(html.msg==="ok"){console.log(`第${cnt+1}次验证码提交成功`);return cookie}else if(html.msg!=="ok"&&cnt+1>=OCR_RETRY){cookie=""}}catch(e){console.log(`第${cnt+1}次验证码提交失败:${e.message}`);if(cnt+1>=OCR_RETRY){cookie=""}}cnt+=1}return cookie}function setItem(k,v){local.set(RKEY,k,v);console.log(`规则${RKEY}设置${k} => ${v}`)}function getItem(k,v){return local.get(RKEY,k)||v}function clearItem(k){local.delete(RKEY,k)}function getHome(url){if(!url){return""}let tmp=url.split("//");url=tmp[0]+"//"+tmp[1].split("/")[0];try{url=decodeURIComponent(url)}catch(e){}return url}function buildUrl(url,obj){obj=obj||{};if(url.indexOf("?")<0){url+="?"}let param_list=[];let keys=Object.keys(obj);keys.forEach(it=>{param_list.push(it+"="+obj[it])});let prs=param_list.join("&");if(keys.length>0&&!url.endsWith("?")){url+="&"}url+=prs;return url}function $require(url){eval(request(url))}function keysToLowerCase(obj){return Object.keys(obj).reduce((result,key)=>{const newKey=key.toLowerCase();result[newKey]=obj[key];return result},{})}function request(url,obj,ocr_flag){ocr_flag=ocr_flag||false;if(typeof obj==="undefined"||!obj||obj==={}){if(!fetch_params||!fetch_params.headers){let headers={"User-Agent":MOBILE_UA};if(rule.headers){Object.assign(headers,rule.headers)}if(!fetch_params){fetch_params={}}fetch_params.headers=headers}if(!fetch_params.headers.Referer){fetch_params.headers.Referer=getHome(url)}obj=fetch_params}else{let headers=obj.headers||{};let keys=Object.keys(headers).map(it=>it.toLowerCase());if(!keys.includes("user-agent")){headers["User-Agent"]=MOBILE_UA;if(typeof fetch_params==="object"&&fetch_params&&fetch_params.headers){let fetch_headers=keysToLowerCase(fetch_params.headers);if(fetch_headers["user-agent"]){headers["User-Agent"]=fetch_headers["user-agent"]}}}if(!keys.includes("referer")){headers["Referer"]=getHome(url)}obj.headers=headers}if(rule.encoding&&rule.encoding!=="utf-8"&&!ocr_flag){if(!obj.headers.hasOwnProperty("Content-Type")&&!obj.headers.hasOwnProperty("content-type")){obj.headers["Content-Type"]="text/html; charset="+rule.encoding}}if(typeof obj.body!="undefined"&&obj.body&&typeof obj.body==="string"){if(!obj.headers.hasOwnProperty("Content-Type")&&!obj.headers.hasOwnProperty("content-type")){obj.headers["Content-Type"]="application/x-www-form-urlencoded; charset="+rule.encoding}}else if(typeof obj.body!="undefined"&&obj.body&&typeof obj.body==="object"){obj.data=obj.body;delete obj.body}if(!url){return obj.withHeaders?"{}":""}if(obj.toBase64){obj.buffer=2;delete obj.toBase64}if(obj.redirect===false){obj.redirect=0}console.log(JSON.stringify(obj.headers));console.log("request:"+url+`|method:${obj.method||"GET"}|body:${obj.body||""}`);let res=req(url,obj);let html=res.content||"";if(obj.withHeaders){let htmlWithHeaders=res.headers;htmlWithHeaders.body=html;return JSON.stringify(htmlWithHeaders)}else{return html}}function post(url,obj){obj=obj||{};obj.method="POST";return request(url,obj)}function reqCookie(url,obj,all_cookie){obj=obj||{};obj.withHeaders=true;all_cookie=all_cookie||false;let html=request(url,obj);let json=JSON.parse(html);let setCk=Object.keys(json).find(it=>it.toLowerCase()==="set-cookie");let cookie=setCk?json[setCk]:"";if(Array.isArray(cookie)){cookie=cookie.join(";")}if(!all_cookie){cookie=cookie.split(";")[0]}html=json.body;return{cookie:cookie,html:html}}fetch=request;print=function(data){data=data||"";if(typeof data=="object"&&Object.keys(data).length>0){try{data=JSON.stringify(data);console.log(data)}catch(e){console.log(typeof data+":"+data.length);return}}else if(typeof data=="object"&&Object.keys(data).length<1){console.log("null object")}else{console.log(data)}};log=print;function checkHtml(html,url,obj){if(/\?btwaf=/.test(html)){let btwaf=html.match(/btwaf(.*?)"/)[1];url=url.split("#")[0]+"?btwaf"+btwaf;print("宝塔验证访问链接:"+url);html=request(url,obj)}return html}function getCode(url,obj){let html=request(url,obj);html=checkHtml(html,url,obj);return html}function getHtml(url){let obj={};if(rule.headers){obj.headers=rule.headers}let cookie=getItem(RULE_CK,"");if(cookie){if(obj.headers&&!Object.keys(obj.headers).map(it=>it.toLowerCase()).includes("cookie")){log("历史无cookie,新增过验证后的cookie");obj.headers["Cookie"]=cookie}else if(obj.headers&&obj.headers.cookie&&obj.headers.cookie!==cookie){obj.headers["Cookie"]=cookie;log("历史有小写过期的cookie,更新过验证后的cookie")}else if(obj.headers&&obj.headers.Cookie&&obj.headers.Cookie!==cookie){obj.headers["Cookie"]=cookie;log("历史有大写过期的cookie,更新过验证后的cookie")}else if(!obj.headers){obj.headers={Cookie:cookie};log("历史无headers,更新过验证后的含cookie的headers")}}let html=getCode(url,obj);return html}function homeParse(homeObj){fetch_params=JSON.parse(JSON.stringify(rule_fetch_params));let classes=[];if(homeObj.class_name&&homeObj.class_url){let names=homeObj.class_name.split("&");let urls=homeObj.class_url.split("&");let cnt=Math.min(names.length,urls.length);for(let i=0;i0){classes=list}}}catch(e){console.log(e.message)}}else if(p.length>=3&&!is_json){try{let html=homeObj.home_html||getHtml(homeObj.MY_URL);if(html){homeHtmlCache=html;let list=_pdfa(html,p0);if(list&&list.length>0){list.forEach((it,idex)=>{try{let name=_pdfh(it,p[1]);if(homeObj.cate_exclude&&new RegExp(homeObj.cate_exclude).test(name)){return}let url=_pd(it,p[2]);if(p.length>3&&p[3]&&!homeObj.home_html){let exp=new RegExp(p[3]);url=url.match(exp)[1]}classes.push({type_id:url.trim(),type_name:name.trim()})}catch(e){console.log(`分类列表定位第${idex}个元素正常报错:${e.message}`)}})}}}catch(e){console.log(e.message)}}}}classes=classes.filter(it=>!homeObj.cate_exclude||!new RegExp(homeObj.cate_exclude).test(it.type_name));let resp={class:classes};if(homeObj.filter){resp.filters=homeObj.filter}console.log(JSON.stringify(resp));return JSON.stringify(resp)}function getPP(p,pn,pp,ppn){try{let ps=p[pn]==="*"&&pp.length>ppn?pp[ppn]:p[pn];return ps}catch(e){return""}}function homeVodParse(homeVodObj){fetch_params=JSON.parse(JSON.stringify(rule_fetch_params));let d=[];MY_URL=homeVodObj.homeUrl;console.log(MY_URL);let t1=(new Date).getTime();let p=homeVodObj.推荐;print("p:"+p);if(p==="*"&&rule.一级){p=rule.一级;homeVodObj.double=false}if(!p||typeof p!=="string"){return"{}"}p=p.trim();let pp=rule.一级?rule.一级.split(";"):[];if(p.startsWith("js:")){const TYPE="home";var input=MY_URL;HOST=rule.host;eval(p.replace("js:",""));d=VODS}else{p=p.split(";");if(!homeVodObj.double&&p.length<5){return"{}"}else if(homeVodObj.double&&p.length<6){return"{}"}let p0=getPP(p,0,pp,0);let _ps=parseTags.getParse(p0);_pdfa=_ps.pdfa;_pdfh=_ps.pdfh;_pd=_ps.pd;let is_json=p0.startsWith("json:");p0=p0.replace(/^(jsp:|json:|jq:)/,"");let html=homeHtmlCache||getHtml(MY_URL);homeHtmlCache=undefined;if(is_json){html=dealJson(html)}try{console.log("double:"+homeVodObj.double);if(homeVodObj.double){let items=_pdfa(html,p0);let p1=getPP(p,1,pp,0);let p2=getPP(p,2,pp,1);let p3=getPP(p,3,pp,2);let p4=getPP(p,4,pp,3);let p5=getPP(p,5,pp,4);let p6=getPP(p,6,pp,5);for(let item of items){let items2=_pdfa(item,p1);for(let item2 of items2){try{let title=_pdfh(item2,p2);let img="";try{img=_pd(item2,p3)}catch(e){}let desc="";try{desc=_pdfh(item2,p4)}catch(e){}let links=[];for(let _p5 of p5.split("+")){let link=!homeVodObj.detailUrl?_pd(item2,_p5,MY_URL):_pdfh(item2,_p5);links.push(link)}let content;if(p.length>6&&p[6]){content=_pdfh(item2,p6)}else{content=""}let vid=links.join("$");if(rule.二级==="*"){vid=vid+"@@"+title+"@@"+img}let vod={vod_name:title,vod_pic:img,vod_remarks:desc,vod_content:content,vod_id:vid};d.push(vod)}catch(e){console.log(`首页列表双层定位处理发生错误:${e.message}`)}}}}else{let items=_pdfa(html,p0);let p1=getPP(p,1,pp,1);let p2=getPP(p,2,pp,2);let p3=getPP(p,3,pp,3);let p4=getPP(p,4,pp,4);let p5=getPP(p,5,pp,5);for(let item of items){try{let title=_pdfh(item,p1);let img="";try{img=_pd(item,p2,MY_URL)}catch(e){}let desc="";try{desc=_pdfh(item,p3)}catch(e){}let links=[];for(let _p5 of p4.split("+")){let link=!homeVodObj.detailUrl?_pd(item,_p5,MY_URL):_pdfh(item,_p5);links.push(link)}let content;if(p.length>5&&p[5]){content=_pdfh(item,p5)}else{content=""}let vid=links.join("$");if(rule.二级==="*"){vid=vid+"@@"+title+"@@"+img}let vod={vod_name:title,vod_pic:img,vod_remarks:desc,vod_content:content,vod_id:vid};d.push(vod)}catch(e){console.log(`首页列表单层定位处理发生错误:${e.message}`)}}}}catch(e){}}let t2=(new Date).getTime();console.log("加载首页推荐耗时:"+(t2-t1)+"毫秒");if(rule.图片替换){if(rule.图片替换.startsWith("js:")){d.forEach(it=>{try{var input=it.vod_pic;eval(rule.图片替换.trim().replace("js:",""));it.vod_pic=input}catch(e){log(`图片:${it.vod_pic}替换错误:${e.message}`)}})}else if(rule.图片替换.includes("=>")){let replace_from=rule.图片替换.split("=>")[0];let replace_to=rule.图片替换.split("=>")[1];d.forEach(it=>{if(it.vod_pic&&it.vod_pic.startsWith("http")){it.vod_pic=it.vod_pic.replace(replace_from,replace_to)}})}}if(rule.图片来源){d.forEach(it=>{if(it.vod_pic&&it.vod_pic.startsWith("http")){it.vod_pic=it.vod_pic+rule.图片来源}})}if(d.length>0){print(d.slice(0,2))}return JSON.stringify({list:d})}function categoryParse(cateObj){fetch_params=JSON.parse(JSON.stringify(rule_fetch_params));let p=cateObj.一级;if(!p||typeof p!=="string"){return"{}"}let d=[];let url=cateObj.url.replaceAll("fyclass",cateObj.tid);if(cateObj.pg===1&&url.includes("[")&&url.includes("]")){url=url.split("[")[1].split("]")[0]}else if(cateObj.pg>1&&url.includes("[")&&url.includes("]")){url=url.split("[")[0]}if(rule.filter_url){if(!/fyfilter/.test(url)){if(!url.endsWith("&")&&!rule.filter_url.startsWith("&")){url+="&"}url+=rule.filter_url}else{url=url.replace("fyfilter",rule.filter_url)}url=url.replaceAll("fyclass",cateObj.tid);let fl=cateObj.filter?cateObj.extend:{};if(rule.filter_def&&typeof rule.filter_def==="object"){try{if(Object.keys(rule.filter_def).length>0&&rule.filter_def.hasOwnProperty(cateObj.tid)){let self_fl_def=rule.filter_def[cateObj.tid];if(self_fl_def&&typeof self_fl_def==="object"){let fl_def=JSON.parse(JSON.stringify(self_fl_def));fl=Object.assign(fl_def,fl)}}}catch(e){print(`合并不同分类对应的默认筛选出错:${e.message}`)}}let new_url;new_url=cheerio.jinja2(url,{fl:fl,fyclass:cateObj.tid});url=new_url}if(/fypage/.test(url)){if(url.includes("(")&&url.includes(")")){let url_rep=url.match(/.*?\((.*)\)/)[1];let cnt_page=url_rep.replaceAll("fypage",cateObj.pg);let cnt_pg=eval(cnt_page);url=url.replaceAll(url_rep,cnt_pg).replaceAll("(","").replaceAll(")","")}else{url=url.replaceAll("fypage",cateObj.pg)}}MY_URL=url;console.log(MY_URL);p=p.trim();const MY_CATE=cateObj.tid;if(p.startsWith("js:")){var MY_FL=cateObj.extend;const TYPE="cate";var input=MY_URL;const MY_PAGE=cateObj.pg;var desc="";eval(p.trim().replace("js:",""));d=VODS}else{p=p.split(";");if(p.length<5){return"{}"}let _ps=parseTags.getParse(p[0]);_pdfa=_ps.pdfa;_pdfh=_ps.pdfh;_pd=_ps.pd;let is_json=p[0].startsWith("json:");p[0]=p[0].replace(/^(jsp:|json:|jq:)/,"");try{let html=getHtml(MY_URL);if(html){if(is_json){html=dealJson(html)}let list=_pdfa(html,p[0]);list.forEach(it=>{let links=p[4].split("+").map(p4=>{return!rule.detailUrl?_pd(it,p4,MY_URL):_pdfh(it,p4)});let link=links.join("$");let vod_id=rule.detailUrl?MY_CATE+"$"+link:link;let vod_name=_pdfh(it,p[1]).replace(/\n|\t/g,"").trim();let vod_pic=_pd(it,p[2],MY_URL);if(rule.二级==="*"){vod_id=vod_id+"@@"+vod_name+"@@"+vod_pic}d.push({vod_id:vod_id,vod_name:vod_name,vod_pic:vod_pic,vod_remarks:_pdfh(it,p[3]).replace(/\n|\t/g,"").trim()})})}}catch(e){console.log(e.message)}}if(rule.图片替换){if(rule.图片替换.startsWith("js:")){d.forEach(it=>{try{var input=it.vod_pic;eval(rule.图片替换.trim().replace("js:",""));it.vod_pic=input}catch(e){log(`图片:${it.vod_pic}替换错误:${e.message}`)}})}else if(rule.图片替换.includes("=>")){let replace_from=rule.图片替换.split("=>")[0];let replace_to=rule.图片替换.split("=>")[1];d.forEach(it=>{if(it.vod_pic&&it.vod_pic.startsWith("http")){it.vod_pic=it.vod_pic.replace(replace_from,replace_to)}})}}if(rule.图片来源){d.forEach(it=>{if(it.vod_pic&&it.vod_pic.startsWith("http")){it.vod_pic=it.vod_pic+rule.图片来源}})}if(d.length>0){print(d.slice(0,2))}let pagecount=0;if(rule.pagecount&&typeof rule.pagecount==="object"&&rule.pagecount.hasOwnProperty(MY_CATE)){print(`MY_CATE:${MY_CATE},pagecount:${JSON.stringify(rule.pagecount)}`);pagecount=parseInt(rule.pagecount[MY_CATE])}let nodata={list:[{vod_name:"无数据,防无限请求",vod_id:"no_data",vod_remarks:"不要点,会崩的",vod_pic:"https://ghproxy.net/https://raw.githubusercontent.com/hjdhnx/dr_py/main/404.jpg"}],total:1,pagecount:1,page:1,limit:1};let vod=d.length<1?JSON.stringify(nodata):JSON.stringify({page:parseInt(cateObj.pg),pagecount:pagecount||999,limit:20,total:999,list:d});return vod}function searchParse(searchObj){fetch_params=JSON.parse(JSON.stringify(rule_fetch_params));let d=[];if(!searchObj.searchUrl){return"{}"}let p=searchObj.搜索==="*"&&rule.一级?rule.一级:searchObj.搜索;if(!p||typeof p!=="string"){return"{}"}p=p.trim();let pp=rule.一级?rule.一级.split(";"):[];let url=searchObj.searchUrl.replaceAll("**",searchObj.wd);if(searchObj.pg===1&&url.includes("[")&&url.includes("]")&&!url.includes("#")){url=url.split("[")[1].split("]")[0]}else if(searchObj.pg>1&&url.includes("[")&&url.includes("]")&&!url.includes("#")){url=url.split("[")[0]}if(/fypage/.test(url)){if(url.includes("(")&&url.includes(")")){let url_rep=url.match(/.*?\((.*)\)/)[1];let cnt_page=url_rep.replaceAll("fypage",searchObj.pg);let cnt_pg=eval(cnt_page);url=url.replaceAll(url_rep,cnt_pg).replaceAll("(","").replaceAll(")","")}else{url=url.replaceAll("fypage",searchObj.pg)}}MY_URL=url;console.log(MY_URL);if(p.startsWith("js:")){const TYPE="search";const MY_PAGE=searchObj.pg;const KEY=searchObj.wd;var input=MY_URL;var detailUrl=rule.detailUrl||"";eval(p.trim().replace("js:",""));d=VODS}else{p=p.split(";");if(p.length<5){return"{}"}let p0=getPP(p,0,pp,0);let _ps=parseTags.getParse(p0);_pdfa=_ps.pdfa;_pdfh=_ps.pdfh;_pd=_ps.pd;let is_json=p0.startsWith("json:");p0=p0.replace(/^(jsp:|json:|jq:)/,"");try{let req_method=MY_URL.split(";").length>1?MY_URL.split(";")[1].toLowerCase():"get";let html;if(req_method==="post"){let rurls=MY_URL.split(";")[0].split("#");let rurl=rurls[0];let params=rurls.length>1?rurls[1]:"";print(`post=》rurl:${rurl},params:${params}`);let _fetch_params=JSON.parse(JSON.stringify(rule_fetch_params));let postData={body:params};Object.assign(_fetch_params,postData);html=post(rurl,_fetch_params)}else if(req_method==="postjson"){let rurls=MY_URL.split(";")[0].split("#");let rurl=rurls[0];let params=rurls.length>1?rurls[1]:"";print(`postjson-》rurl:${rurl},params:${params}`);try{params=JSON.parse(params)}catch(e){params="{}"}let _fetch_params=JSON.parse(JSON.stringify(rule_fetch_params));let postData={body:params};Object.assign(_fetch_params,postData);html=post(rurl,_fetch_params)}else{html=getHtml(MY_URL)}if(html){if(/系统安全验证|输入验证码/.test(html)){let cookie=verifyCode(MY_URL);if(cookie){console.log(`本次成功过验证,cookie:${cookie}`);setItem(RULE_CK,cookie)}else{console.log(`本次自动过搜索验证失败,cookie:${cookie}`)}html=getHtml(MY_URL)}if(!html.includes(searchObj.wd)){console.log("搜索结果源码未包含关键字,疑似搜索失败,正为您打印结果源码");console.log(html)}if(is_json){html=dealJson(html)}let list=_pdfa(html,p0);let p1=getPP(p,1,pp,1);let p2=getPP(p,2,pp,2);let p3=getPP(p,3,pp,3);let p4=getPP(p,4,pp,4);let p5=getPP(p,5,pp,5);list.forEach(it=>{let links=p4.split("+").map(_p4=>{return!rule.detailUrl?_pd(it,_p4,MY_URL):_pdfh(it,_p4)});let link=links.join("$");let content;if(p.length>5&&p[5]){content=_pdfh(it,p5)}else{content=""}let vod_id=link;let vod_name=_pdfh(it,p1).replace(/\n|\t/g,"").trim();let vod_pic=_pd(it,p2,MY_URL);if(rule.二级==="*"){vod_id=vod_id+"@@"+vod_name+"@@"+vod_pic}let ob={vod_id:vod_id,vod_name:vod_name,vod_pic:vod_pic,vod_remarks:_pdfh(it,p3).replace(/\n|\t/g,"").trim(),vod_content:content.replace(/\n|\t/g,"").trim()};d.push(ob)})}}catch(e){print(`搜索发生错误:${e.message}`);return"{}"}}if(rule.图片替换){if(rule.图片替换.startsWith("js:")){d.forEach(it=>{try{var input=it.vod_pic;eval(rule.图片替换.trim().replace("js:",""));it.vod_pic=input}catch(e){log(`图片:${it.vod_pic}替换错误:${e.message}`)}})}else if(rule.图片替换.includes("=>")){let replace_from=rule.图片替换.split("=>")[0];let replace_to=rule.图片替换.split("=>")[1];d.forEach(it=>{if(it.vod_pic&&it.vod_pic.startsWith("http")){it.vod_pic=it.vod_pic.replace(replace_from,replace_to)}})}}if(rule.图片来源){d.forEach(it=>{if(it.vod_pic&&it.vod_pic.startsWith("http")){it.vod_pic=it.vod_pic+rule.图片来源}})}return JSON.stringify({page:parseInt(searchObj.pg),pagecount:10,limit:20,total:100,list:d})}function detailParse(detailObj){let t1=(new Date).getTime();fetch_params=JSON.parse(JSON.stringify(rule_fetch_params));let orId=detailObj.orId;let vod_name="片名";let vod_pic="";let vod_id=orId;if(rule.二级==="*"){let extra=orId.split("@@");vod_name=extra.length>1?extra[1]:vod_name;vod_pic=extra.length>2?extra[2]:vod_pic}let vod={vod_id:vod_id,vod_name:vod_name,vod_pic:vod_pic,type_name:"类型",vod_year:"年份",vod_area:"地区",vod_remarks:"更新信息",vod_actor:"主演",vod_director:"导演",vod_content:"简介"};let p=detailObj.二级;let url=detailObj.url;let detailUrl=detailObj.detailUrl;let fyclass=detailObj.fyclass;let tab_exclude=detailObj.tab_exclude;let html=detailObj.html||"";MY_URL=url;if(detailObj.二级访问前){try{print(`尝试在二级访问前执行代码:${detailObj.二级访问前}`);eval(detailObj.二级访问前.trim().replace("js:",""))}catch(e){print(`二级访问前执行代码出现错误:${e.message}`)}}if(p==="*"){vod.vod_play_from="免费分享";vod.vod_remarks=detailUrl;vod.vod_actor="没有二级,只有一级链接直接嗅探播放";vod.vod_content=MY_URL;vod.vod_play_url="嗅探播放$"+MY_URL.split("@@")[0]}else if(typeof p==="string"&&p.trim().startsWith("js:")){const TYPE="detail";var input=MY_URL;var play_url="";eval(p.trim().replace("js:",""));vod=VOD;console.log(JSON.stringify(vod))}else if(p&&typeof p==="object"){let tt1=(new Date).getTime();if(!html){html=getHtml(MY_URL)}print(`二级${MY_URL}仅获取源码耗时:${(new Date).getTime()-tt1}毫秒`);let _ps;if(p.is_json){print("二级是json");_ps=parseTags.json;html=dealJson(html)}else if(p.is_jsp){print("二级是jsp");_ps=parseTags.jsp}else if(p.is_jq){print("二级是jq");_ps=parseTags.jq}else{print("二级默认jq");_ps=parseTags.jq}let tt2=(new Date).getTime();print(`二级${MY_URL}获取并装载源码耗时:${tt2-tt1}毫秒`);_pdfa=_ps.pdfa;_pdfh=_ps.pdfh;_pd=_ps.pd;if(p.title){let p1=p.title.split(";");vod.vod_name=_pdfh(html,p1[0]).replace(/\n|\t/g,"").trim();let type_name=p1.length>1?_pdfh(html,p1[1]).replace(/\n|\t/g,"").replace(/ /g,"").trim():"";vod.type_name=type_name||vod.type_name}if(p.desc){try{let p1=p.desc.split(";");vod.vod_remarks=_pdfh(html,p1[0]).replace(/\n|\t/g,"").trim();vod.vod_year=p1.length>1?_pdfh(html,p1[1]).replace(/\n|\t/g,"").trim():"";vod.vod_area=p1.length>2?_pdfh(html,p1[2]).replace(/\n|\t/g,"").trim():"";vod.vod_actor=p1.length>3?_pdfh(html,p1[3]).replace(/\n|\t/g,"").trim():"";vod.vod_director=p1.length>4?_pdfh(html,p1[4]).replace(/\n|\t/g,"").trim():""}catch(e){}}if(p.content){try{let p1=p.content.split(";");vod.vod_content=_pdfh(html,p1[0]).replace(/\n|\t/g,"").trim()}catch(e){}}if(p.img){try{let p1=p.img.split(";");vod.vod_pic=_pd(html,p1[0],MY_URL)}catch(e){}}let vod_play_from="$$$";let playFrom=[];if(p.重定向&&p.重定向.startsWith("js:")){print("开始执行重定向代码:"+p.重定向);html=eval(p.重定向.replace("js:",""))}if(p.tabs){if(p.tabs.startsWith("js:")){print("开始执行tabs代码:"+p.tabs);var input=MY_URL;eval(p.tabs.replace("js:",""));playFrom=TABS}else{let p_tab=p.tabs.split(";")[0];let vHeader=_pdfa(html,p_tab);console.log(vHeader.length);let tab_text=p.tab_text||"body&&Text";let new_map={};for(let v of vHeader){let v_title=_pdfh(v,tab_text).trim();if(!v_title){v_title="线路空"}console.log(v_title);if(tab_exclude&&new RegExp(tab_exclude).test(v_title)){continue}if(!new_map.hasOwnProperty(v_title)){new_map[v_title]=1}else{new_map[v_title]+=1}if(new_map[v_title]>1){v_title+=Number(new_map[v_title]-1)}playFrom.push(v_title)}}console.log(JSON.stringify(playFrom))}else{playFrom=["免费分享"]}vod.vod_play_from=playFrom.join(vod_play_from);let vod_play_url="$$$";let vod_tab_list=[];if(p.lists){if(p.lists.startsWith("js:")){print("开始执行lists代码:"+p.lists);try{var input=MY_URL;var play_url="";eval(p.lists.replace("js:",""));for(let i in LISTS){if(LISTS.hasOwnProperty(i)){try{LISTS[i]=LISTS[i].map(it=>it.split("$").slice(0,2).join("$"))}catch(e){print(`格式化LISTS发生错误:${e.message}`)}}}vod_play_url=LISTS.map(it=>it.join("#")).join(vod_play_url)}catch(e){print(`js执行lists: 发生错误:${e.message}`)}}else{let list_text=p.list_text||"body&&Text";let list_url=p.list_url||"a&&href";let list_url_prefix=p.list_url_prefix||"";let is_tab_js=p.tabs.trim().startsWith("js:");for(let i=0;i1&&!is_tab_js?p.tabs.split(";")[1]:"";let p1=p.lists.replaceAll("#idv",tab_name).replaceAll("#id",i);tab_ext=tab_ext.replaceAll("#idv",tab_name).replaceAll("#id",i);let tabName=tab_ext?_pdfh(html,tab_ext):tab_name;console.log(tabName);let new_vod_list=[];let tt1=(new Date).getTime();if(typeof pdfl==="function"){new_vod_list=pdfl(html,p1,list_text,list_url,MY_URL);if(list_url_prefix){new_vod_list=new_vod_list.map(it=>it.split("$")[0]+"$"+list_url_prefix+it.split("$").slice(1).join("$"))}}else{let vodList=[];try{vodList=_pdfa(html,p1);console.log("len(vodList):"+vodList.length)}catch(e){}for(let i=0;i0){new_vod_list=forceOrder(new_vod_list,"",x=>x.split("$")[0]);console.log(`drpy影响性能代码共计列表数循环次数:${new_vod_list.length},耗时:${(new Date).getTime()-tt1}毫秒`)}let vlist=new_vod_list.join("#");vod_tab_list.push(vlist)}vod_play_url=vod_tab_list.join(vod_play_url)}}vod.vod_play_url=vod_play_url}if(rule.图片替换&&rule.图片替换.includes("=>")){let replace_from=rule.图片替换.split("=>")[0];let replace_to=rule.图片替换.split("=>")[1];vod.vod_pic=vod.vod_pic.replace(replace_from,replace_to)}if(rule.图片来源&&vod.vod_pic&&vod.vod_pic.startsWith("http")){vod.vod_pic=vod.vod_pic+rule.图片来源}if(!vod.vod_id||vod_id.includes("$")&&vod.vod_id!==vod_id){vod.vod_id=vod_id}let t2=(new Date).getTime();console.log(`加载二级界面${MY_URL}耗时:${t2-t1}毫秒`);try{vod=vodDeal(vod)}catch(e){console.log(`vodDeal发生错误:${e.message}`)}return JSON.stringify({list:[vod]})}function get_tab_index(vod){let obj={};vod.vod_play_from.split("$$$").forEach((it,index)=>{obj[it]=index});return obj}function vodDeal(vod){let vod_play_from=vod.vod_play_from.split("$$$");let vod_play_url=vod.vod_play_url.split("$$$");let tab_removed_list=vod_play_from;let tab_ordered_list=vod_play_from;let tab_renamed_list=vod_play_from;let tab_list=vod_play_from;let play_ordered_list=vod_play_url;if(rule.tab_remove&&rule.tab_remove.length>0||rule.tab_order&&rule.tab_order.length>0){let tab_index_dict=get_tab_index(vod);if(rule.tab_remove&&rule.tab_remove.length>0){tab_removed_list=vod_play_from.filter(it=>!rule.tab_remove.includes(it));tab_list=tab_removed_list}if(rule.tab_order&&rule.tab_order.length>0){let tab_order=rule.tab_order;tab_ordered_list=tab_removed_list.sort((a,b)=>{return(tab_order.indexOf(a)===-1?9999:tab_order.indexOf(a))-(tab_order.indexOf(b)===-1?9999:tab_order.indexOf(b))});tab_list=tab_ordered_list}play_ordered_list=tab_list.map(it=>vod_play_url[tab_index_dict[it]])}if(rule.tab_rename&&typeof rule.tab_rename==="object"&Object.keys(rule.tab_rename).length>0){tab_renamed_list=tab_list.map(it=>rule.tab_rename[it]||it);tab_list=tab_renamed_list}vod.vod_play_from=tab_list.join("$$$");vod.vod_play_url=play_ordered_list.join("$$$");return vod}function tellIsJx(url){try{let is_vip=!/\.(m3u8|mp4|m4a)$/.test(url.split("?")[0])&&是否正版(url);return is_vip?1:0}catch(e){return 1}}function playParse(playObj){fetch_params=JSON.parse(JSON.stringify(rule_fetch_params));MY_URL=playObj.url;var MY_FLAG=playObj.flag;if(!/http/.test(MY_URL)){try{MY_URL=base64Decode(MY_URL)}catch(e){}}MY_URL=decodeURIComponent(MY_URL);var input=MY_URL;var flag=MY_FLAG;let common_play={parse:SPECIAL_URL.test(input)||/^(push:)/.test(input)?0:1,url:input,flag:flag,jx:tellIsJx(input)};let lazy_play;if(!rule.play_parse||!rule.lazy){lazy_play=common_play}else if(rule.play_parse&&rule.lazy&&typeof rule.lazy==="string"){try{let lazy_code=rule.lazy.trim();if(lazy_code.startsWith("js:")){lazy_code=lazy_code.replace("js:","").trim()}print("开始执行js免嗅=>"+lazy_code);eval(lazy_code);lazy_play=typeof input==="object"?input:{parse:SPECIAL_URL.test(input)||/^(push:)/.test(input)?0:1,jx:tellIsJx(input),url:input}}catch(e){print(`js免嗅错误:${e.message}`);lazy_play=common_play}}else{lazy_play=common_play}if(Array.isArray(rule.play_json)&&rule.play_json.length>0){let web_url=lazy_play.url;for(let pjson of rule.play_json){if(pjson.re&&(pjson.re==="*"||web_url.match(new RegExp(pjson.re)))){if(pjson.json&&typeof pjson.json==="object"){let base_json=pjson.json;lazy_play=Object.assign(lazy_play,base_json);break}}}}else if(rule.play_json&&!Array.isArray(rule.play_json)){let base_json={jx:1,parse:1};lazy_play=Object.assign(lazy_play,base_json)}else if(!rule.play_json){let base_json={jx:0,parse:1};lazy_play=Object.assign(lazy_play,base_json)}console.log(JSON.stringify(lazy_play));return JSON.stringify(lazy_play)}function proxyParse(proxyObj){var input=proxyObj.params;if(proxyObj.proxy_rule){log("准备执行本地代理规则:\n"+proxyObj.proxy_rule);try{eval(proxyObj.proxy_rule);if(input&&input!==proxyObj.params&&Array.isArray(input)&&input.length>=3){return input}else{return[404,"text/plain","Not Found"]}}catch(e){return[500,"text/plain","代理规则错误:"+e.message]}}else{return[404,"text/plain","Not Found"]}}function isVideoParse(isVideoObj){var input=isVideoObj.url;if(!isVideoObj.t){let re_matcher=new RegExp(isVideoObj.isVideo,"i");return re_matcher.test(input)}else{try{eval(isVideoObj.isVideo);if(typeof input==="boolean"){return input}else{return false}}catch(e){log(`执行嗅探规则发生错误:${e.message}`);return false}}}function getOriginalJs(js_code){let current_match=/var rule|[\u4E00-\u9FA5]+|function|let |var |const |\(|\)|"|'/;if(current_match.test(js_code)){return js_code}let rsa_private_key="MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCqin/jUpqM6+fgYP/oMqj9zcdHMM0mEZXLeTyixIJWP53lzJV2N2E3OP6BBpUmq2O1a9aLnTIbADBaTulTNiOnVGoNG58umBnupnbmmF8iARbDp2mTzdMMeEgLdrfXS6Y3VvazKYALP8EhEQykQVarexR78vRq7ltY3quXx7cgI0ROfZz5Sw3UOLQJ+VoWmwIxu9AMEZLVzFDQN93hzuzs3tNyHK6xspBGB7zGbwCg+TKi0JeqPDrXxYUpAz1cQ/MO+Da0WgvkXnvrry8NQROHejdLVOAslgr6vYthH9bKbsGyNY3H+P12kcxo9RAcVveONnZbcMyxjtF5dWblaernAgMBAAECggEAGdEHlSEPFmAr5PKqKrtoi6tYDHXdyHKHC5tZy4YV+Pp+a6gxxAiUJejx1hRqBcWSPYeKne35BM9dgn5JofgjI5SKzVsuGL6bxl3ayAOu+xXRHWM9f0t8NHoM5fdd0zC3g88dX3fb01geY2QSVtcxSJpEOpNH3twgZe6naT2pgiq1S4okpkpldJPo5GYWGKMCHSLnKGyhwS76gF8bTPLoay9Jxk70uv6BDUMlA4ICENjmsYtd3oirWwLwYMEJbSFMlyJvB7hjOjR/4RpT4FPnlSsIpuRtkCYXD4jdhxGlvpXREw97UF2wwnEUnfgiZJ2FT/MWmvGGoaV/CfboLsLZuQKBgQDTNZdJrs8dbijynHZuuRwvXvwC03GDpEJO6c1tbZ1s9wjRyOZjBbQFRjDgFeWs9/T1aNBLUrgsQL9c9nzgUziXjr1Nmu52I0Mwxi13Km/q3mT+aQfdgNdu6ojsI5apQQHnN/9yMhF6sNHg63YOpH+b+1bGRCtr1XubuLlumKKscwKBgQDOtQ2lQjMtwsqJmyiyRLiUOChtvQ5XI7B2mhKCGi8kZ+WEAbNQcmThPesVzW+puER6D4Ar4hgsh9gCeuTaOzbRfZ+RLn3Aksu2WJEzfs6UrGvm6DU1INn0z/tPYRAwPX7sxoZZGxqML/z+/yQdf2DREoPdClcDa2Lmf1KpHdB+vQKBgBXFCVHz7a8n4pqXG/HvrIMJdEpKRwH9lUQS/zSPPtGzaLpOzchZFyQQBwuh1imM6Te+VPHeldMh3VeUpGxux39/m+160adlnRBS7O7CdgSsZZZ/dusS06HAFNraFDZf1/VgJTk9BeYygX+AZYu+0tReBKSs9BjKSVJUqPBIVUQXAoGBAJcZ7J6oVMcXxHxwqoAeEhtvLcaCU9BJK36XQ/5M67ceJ72mjJC6/plUbNukMAMNyyi62gO6I9exearecRpB/OGIhjNXm99Ar59dAM9228X8gGfryLFMkWcO/fNZzb6lxXmJ6b2LPY3KqpMwqRLTAU/zy+ax30eFoWdDHYa4X6e1AoGAfa8asVGOJ8GL9dlWufEeFkDEDKO9ww5GdnpN+wqLwePWqeJhWCHad7bge6SnlylJp5aZXl1+YaBTtOskC4Whq9TP2J+dNIgxsaF5EFZQJr8Xv+lY9lu0CruYOh9nTNF9x3nubxJgaSid/7yRPfAGnsJRiknB5bsrCvgsFQFjJVs=";let decode_content="";function aes_decrypt(data){let key=CryptoJS.enc.Hex.parse("686A64686E780A0A0A0A0A0A0A0A0A0A");let iv=CryptoJS.enc.Hex.parse("647A797964730A0A0A0A0A0A0A0A0A0A");let encrypted=CryptoJS.AES.decrypt({ciphertext:CryptoJS.enc.Base64.parse(data)},key,{iv:iv,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8);return encrypted}let error_log=false;function logger(text){if(error_log){log(text)}}let decode_funcs=[text=>{try{return ungzip(text)}catch(e){logger("非gzip加密");return""}},text=>{try{return base64Decode(text)}catch(e){logger("非b64加密");return""}},text=>{try{return aes_decrypt(text)}catch(e){logger("非aes加密");return""}},text=>{try{return RSA.decode(text,rsa_private_key,null)}catch(e){logger("非rsa加密");return""}}];let func_index=0;while(!current_match.test(decode_content)){decode_content=decode_funcs[func_index](js_code);func_index++;if(func_index>=decode_funcs.length){break}}return decode_content}function runMain(main_func_code,arg){let mainFunc=function(){return""};try{eval(main_func_code+"\nmainFunc=main;");return mainFunc(arg)}catch(e){log(`执行main_funct发生了错误:${e.message}`);return""}}function init(ext){console.log("init");rule={};rule_fetch_params={};fetch_params=null;try{let muban=模板.getMubans();if(typeof ext=="object"){rule=ext}else if(typeof ext=="string"){if(ext.startsWith("http")||ext.startsWith("file://")){let query=getQuery(ext);let js=request(ext,{method:"GET"});if(js){js=getOriginalJs(js);eval("(function(){"+js.replace("var rule","rule")+"})()")}if(query.type==="url"&&query.params){rule.params=urljoin(ext,query.params)}else if(query.params){rule.params=query.params}}else{ext=getOriginalJs(ext);eval("(function(){"+ext.replace("var rule","rule")+"})()")}}else{console.log(`规则加载失败,不支持的规则类型:${typeof ext}`);return}rule.host=(rule.host||"").rstrip("/");HOST=rule.host;if(rule.hostJs){console.log(`检测到hostJs,准备执行...`);try{eval(rule.hostJs);rule.host=HOST.rstrip("/")}catch(e){console.log(`执行${rule.hostJs}获取host发生错误:${e.message}`)}}if(rule["模板"]==="自动"){try{let host_headers=rule["headers"]||{};let host_html=getCode(HOST,{headers:host_headers});let match_muban="";let muban_keys=Object.keys(muban).filter(it=>!/默认|短视2|采集1/.test(it));for(let muban_key of muban_keys){try{let host_data=JSON.parse(home({},host_html,muban[muban_key].class_parse));if(host_data.class&&host_data.class.length>0){match_muban=muban_key;console.log(`自动匹配模板:【${muban_key}】`);break}}catch(e){console.log(`自动匹配模板:【${muban_key}】错误:${e.message}`)}}if(match_muban){muban["自动"]=muban[match_muban];if(rule["模板修改"]&&rule["模板修改"].startsWith("js:")){eval(rule["模板修改"].replace("js:","").trim())}}else{delete rule["模板"]}}catch(e){delete rule["模板"]}}if(rule.模板&&muban.hasOwnProperty(rule.模板)){print("继承模板:"+rule.模板);rule=Object.assign(muban[rule.模板],rule)}let rule_cate_excludes=(rule.cate_exclude||"").split("|").filter(it=>it.trim());let rule_tab_excludes=(rule.tab_exclude||"").split("|").filter(it=>it.trim());rule_cate_excludes=rule_cate_excludes.concat(CATE_EXCLUDE.split("|").filter(it=>it.trim()));rule_tab_excludes=rule_tab_excludes.concat(TAB_EXCLUDE.split("|").filter(it=>it.trim()));rule.cate_exclude=rule_cate_excludes.join("|");rule.tab_exclude=rule_tab_excludes.join("|");rule.类型=rule.类型||"影视";rule.url=rule.url||"";rule.double=rule.double||false;rule.homeUrl=rule.homeUrl||"";rule.detailUrl=rule.detailUrl||"";rule.searchUrl=rule.searchUrl||"";rule.homeUrl=rule.host&&rule.homeUrl?urljoin(rule.host,rule.homeUrl):rule.homeUrl||rule.host;rule.homeUrl=cheerio.jinja2(rule.homeUrl,{rule:rule});rule.detailUrl=rule.host&&rule.detailUrl?urljoin(rule.host,rule.detailUrl):rule.detailUrl;rule.二级访问前=rule.二级访问前||"";if(rule.url.includes("[")&&rule.url.includes("]")){let u1=rule.url.split("[")[0];let u2=rule.url.split("[")[1].split("]")[0];rule.url=rule.host&&rule.url?urljoin(rule.host,u1)+"["+urljoin(rule.host,u2)+"]":rule.url}else{rule.url=rule.host&&rule.url?urljoin(rule.host,rule.url):rule.url}if(rule.searchUrl.includes("[")&&rule.searchUrl.includes("]")&&!rule.searchUrl.includes("#")){let u1=rule.searchUrl.split("[")[0];let u2=rule.searchUrl.split("[")[1].split("]")[0];rule.searchUrl=rule.host&&rule.searchUrl?urljoin(rule.host,u1)+"["+urljoin(rule.host,u2)+"]":rule.searchUrl}else{rule.searchUrl=rule.host&&rule.searchUrl?urljoin(rule.host,rule.searchUrl):rule.searchUrl}rule.timeout=rule.timeout||5e3;rule.encoding=rule.编码||rule.encoding||"utf-8";rule.search_encoding=rule.搜索编码||rule.search_encoding||"";rule.图片来源=rule.图片来源||"";rule.图片替换=rule.图片替换||"";rule.play_json=rule.hasOwnProperty("play_json")?rule.play_json:[];rule.pagecount=rule.hasOwnProperty("pagecount")?rule.pagecount:{};rule.proxy_rule=rule.hasOwnProperty("proxy_rule")?rule.proxy_rule:"";if(!rule.hasOwnProperty("sniffer")){rule.sniffer=false}rule.sniffer=rule.hasOwnProperty("sniffer")?rule.sniffer:"";rule.sniffer=!!(rule.sniffer&&rule.sniffer!=="0"&&rule.sniffer!=="false");rule.isVideo=rule.hasOwnProperty("isVideo")?rule.isVideo:"";if(rule.sniffer&&!rule.isVideo){rule.isVideo="http((?!http).){12,}?\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)\\?.*|http((?!http).){12,}\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)|http((?!http).)*?video/tos*|http((?!http).)*?obj/tos*"}rule.tab_remove=rule.hasOwnProperty("tab_remove")?rule.tab_remove:[];rule.tab_order=rule.hasOwnProperty("tab_order")?rule.tab_order:[];rule.tab_rename=rule.hasOwnProperty("tab_rename")?rule.tab_rename:{};if(rule.headers&&typeof rule.headers==="object"){try{let header_keys=Object.keys(rule.headers);for(let k of header_keys){if(k.toLowerCase()==="user-agent"){let v=rule.headers[k];console.log(v);if(["MOBILE_UA","PC_UA","UC_UA","IOS_UA","UA"].includes(v)){rule.headers[k]=eval(v)}}else if(k.toLowerCase()==="cookie"){let v=rule.headers[k];if(v&&v.startsWith("http")){console.log(v);try{v=fetch(v);console.log(v);rule.headers[k]=v}catch(e){console.log(`从${v}获取cookie发生错误:${e.message}`)}}}}}catch(e){console.log(`处理headers发生错误:${e.message}`)}}rule_fetch_params={headers:rule.headers||false,timeout:rule.timeout,encoding:rule.encoding};oheaders=rule.headers||{};RKEY=typeof key!=="undefined"&&key?key:"drpy_"+(rule.title||rule.host);pre();init_test()}catch(e){console.log(`init_test发生错误:${e.message}`)}}let homeHtmlCache=undefined;function home(filter,home_html,class_parse){console.log("home");home_html=home_html||"";class_parse=class_parse||"";if(typeof rule.filter==="string"&&rule.filter.trim().length>0){try{let filter_json=ungzip(rule.filter.trim());rule.filter=JSON.parse(filter_json)}catch(e){rule.filter={}}}let homeObj={filter:rule.filter||false,MY_URL:rule.homeUrl,class_name:rule.class_name||"",class_url:rule.class_url||"",class_parse:class_parse||rule.class_parse||"",cate_exclude:rule.cate_exclude,home_html:home_html};return homeParse(homeObj)}function homeVod(params){console.log("homeVod");let homeVodObj={"推荐":rule.推荐,double:rule.double,homeUrl:rule.homeUrl,detailUrl:rule.detailUrl};return homeVodParse(homeVodObj)}function category(tid,pg,filter,extend){let cateObj={url:rule.url,"一级":rule.一级,tid:tid,pg:parseInt(pg),filter:filter,extend:extend};return categoryParse(cateObj)}function detail(vod_url){let orId=vod_url;let fyclass="";log("orId:"+orId);if(vod_url.indexOf("$")>-1){let tmp=vod_url.split("$");fyclass=tmp[0];vod_url=tmp[1]}let detailUrl=vod_url.split("@@")[0];let url;if(!detailUrl.startsWith("http")&&!detailUrl.includes("/")){url=rule.detailUrl.replaceAll("fyid",detailUrl).replaceAll("fyclass",fyclass)}else if(detailUrl.includes("/")){url=urljoin(rule.homeUrl,detailUrl)}else{url=detailUrl}let detailObj={orId:orId,url:url,"二级":rule.二级,"二级访问前":rule.二级访问前,detailUrl:detailUrl,fyclass:fyclass,tab_exclude:rule.tab_exclude};return detailParse(detailObj)}function play(flag,id,flags){let playObj={url:id,flag:flag,flags:flags};return playParse(playObj)}function search(wd,quick,pg){if(rule.search_encoding){if(rule.search_encoding.toLowerCase()!=="utf-8"){wd=encodeStr(wd,rule.search_encoding)}}else if(rule.encoding&&rule.encoding.toLowerCase()!=="utf-8"){wd=encodeStr(wd,rule.encoding)}let searchObj={searchUrl:rule.searchUrl,"搜索":rule.搜索,wd:wd,pg:pg||1,quick:quick};return searchParse(searchObj)}function proxy(params){if(rule.proxy_rule&&rule.proxy_rule.trim()){rule.proxy_rule=rule.proxy_rule.trim()}if(rule.proxy_rule.startsWith("js:")){rule.proxy_rule=rule.proxy_rule.replace("js:","")}let proxyObj={params:params,proxy_rule:rule.proxy_rule};return proxyParse(proxyObj)}function sniffer(){let enable_sniffer=rule.sniffer||false;if(enable_sniffer){log("开始执行辅助嗅探代理规则...")}return enable_sniffer}function isVideo(url){let t=0;let is_video;if(rule.isVideo&&rule.isVideo.trim()){is_video=rule.isVideo.trim()}if(is_video.startsWith("js:")){is_video=is_video.replace("js:","");t=1}let isVideoObj={url:url,isVideo:is_video,t:t};let result=isVideoParse(isVideoObj);if(result){log("成功执行辅助嗅探规则并检测到视频地址:\n"+rule.isVideo)}return result}function getRule(key){return key?rule[key]||"":rule}function DRPY(){return{runMain:runMain,getRule:getRule,init:init,home:home,homeVod:homeVod,category:category,detail:detail,play:play,search:search,proxy:proxy,sniffer:sniffer,isVideo:isVideo,fixAdM3u8Ai:fixAdM3u8Ai}}export default{runMain:runMain,getRule:getRule,init:init,home:home,homeVod:homeVod,category:category,detail:detail,play:play,search:search,proxy:proxy,sniffer:sniffer,isVideo:isVideo,fixAdM3u8Ai:fixAdM3u8Ai,DRPY:DRPY}; \ No newline at end of file diff --git a/FTY/jinja.js b/FTY/jinja.js new file mode 100644 index 00000000..80737afb --- /dev/null +++ b/FTY/jinja.js @@ -0,0 +1,577 @@ +/*! + * Jinja Templating for JavaScript v0.1.8 + * https://github.com/sstur/jinja-js + * + * This is a slimmed-down Jinja2 implementation [http://jinja.pocoo.org/] + * + * In the interest of simplicity, it deviates from Jinja2 as follows: + * - Line statements, cycle, super, macro tags and block nesting are not implemented + * - auto escapes html by default (the filter is "html" not "e") + * - Only "html" and "safe" filters are built in + * - Filters are not valid in expressions; `foo|length > 1` is not valid + * - Expression Tests (`if num is odd`) not implemented (`is` translates to `==` and `isnot` to `!=`) + * + * Notes: + * - if property is not found, but method '_get' exists, it will be called with the property name (and cached) + * - `{% for n in obj %}` iterates the object's keys; get the value with `{% for n in obj %}{{ obj[n] }}{% endfor %}` + * - subscript notation `a[0]` takes literals or simple variables but not `a[item.key]` + * - `.2` is not a valid number literal; use `0.2` + * + */ +/*global require, exports, module, define */ + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jinja = {})); +})(this, (function (jinja) { + "use strict"; + var STRINGS = /'(\\.|[^'])*'|"(\\.|[^"'"])*"/g; + var IDENTS_AND_NUMS = /([$_a-z][$\w]*)|([+-]?\d+(\.\d+)?)/g; + var NUMBER = /^[+-]?\d+(\.\d+)?$/; + //non-primitive literals (array and object literals) + var NON_PRIMITIVES = /\[[@#~](,[@#~])*\]|\[\]|\{([@i]:[@#~])(,[@i]:[@#~])*\}|\{\}/g; + //bare identifiers such as variables and in object literals: {foo: 'value'} + var IDENTIFIERS = /[$_a-z][$\w]*/ig; + var VARIABLES = /i(\.i|\[[@#i]\])*/g; + var ACCESSOR = /(\.i|\[[@#i]\])/g; + var OPERATORS = /(===?|!==?|>=?|<=?|&&|\|\||[+\-\*\/%])/g; + //extended (english) operators + var EOPS = /(^|[^$\w])(and|or|not|is|isnot)([^$\w]|$)/g; + var LEADING_SPACE = /^\s+/; + var TRAILING_SPACE = /\s+$/; + + var START_TOKEN = /\{\{\{|\{\{|\{%|\{#/; + var TAGS = { + '{{{': /^('(\\.|[^'])*'|"(\\.|[^"'"])*"|.)+?\}\}\}/, + '{{': /^('(\\.|[^'])*'|"(\\.|[^"'"])*"|.)+?\}\}/, + '{%': /^('(\\.|[^'])*'|"(\\.|[^"'"])*"|.)+?%\}/, + '{#': /^('(\\.|[^'])*'|"(\\.|[^"'"])*"|.)+?#\}/ + }; + + var delimeters = { + '{%': 'directive', + '{{': 'output', + '{#': 'comment' + }; + + var operators = { + and: '&&', + or: '||', + not: '!', + is: '==', + isnot: '!=' + }; + + var constants = { + 'true': true, + 'false': false, + 'null': null + }; + + function Parser() { + this.nest = []; + this.compiled = []; + this.childBlocks = 0; + this.parentBlocks = 0; + this.isSilent = false; + } + + Parser.prototype.push = function (line) { + if (!this.isSilent) { + this.compiled.push(line); + } + }; + + Parser.prototype.parse = function (src) { + this.tokenize(src); + return this.compiled; + }; + + Parser.prototype.tokenize = function (src) { + var lastEnd = 0, parser = this, trimLeading = false; + matchAll(src, START_TOKEN, function (open, index, src) { + //here we match the rest of the src against a regex for this tag + var match = src.slice(index + open.length).match(TAGS[open]); + match = (match ? match[0] : ''); + //here we sub out strings so we don't get false matches + var simplified = match.replace(STRINGS, '@'); + //if we don't have a close tag or there is a nested open tag + if (!match || ~simplified.indexOf(open)) { + return index + 1; + } + var inner = match.slice(0, 0 - open.length); + //check for white-space collapse syntax + if (inner.charAt(0) === '-') var wsCollapseLeft = true; + if (inner.slice(-1) === '-') var wsCollapseRight = true; + inner = inner.replace(/^-|-$/g, '').trim(); + //if we're in raw mode and we are not looking at an "endraw" tag, move along + if (parser.rawMode && (open + inner) !== '{%endraw') { + return index + 1; + } + var text = src.slice(lastEnd, index); + lastEnd = index + open.length + match.length; + if (trimLeading) text = trimLeft(text); + if (wsCollapseLeft) text = trimRight(text); + if (wsCollapseRight) trimLeading = true; + if (open === '{{{') { + //liquid-style: make {{{x}}} => {{x|safe}} + open = '{{'; + inner += '|safe'; + } + parser.textHandler(text); + parser.tokenHandler(open, inner); + }); + var text = src.slice(lastEnd); + if (trimLeading) text = trimLeft(text); + this.textHandler(text); + }; + + Parser.prototype.textHandler = function (text) { + this.push('write(' + JSON.stringify(text) + ');'); + }; + + Parser.prototype.tokenHandler = function (open, inner) { + var type = delimeters[open]; + if (type === 'directive') { + this.compileTag(inner); + } else if (type === 'output') { + var extracted = this.extractEnt(inner, STRINGS, '@'); + //replace || operators with ~ + extracted.src = extracted.src.replace(/\|\|/g, '~').split('|'); + //put back || operators + extracted.src = extracted.src.map(function (part) { + return part.split('~').join('||'); + }); + var parts = this.injectEnt(extracted, '@'); + if (parts.length > 1) { + var filters = parts.slice(1).map(this.parseFilter.bind(this)); + this.push('filter(' + this.parseExpr(parts[0]) + ',' + filters.join(',') + ');'); + } else { + this.push('filter(' + this.parseExpr(parts[0]) + ');'); + } + } + }; + + Parser.prototype.compileTag = function (str) { + var directive = str.split(' ')[0]; + var handler = tagHandlers[directive]; + if (!handler) { + throw new Error('Invalid tag: ' + str); + } + handler.call(this, str.slice(directive.length).trim()); + }; + + Parser.prototype.parseFilter = function (src) { + src = src.trim(); + var match = src.match(/[:(]/); + var i = match ? match.index : -1; + if (i < 0) return JSON.stringify([src]); + var name = src.slice(0, i); + var args = src.charAt(i) === ':' ? src.slice(i + 1) : src.slice(i + 1, -1); + args = this.parseExpr(args, {terms: true}); + return '[' + JSON.stringify(name) + ',' + args + ']'; + }; + + Parser.prototype.extractEnt = function (src, regex, placeholder) { + var subs = [], isFunc = typeof placeholder == 'function'; + src = src.replace(regex, function (str) { + var replacement = isFunc ? placeholder(str) : placeholder; + if (replacement) { + subs.push(str); + return replacement; + } + return str; + }); + return {src: src, subs: subs}; + }; + + Parser.prototype.injectEnt = function (extracted, placeholder) { + var src = extracted.src, subs = extracted.subs, isArr = Array.isArray(src); + var arr = (isArr) ? src : [src]; + var re = new RegExp('[' + placeholder + ']', 'g'), i = 0; + arr.forEach(function (src, index) { + arr[index] = src.replace(re, function () { + return subs[i++]; + }); + }); + return isArr ? arr : arr[0]; + }; + + //replace complex literals without mistaking subscript notation with array literals + Parser.prototype.replaceComplex = function (s) { + var parsed = this.extractEnt(s, /i(\.i|\[[@#i]\])+/g, 'v'); + parsed.src = parsed.src.replace(NON_PRIMITIVES, '~'); + return this.injectEnt(parsed, 'v'); + }; + + //parse expression containing literals (including objects/arrays) and variables (including dot and subscript notation) + //valid expressions: `a + 1 > b.c or c == null`, `a and b[1] != c`, `(a < b) or (c < d and e)`, 'a || [1]` + Parser.prototype.parseExpr = function (src, opts) { + opts = opts || {}; + //extract string literals -> @ + var parsed1 = this.extractEnt(src, STRINGS, '@'); + //note: this will catch {not: 1} and a.is; could we replace temporarily and then check adjacent chars? + parsed1.src = parsed1.src.replace(EOPS, function (s, before, op, after) { + return (op in operators) ? before + operators[op] + after : s; + }); + //sub out non-string literals (numbers/true/false/null) -> # + // the distinction is necessary because @ can be object identifiers, # cannot + var parsed2 = this.extractEnt(parsed1.src, IDENTS_AND_NUMS, function (s) { + return (s in constants || NUMBER.test(s)) ? '#' : null; + }); + //sub out object/variable identifiers -> i + var parsed3 = this.extractEnt(parsed2.src, IDENTIFIERS, 'i'); + //remove white-space + parsed3.src = parsed3.src.replace(/\s+/g, ''); + + //the rest of this is simply to boil the expression down and check validity + var simplified = parsed3.src; + //sub out complex literals (objects/arrays) -> ~ + // the distinction is necessary because @ and # can be subscripts but ~ cannot + while (simplified !== (simplified = this.replaceComplex(simplified))) ; + //now @ represents strings, # represents other primitives and ~ represents non-primitives + //replace complex variables (those with dot/subscript accessors) -> v + while (simplified !== (simplified = simplified.replace(/i(\.i|\[[@#i]\])+/, 'v'))) ; + //empty subscript or complex variables in subscript, are not permitted + simplified = simplified.replace(/[iv]\[v?\]/g, 'x'); + //sub in "i" for @ and # and ~ and v (now "i" represents all literals, variables and identifiers) + simplified = simplified.replace(/[@#~v]/g, 'i'); + //sub out operators + simplified = simplified.replace(OPERATORS, '%'); + //allow 'not' unary operator + simplified = simplified.replace(/!+[i]/g, 'i'); + var terms = opts.terms ? simplified.split(',') : [simplified]; + terms.forEach(function (term) { + //simplify logical grouping + while (term !== (term = term.replace(/\(i(%i)*\)/g, 'i'))) ; + if (!term.match(/^i(%i)*/)) { + throw new Error('Invalid expression: ' + src + " " + term); + } + }); + parsed3.src = parsed3.src.replace(VARIABLES, this.parseVar.bind(this)); + parsed2.src = this.injectEnt(parsed3, 'i'); + parsed1.src = this.injectEnt(parsed2, '#'); + return this.injectEnt(parsed1, '@'); + }; + + Parser.prototype.parseVar = function (src) { + var args = Array.prototype.slice.call(arguments); + var str = args.pop(), index = args.pop(); + //quote bare object identifiers (might be a reserved word like {while: 1}) + if (src === 'i' && str.charAt(index + 1) === ':') { + return '"i"'; + } + var parts = ['"i"']; + src.replace(ACCESSOR, function (part) { + if (part === '.i') { + parts.push('"i"'); + } else if (part === '[i]') { + parts.push('get("i")'); + } else { + parts.push(part.slice(1, -1)); + } + }); + return 'get(' + parts.join(',') + ')'; + }; + + //escapes a name to be used as a javascript identifier + Parser.prototype.escName = function (str) { + return str.replace(/\W/g, function (s) { + return '$' + s.charCodeAt(0).toString(16); + }); + }; + + Parser.prototype.parseQuoted = function (str) { + if (str.charAt(0) === "'") { + str = str.slice(1, -1).replace(/\\.|"/, function (s) { + if (s === "\\'") return "'"; + return s.charAt(0) === '\\' ? s : ('\\' + s); + }); + str = '"' + str + '"'; + } + //todo: try/catch or deal with invalid characters (linebreaks, control characters) + return JSON.parse(str); + }; + + + //the context 'this' inside tagHandlers is the parser instance + var tagHandlers = { + 'if': function (expr) { + this.push('if (' + this.parseExpr(expr) + ') {'); + this.nest.unshift('if'); + }, + 'else': function () { + if (this.nest[0] === 'for') { + this.push('}, function() {'); + } else { + this.push('} else {'); + } + }, + 'elseif': function (expr) { + this.push('} else if (' + this.parseExpr(expr) + ') {'); + }, + 'endif': function () { + this.nest.shift(); + this.push('}'); + }, + 'for': function (str) { + var i = str.indexOf(' in '); + var name = str.slice(0, i).trim(); + var expr = str.slice(i + 4).trim(); + this.push('each(' + this.parseExpr(expr) + ',' + JSON.stringify(name) + ',function() {'); + this.nest.unshift('for'); + }, + 'endfor': function () { + this.nest.shift(); + this.push('});'); + }, + 'raw': function () { + this.rawMode = true; + }, + 'endraw': function () { + this.rawMode = false; + }, + 'set': function (stmt) { + var i = stmt.indexOf('='); + var name = stmt.slice(0, i).trim(); + var expr = stmt.slice(i + 1).trim(); + this.push('set(' + JSON.stringify(name) + ',' + this.parseExpr(expr) + ');'); + }, + 'block': function (name) { + if (this.isParent) { + ++this.parentBlocks; + var blockName = 'block_' + (this.escName(name) || this.parentBlocks); + this.push('block(typeof ' + blockName + ' == "function" ? ' + blockName + ' : function() {'); + } else if (this.hasParent) { + this.isSilent = false; + ++this.childBlocks; + blockName = 'block_' + (this.escName(name) || this.childBlocks); + this.push('function ' + blockName + '() {'); + } + this.nest.unshift('block'); + }, + 'endblock': function () { + this.nest.shift(); + if (this.isParent) { + this.push('});'); + } else if (this.hasParent) { + this.push('}'); + this.isSilent = true; + } + }, + 'extends': function (name) { + name = this.parseQuoted(name); + var parentSrc = this.readTemplateFile(name); + this.isParent = true; + this.tokenize(parentSrc); + this.isParent = false; + this.hasParent = true; + //silence output until we enter a child block + this.isSilent = true; + }, + 'include': function (name) { + name = this.parseQuoted(name); + var incSrc = this.readTemplateFile(name); + this.isInclude = true; + this.tokenize(incSrc); + this.isInclude = false; + } + }; + + //liquid style + tagHandlers.assign = tagHandlers.set; + //python/django style + tagHandlers.elif = tagHandlers.elseif; + + var getRuntime = function runtime(data, opts) { + var defaults = {autoEscape: 'toJson'}; + var _toString = Object.prototype.toString; + var _hasOwnProperty = Object.prototype.hasOwnProperty; + var getKeys = Object.keys || function (obj) { + var keys = []; + for (var n in obj) if (_hasOwnProperty.call(obj, n)) keys.push(n); + return keys; + }; + var isArray = Array.isArray || function (obj) { + return _toString.call(obj) === '[object Array]'; + }; + var create = Object.create || function (obj) { + function F() { + } + + F.prototype = obj; + return new F(); + }; + var toString = function (val) { + if (val == null) return ''; + return (typeof val.toString == 'function') ? val.toString() : _toString.call(val); + }; + var extend = function (dest, src) { + var keys = getKeys(src); + for (var i = 0, len = keys.length; i < len; i++) { + var key = keys[i]; + dest[key] = src[key]; + } + return dest; + }; + //get a value, lexically, starting in current context; a.b -> get("a","b") + var get = function () { + var val, n = arguments[0], c = stack.length; + while (c--) { + val = stack[c][n]; + if (typeof val != 'undefined') break; + } + for (var i = 1, len = arguments.length; i < len; i++) { + if (val == null) continue; + n = arguments[i]; + val = (_hasOwnProperty.call(val, n)) ? val[n] : (typeof val._get == 'function' ? (val[n] = val._get(n)) : null); + } + return (val == null) ? '' : val; + }; + var set = function (n, val) { + stack[stack.length - 1][n] = val; + }; + var push = function (ctx) { + stack.push(ctx || {}); + }; + var pop = function () { + stack.pop(); + }; + var write = function (str) { + output.push(str); + }; + var filter = function (val) { + for (var i = 1, len = arguments.length; i < len; i++) { + var arr = arguments[i], name = arr[0], filter = filters[name]; + if (filter) { + arr[0] = val; + //now arr looks like [val, arg1, arg2] + val = filter.apply(data, arr); + } else { + throw new Error('Invalid filter: ' + name); + } + } + if (opts.autoEscape && name !== opts.autoEscape && name !== 'safe') { + //auto escape if not explicitly safe or already escaped + val = filters[opts.autoEscape].call(data, val); + } + output.push(val); + }; + var each = function (obj, loopvar, fn1, fn2) { + if (obj == null) return; + var arr = isArray(obj) ? obj : getKeys(obj), len = arr.length; + var ctx = {loop: {length: len, first: arr[0], last: arr[len - 1]}}; + push(ctx); + for (var i = 0; i < len; i++) { + extend(ctx.loop, {index: i + 1, index0: i}); + fn1(ctx[loopvar] = arr[i]); + } + if (len === 0 && fn2) fn2(); + pop(); + }; + var block = function (fn) { + push(); + fn(); + pop(); + }; + var render = function () { + return output.join(''); + }; + data = data || {}; + opts = extend(defaults, opts || {}); + var filters = extend({ + html: function (val) { + return toString(val) + .split('&').join('&') + .split('<').join('<') + .split('>').join('>') + .split('"').join('"'); + }, + safe: function (val) { + return val; + }, + toJson: function (val) { + if (typeof val === 'object') { + return JSON.stringify(val); + } + return toString(val); + } + }, opts.filters || {}); + var stack = [create(data || {})], output = []; + return { + get: get, + set: set, + push: push, + pop: pop, + write: write, + filter: filter, + each: each, + block: block, + render: render + }; + }; + + var runtime; + + jinja.compile = function (markup, opts) { + opts = opts || {}; + var parser = new Parser(); + parser.readTemplateFile = this.readTemplateFile; + var code = []; + code.push('function render($) {'); + code.push('var get = $.get, set = $.set, push = $.push, pop = $.pop, write = $.write, filter = $.filter, each = $.each, block = $.block;'); + code.push.apply(code, parser.parse(markup)); + code.push('return $.render();'); + code.push('}'); + code = code.join('\n'); + if (opts.runtime === false) { + var fn = new Function('data', 'options', 'return (' + code + ')(runtime(data, options))'); + } else { + runtime = runtime || (runtime = getRuntime.toString()); + fn = new Function('data', 'options', 'return (' + code + ')((' + runtime + ')(data, options))'); + } + return {render: fn}; + }; + + jinja.render = function (markup, data, opts) { + var tmpl = jinja.compile(markup); + return tmpl.render(data, opts); + }; + + jinja.templateFiles = []; + + jinja.readTemplateFile = function (name) { + var templateFiles = this.templateFiles || []; + var templateFile = templateFiles[name]; + if (templateFile == null) { + throw new Error('Template file not found: ' + name); + } + return templateFile; + }; + + + /*! + * Helpers + */ + + function trimLeft(str) { + return str.replace(LEADING_SPACE, ''); + } + + function trimRight(str) { + return str.replace(TRAILING_SPACE, ''); + } + + function matchAll(str, reg, fn) { + //copy as global + reg = new RegExp(reg.source, 'g' + (reg.ignoreCase ? 'i' : '') + (reg.multiline ? 'm' : '')); + var match; + while ((match = reg.exec(str))) { + var result = fn(match[0], match.index, str); + if (typeof result == 'number') { + reg.lastIndex = result; + } + } + } +})); \ No newline at end of file diff --git a/FTY/json5.js b/FTY/json5.js new file mode 100644 index 00000000..cd76909a --- /dev/null +++ b/FTY/json5.js @@ -0,0 +1,1737 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.JSON5 = factory()); +}(this, (function () { 'use strict'; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var _global = createCommonjsModule(function (module) { + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); + if (typeof __g == 'number') { __g = global; } // eslint-disable-line no-undef + }); + + var _core = createCommonjsModule(function (module) { + var core = module.exports = { version: '2.6.5' }; + if (typeof __e == 'number') { __e = core; } // eslint-disable-line no-undef + }); + var _core_1 = _core.version; + + var _isObject = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; + }; + + var _anObject = function (it) { + if (!_isObject(it)) { throw TypeError(it + ' is not an object!'); } + return it; + }; + + var _fails = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } + }; + + // Thank's IE8 for his funny defineProperty + var _descriptors = !_fails(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; + }); + + var document = _global.document; + // typeof document.createElement is 'object' in old IE + var is = _isObject(document) && _isObject(document.createElement); + var _domCreate = function (it) { + return is ? document.createElement(it) : {}; + }; + + var _ie8DomDefine = !_descriptors && !_fails(function () { + return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7; + }); + + // 7.1.1 ToPrimitive(input [, PreferredType]) + + // instead of the ES6 spec version, we didn't implement @@toPrimitive case + // and the second argument - flag - preferred type is a string + var _toPrimitive = function (it, S) { + if (!_isObject(it)) { return it; } + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; } + if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) { return val; } + if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; } + throw TypeError("Can't convert object to primitive value"); + }; + + var dP = Object.defineProperty; + + var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) { + _anObject(O); + P = _toPrimitive(P, true); + _anObject(Attributes); + if (_ie8DomDefine) { try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } } + if ('get' in Attributes || 'set' in Attributes) { throw TypeError('Accessors not supported!'); } + if ('value' in Attributes) { O[P] = Attributes.value; } + return O; + }; + + var _objectDp = { + f: f + }; + + var _propertyDesc = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; + }; + + var _hide = _descriptors ? function (object, key, value) { + return _objectDp.f(object, key, _propertyDesc(1, value)); + } : function (object, key, value) { + object[key] = value; + return object; + }; + + var hasOwnProperty = {}.hasOwnProperty; + var _has = function (it, key) { + return hasOwnProperty.call(it, key); + }; + + var id = 0; + var px = Math.random(); + var _uid = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); + }; + + var _library = false; + + var _shared = createCommonjsModule(function (module) { + var SHARED = '__core-js_shared__'; + var store = _global[SHARED] || (_global[SHARED] = {}); + + (module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); + })('versions', []).push({ + version: _core.version, + mode: _library ? 'pure' : 'global', + copyright: '© 2019 Denis Pushkarev (zloirock.ru)' + }); + }); + + var _functionToString = _shared('native-function-to-string', Function.toString); + + var _redefine = createCommonjsModule(function (module) { + var SRC = _uid('src'); + + var TO_STRING = 'toString'; + var TPL = ('' + _functionToString).split(TO_STRING); + + _core.inspectSource = function (it) { + return _functionToString.call(it); + }; + + (module.exports = function (O, key, val, safe) { + var isFunction = typeof val == 'function'; + if (isFunction) { _has(val, 'name') || _hide(val, 'name', key); } + if (O[key] === val) { return; } + if (isFunction) { _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); } + if (O === _global) { + O[key] = val; + } else if (!safe) { + delete O[key]; + _hide(O, key, val); + } else if (O[key]) { + O[key] = val; + } else { + _hide(O, key, val); + } + // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative + })(Function.prototype, TO_STRING, function toString() { + return typeof this == 'function' && this[SRC] || _functionToString.call(this); + }); + }); + + var _aFunction = function (it) { + if (typeof it != 'function') { throw TypeError(it + ' is not a function!'); } + return it; + }; + + // optional / simple context binding + + var _ctx = function (fn, that, length) { + _aFunction(fn); + if (that === undefined) { return fn; } + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; + }; + + var PROTOTYPE = 'prototype'; + + var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE]; + var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {}); + var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); + var key, own, out, exp; + if (IS_GLOBAL) { source = name; } + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out; + // extend global + if (target) { _redefine(target, key, out, type & $export.U); } + // export + if (exports[key] != out) { _hide(exports, key, exp); } + if (IS_PROTO && expProto[key] != out) { expProto[key] = out; } + } + }; + _global.core = _core; + // type bitmap + $export.F = 1; // forced + $export.G = 2; // global + $export.S = 4; // static + $export.P = 8; // proto + $export.B = 16; // bind + $export.W = 32; // wrap + $export.U = 64; // safe + $export.R = 128; // real proto method for `library` + var _export = $export; + + // 7.1.4 ToInteger + var ceil = Math.ceil; + var floor = Math.floor; + var _toInteger = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); + }; + + // 7.2.1 RequireObjectCoercible(argument) + var _defined = function (it) { + if (it == undefined) { throw TypeError("Can't call method on " + it); } + return it; + }; + + // true -> String#at + // false -> String#codePointAt + var _stringAt = function (TO_STRING) { + return function (that, pos) { + var s = String(_defined(that)); + var i = _toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) { return TO_STRING ? '' : undefined; } + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; + }; + + var $at = _stringAt(false); + _export(_export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos) { + return $at(this, pos); + } + }); + + var codePointAt = _core.String.codePointAt; + + var max = Math.max; + var min = Math.min; + var _toAbsoluteIndex = function (index, length) { + index = _toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); + }; + + var fromCharCode = String.fromCharCode; + var $fromCodePoint = String.fromCodePoint; + + // length should be 1, old FF problem + _export(_export.S + _export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x) { + var arguments$1 = arguments; + // eslint-disable-line no-unused-vars + var res = []; + var aLen = arguments.length; + var i = 0; + var code; + while (aLen > i) { + code = +arguments$1[i++]; + if (_toAbsoluteIndex(code, 0x10ffff) !== code) { throw RangeError(code + ' is not a valid code point'); } + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } + }); + + var fromCodePoint = _core.String.fromCodePoint; + + // This is a generated file. Do not edit. + var Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/; + var ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/; + var ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/; + + var unicode = { + Space_Separator: Space_Separator, + ID_Start: ID_Start, + ID_Continue: ID_Continue + }; + + var util = { + isSpaceSeparator: function isSpaceSeparator (c) { + return typeof c === 'string' && unicode.Space_Separator.test(c) + }, + + isIdStartChar: function isIdStartChar (c) { + return typeof c === 'string' && ( + (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c === '$') || (c === '_') || + unicode.ID_Start.test(c) + ) + }, + + isIdContinueChar: function isIdContinueChar (c) { + return typeof c === 'string' && ( + (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c >= '0' && c <= '9') || + (c === '$') || (c === '_') || + (c === '\u200C') || (c === '\u200D') || + unicode.ID_Continue.test(c) + ) + }, + + isDigit: function isDigit (c) { + return typeof c === 'string' && /[0-9]/.test(c) + }, + + isHexDigit: function isHexDigit (c) { + return typeof c === 'string' && /[0-9A-Fa-f]/.test(c) + }, + }; + + var source; + var parseState; + var stack; + var pos; + var line; + var column; + var token; + var key; + var root; + + var parse = function parse (text, reviver) { + source = String(text); + parseState = 'start'; + stack = []; + pos = 0; + line = 1; + column = 0; + token = undefined; + key = undefined; + root = undefined; + + do { + token = lex(); + + // This code is unreachable. + // if (!parseStates[parseState]) { + // throw invalidParseState() + // } + + parseStates[parseState](); + } while (token.type !== 'eof') + + if (typeof reviver === 'function') { + return internalize({'': root}, '', reviver) + } + + return root + }; + + function internalize (holder, name, reviver) { + var value = holder[name]; + if (value != null && typeof value === 'object') { + if (Array.isArray(value)) { + for (var i = 0; i < value.length; i++) { + var key = String(i); + var replacement = internalize(value, key, reviver); + if (replacement === undefined) { + delete value[key]; + } else { + Object.defineProperty(value, key, { + value: replacement, + writable: true, + enumerable: true, + configurable: true, + }); + } + } + } else { + for (var key$1 in value) { + var replacement$1 = internalize(value, key$1, reviver); + if (replacement$1 === undefined) { + delete value[key$1]; + } else { + Object.defineProperty(value, key$1, { + value: replacement$1, + writable: true, + enumerable: true, + configurable: true, + }); + } + } + } + } + + return reviver.call(holder, name, value) + } + + var lexState; + var buffer; + var doubleQuote; + var sign; + var c; + + function lex () { + lexState = 'default'; + buffer = ''; + doubleQuote = false; + sign = 1; + + for (;;) { + c = peek(); + + // This code is unreachable. + // if (!lexStates[lexState]) { + // throw invalidLexState(lexState) + // } + + var token = lexStates[lexState](); + if (token) { + return token + } + } + } + + function peek () { + if (source[pos]) { + return String.fromCodePoint(source.codePointAt(pos)) + } + } + + function read () { + var c = peek(); + + if (c === '\n') { + line++; + column = 0; + } else if (c) { + column += c.length; + } else { + column++; + } + + if (c) { + pos += c.length; + } + + return c + } + + var lexStates = { + default: function default$1 () { + switch (c) { + case '\t': + case '\v': + case '\f': + case ' ': + case '\u00A0': + case '\uFEFF': + case '\n': + case '\r': + case '\u2028': + case '\u2029': + read(); + return + + case '/': + read(); + lexState = 'comment'; + return + + case undefined: + read(); + return newToken('eof') + } + + if (util.isSpaceSeparator(c)) { + read(); + return + } + + // This code is unreachable. + // if (!lexStates[parseState]) { + // throw invalidLexState(parseState) + // } + + return lexStates[parseState]() + }, + + comment: function comment () { + switch (c) { + case '*': + read(); + lexState = 'multiLineComment'; + return + + case '/': + read(); + lexState = 'singleLineComment'; + return + } + + throw invalidChar(read()) + }, + + multiLineComment: function multiLineComment () { + switch (c) { + case '*': + read(); + lexState = 'multiLineCommentAsterisk'; + return + + case undefined: + throw invalidChar(read()) + } + + read(); + }, + + multiLineCommentAsterisk: function multiLineCommentAsterisk () { + switch (c) { + case '*': + read(); + return + + case '/': + read(); + lexState = 'default'; + return + + case undefined: + throw invalidChar(read()) + } + + read(); + lexState = 'multiLineComment'; + }, + + singleLineComment: function singleLineComment () { + switch (c) { + case '\n': + case '\r': + case '\u2028': + case '\u2029': + read(); + lexState = 'default'; + return + + case undefined: + read(); + return newToken('eof') + } + + read(); + }, + + value: function value () { + switch (c) { + case '{': + case '[': + return newToken('punctuator', read()) + + case 'n': + read(); + literal('ull'); + return newToken('null', null) + + case 't': + read(); + literal('rue'); + return newToken('boolean', true) + + case 'f': + read(); + literal('alse'); + return newToken('boolean', false) + + case '-': + case '+': + if (read() === '-') { + sign = -1; + } + + lexState = 'sign'; + return + + case '.': + buffer = read(); + lexState = 'decimalPointLeading'; + return + + case '0': + buffer = read(); + lexState = 'zero'; + return + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + buffer = read(); + lexState = 'decimalInteger'; + return + + case 'I': + read(); + literal('nfinity'); + return newToken('numeric', Infinity) + + case 'N': + read(); + literal('aN'); + return newToken('numeric', NaN) + + case '"': + case "'": + doubleQuote = (read() === '"'); + buffer = ''; + lexState = 'string'; + return + } + + throw invalidChar(read()) + }, + + identifierNameStartEscape: function identifierNameStartEscape () { + if (c !== 'u') { + throw invalidChar(read()) + } + + read(); + var u = unicodeEscape(); + switch (u) { + case '$': + case '_': + break + + default: + if (!util.isIdStartChar(u)) { + throw invalidIdentifier() + } + + break + } + + buffer += u; + lexState = 'identifierName'; + }, + + identifierName: function identifierName () { + switch (c) { + case '$': + case '_': + case '\u200C': + case '\u200D': + buffer += read(); + return + + case '\\': + read(); + lexState = 'identifierNameEscape'; + return + } + + if (util.isIdContinueChar(c)) { + buffer += read(); + return + } + + return newToken('identifier', buffer) + }, + + identifierNameEscape: function identifierNameEscape () { + if (c !== 'u') { + throw invalidChar(read()) + } + + read(); + var u = unicodeEscape(); + switch (u) { + case '$': + case '_': + case '\u200C': + case '\u200D': + break + + default: + if (!util.isIdContinueChar(u)) { + throw invalidIdentifier() + } + + break + } + + buffer += u; + lexState = 'identifierName'; + }, + + sign: function sign$1 () { + switch (c) { + case '.': + buffer = read(); + lexState = 'decimalPointLeading'; + return + + case '0': + buffer = read(); + lexState = 'zero'; + return + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + buffer = read(); + lexState = 'decimalInteger'; + return + + case 'I': + read(); + literal('nfinity'); + return newToken('numeric', sign * Infinity) + + case 'N': + read(); + literal('aN'); + return newToken('numeric', NaN) + } + + throw invalidChar(read()) + }, + + zero: function zero () { + switch (c) { + case '.': + buffer += read(); + lexState = 'decimalPoint'; + return + + case 'e': + case 'E': + buffer += read(); + lexState = 'decimalExponent'; + return + + case 'x': + case 'X': + buffer += read(); + lexState = 'hexadecimal'; + return + } + + return newToken('numeric', sign * 0) + }, + + decimalInteger: function decimalInteger () { + switch (c) { + case '.': + buffer += read(); + lexState = 'decimalPoint'; + return + + case 'e': + case 'E': + buffer += read(); + lexState = 'decimalExponent'; + return + } + + if (util.isDigit(c)) { + buffer += read(); + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + decimalPointLeading: function decimalPointLeading () { + if (util.isDigit(c)) { + buffer += read(); + lexState = 'decimalFraction'; + return + } + + throw invalidChar(read()) + }, + + decimalPoint: function decimalPoint () { + switch (c) { + case 'e': + case 'E': + buffer += read(); + lexState = 'decimalExponent'; + return + } + + if (util.isDigit(c)) { + buffer += read(); + lexState = 'decimalFraction'; + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + decimalFraction: function decimalFraction () { + switch (c) { + case 'e': + case 'E': + buffer += read(); + lexState = 'decimalExponent'; + return + } + + if (util.isDigit(c)) { + buffer += read(); + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + decimalExponent: function decimalExponent () { + switch (c) { + case '+': + case '-': + buffer += read(); + lexState = 'decimalExponentSign'; + return + } + + if (util.isDigit(c)) { + buffer += read(); + lexState = 'decimalExponentInteger'; + return + } + + throw invalidChar(read()) + }, + + decimalExponentSign: function decimalExponentSign () { + if (util.isDigit(c)) { + buffer += read(); + lexState = 'decimalExponentInteger'; + return + } + + throw invalidChar(read()) + }, + + decimalExponentInteger: function decimalExponentInteger () { + if (util.isDigit(c)) { + buffer += read(); + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + hexadecimal: function hexadecimal () { + if (util.isHexDigit(c)) { + buffer += read(); + lexState = 'hexadecimalInteger'; + return + } + + throw invalidChar(read()) + }, + + hexadecimalInteger: function hexadecimalInteger () { + if (util.isHexDigit(c)) { + buffer += read(); + return + } + + return newToken('numeric', sign * Number(buffer)) + }, + + string: function string () { + switch (c) { + case '\\': + read(); + buffer += escape(); + return + + case '"': + if (doubleQuote) { + read(); + return newToken('string', buffer) + } + + buffer += read(); + return + + case "'": + if (!doubleQuote) { + read(); + return newToken('string', buffer) + } + + buffer += read(); + return + + case '\n': + case '\r': + throw invalidChar(read()) + + case '\u2028': + case '\u2029': + separatorChar(c); + break + + case undefined: + throw invalidChar(read()) + } + + buffer += read(); + }, + + start: function start () { + switch (c) { + case '{': + case '[': + return newToken('punctuator', read()) + + // This code is unreachable since the default lexState handles eof. + // case undefined: + // return newToken('eof') + } + + lexState = 'value'; + }, + + beforePropertyName: function beforePropertyName () { + switch (c) { + case '$': + case '_': + buffer = read(); + lexState = 'identifierName'; + return + + case '\\': + read(); + lexState = 'identifierNameStartEscape'; + return + + case '}': + return newToken('punctuator', read()) + + case '"': + case "'": + doubleQuote = (read() === '"'); + lexState = 'string'; + return + } + + if (util.isIdStartChar(c)) { + buffer += read(); + lexState = 'identifierName'; + return + } + + throw invalidChar(read()) + }, + + afterPropertyName: function afterPropertyName () { + if (c === ':') { + return newToken('punctuator', read()) + } + + throw invalidChar(read()) + }, + + beforePropertyValue: function beforePropertyValue () { + lexState = 'value'; + }, + + afterPropertyValue: function afterPropertyValue () { + switch (c) { + case ',': + case '}': + return newToken('punctuator', read()) + } + + throw invalidChar(read()) + }, + + beforeArrayValue: function beforeArrayValue () { + if (c === ']') { + return newToken('punctuator', read()) + } + + lexState = 'value'; + }, + + afterArrayValue: function afterArrayValue () { + switch (c) { + case ',': + case ']': + return newToken('punctuator', read()) + } + + throw invalidChar(read()) + }, + + end: function end () { + // This code is unreachable since it's handled by the default lexState. + // if (c === undefined) { + // read() + // return newToken('eof') + // } + + throw invalidChar(read()) + }, + }; + + function newToken (type, value) { + return { + type: type, + value: value, + line: line, + column: column, + } + } + + function literal (s) { + for (var i = 0, list = s; i < list.length; i += 1) { + var c = list[i]; + + var p = peek(); + + if (p !== c) { + throw invalidChar(read()) + } + + read(); + } + } + + function escape () { + var c = peek(); + switch (c) { + case 'b': + read(); + return '\b' + + case 'f': + read(); + return '\f' + + case 'n': + read(); + return '\n' + + case 'r': + read(); + return '\r' + + case 't': + read(); + return '\t' + + case 'v': + read(); + return '\v' + + case '0': + read(); + if (util.isDigit(peek())) { + throw invalidChar(read()) + } + + return '\0' + + case 'x': + read(); + return hexEscape() + + case 'u': + read(); + return unicodeEscape() + + case '\n': + case '\u2028': + case '\u2029': + read(); + return '' + + case '\r': + read(); + if (peek() === '\n') { + read(); + } + + return '' + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + throw invalidChar(read()) + + case undefined: + throw invalidChar(read()) + } + + return read() + } + + function hexEscape () { + var buffer = ''; + var c = peek(); + + if (!util.isHexDigit(c)) { + throw invalidChar(read()) + } + + buffer += read(); + + c = peek(); + if (!util.isHexDigit(c)) { + throw invalidChar(read()) + } + + buffer += read(); + + return String.fromCodePoint(parseInt(buffer, 16)) + } + + function unicodeEscape () { + var buffer = ''; + var count = 4; + + while (count-- > 0) { + var c = peek(); + if (!util.isHexDigit(c)) { + throw invalidChar(read()) + } + + buffer += read(); + } + + return String.fromCodePoint(parseInt(buffer, 16)) + } + + var parseStates = { + start: function start () { + if (token.type === 'eof') { + throw invalidEOF() + } + + push(); + }, + + beforePropertyName: function beforePropertyName () { + switch (token.type) { + case 'identifier': + case 'string': + key = token.value; + parseState = 'afterPropertyName'; + return + + case 'punctuator': + // This code is unreachable since it's handled by the lexState. + // if (token.value !== '}') { + // throw invalidToken() + // } + + pop(); + return + + case 'eof': + throw invalidEOF() + } + + // This code is unreachable since it's handled by the lexState. + // throw invalidToken() + }, + + afterPropertyName: function afterPropertyName () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'punctuator' || token.value !== ':') { + // throw invalidToken() + // } + + if (token.type === 'eof') { + throw invalidEOF() + } + + parseState = 'beforePropertyValue'; + }, + + beforePropertyValue: function beforePropertyValue () { + if (token.type === 'eof') { + throw invalidEOF() + } + + push(); + }, + + beforeArrayValue: function beforeArrayValue () { + if (token.type === 'eof') { + throw invalidEOF() + } + + if (token.type === 'punctuator' && token.value === ']') { + pop(); + return + } + + push(); + }, + + afterPropertyValue: function afterPropertyValue () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'punctuator') { + // throw invalidToken() + // } + + if (token.type === 'eof') { + throw invalidEOF() + } + + switch (token.value) { + case ',': + parseState = 'beforePropertyName'; + return + + case '}': + pop(); + } + + // This code is unreachable since it's handled by the lexState. + // throw invalidToken() + }, + + afterArrayValue: function afterArrayValue () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'punctuator') { + // throw invalidToken() + // } + + if (token.type === 'eof') { + throw invalidEOF() + } + + switch (token.value) { + case ',': + parseState = 'beforeArrayValue'; + return + + case ']': + pop(); + } + + // This code is unreachable since it's handled by the lexState. + // throw invalidToken() + }, + + end: function end () { + // This code is unreachable since it's handled by the lexState. + // if (token.type !== 'eof') { + // throw invalidToken() + // } + }, + }; + + function push () { + var value; + + switch (token.type) { + case 'punctuator': + switch (token.value) { + case '{': + value = {}; + break + + case '[': + value = []; + break + } + + break + + case 'null': + case 'boolean': + case 'numeric': + case 'string': + value = token.value; + break + + // This code is unreachable. + // default: + // throw invalidToken() + } + + if (root === undefined) { + root = value; + } else { + var parent = stack[stack.length - 1]; + if (Array.isArray(parent)) { + parent.push(value); + } else { + Object.defineProperty(parent, key, { + value: value, + writable: true, + enumerable: true, + configurable: true, + }); + } + } + + if (value !== null && typeof value === 'object') { + stack.push(value); + + if (Array.isArray(value)) { + parseState = 'beforeArrayValue'; + } else { + parseState = 'beforePropertyName'; + } + } else { + var current = stack[stack.length - 1]; + if (current == null) { + parseState = 'end'; + } else if (Array.isArray(current)) { + parseState = 'afterArrayValue'; + } else { + parseState = 'afterPropertyValue'; + } + } + } + + function pop () { + stack.pop(); + + var current = stack[stack.length - 1]; + if (current == null) { + parseState = 'end'; + } else if (Array.isArray(current)) { + parseState = 'afterArrayValue'; + } else { + parseState = 'afterPropertyValue'; + } + } + + // This code is unreachable. + // function invalidParseState () { + // return new Error(`JSON5: invalid parse state '${parseState}'`) + // } + + // This code is unreachable. + // function invalidLexState (state) { + // return new Error(`JSON5: invalid lex state '${state}'`) + // } + + function invalidChar (c) { + if (c === undefined) { + return syntaxError(("JSON5: invalid end of input at " + line + ":" + column)) + } + + return syntaxError(("JSON5: invalid character '" + (formatChar(c)) + "' at " + line + ":" + column)) + } + + function invalidEOF () { + return syntaxError(("JSON5: invalid end of input at " + line + ":" + column)) + } + + // This code is unreachable. + // function invalidToken () { + // if (token.type === 'eof') { + // return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) + // } + + // const c = String.fromCodePoint(token.value.codePointAt(0)) + // return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) + // } + + function invalidIdentifier () { + column -= 5; + return syntaxError(("JSON5: invalid identifier character at " + line + ":" + column)) + } + + function separatorChar (c) { + console.warn(("JSON5: '" + (formatChar(c)) + "' in strings is not valid ECMAScript; consider escaping")); + } + + function formatChar (c) { + var replacements = { + "'": "\\'", + '"': '\\"', + '\\': '\\\\', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t', + '\v': '\\v', + '\0': '\\0', + '\u2028': '\\u2028', + '\u2029': '\\u2029', + }; + + if (replacements[c]) { + return replacements[c] + } + + if (c < ' ') { + var hexString = c.charCodeAt(0).toString(16); + return '\\x' + ('00' + hexString).substring(hexString.length) + } + + return c + } + + function syntaxError (message) { + var err = new SyntaxError(message); + err.lineNumber = line; + err.columnNumber = column; + return err + } + + var stringify = function stringify (value, replacer, space) { + var stack = []; + var indent = ''; + var propertyList; + var replacerFunc; + var gap = ''; + var quote; + + if ( + replacer != null && + typeof replacer === 'object' && + !Array.isArray(replacer) + ) { + space = replacer.space; + quote = replacer.quote; + replacer = replacer.replacer; + } + + if (typeof replacer === 'function') { + replacerFunc = replacer; + } else if (Array.isArray(replacer)) { + propertyList = []; + for (var i = 0, list = replacer; i < list.length; i += 1) { + var v = list[i]; + + var item = (void 0); + + if (typeof v === 'string') { + item = v; + } else if ( + typeof v === 'number' || + v instanceof String || + v instanceof Number + ) { + item = String(v); + } + + if (item !== undefined && propertyList.indexOf(item) < 0) { + propertyList.push(item); + } + } + } + + if (space instanceof Number) { + space = Number(space); + } else if (space instanceof String) { + space = String(space); + } + + if (typeof space === 'number') { + if (space > 0) { + space = Math.min(10, Math.floor(space)); + gap = ' '.substr(0, space); + } + } else if (typeof space === 'string') { + gap = space.substr(0, 10); + } + + return serializeProperty('', {'': value}) + + function serializeProperty (key, holder) { + var value = holder[key]; + if (value != null) { + if (typeof value.toJSON5 === 'function') { + value = value.toJSON5(key); + } else if (typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + } + + if (replacerFunc) { + value = replacerFunc.call(holder, key, value); + } + + if (value instanceof Number) { + value = Number(value); + } else if (value instanceof String) { + value = String(value); + } else if (value instanceof Boolean) { + value = value.valueOf(); + } + + switch (value) { + case null: return 'null' + case true: return 'true' + case false: return 'false' + } + + if (typeof value === 'string') { + return quoteString(value, false) + } + + if (typeof value === 'number') { + return String(value) + } + + if (typeof value === 'object') { + return Array.isArray(value) ? serializeArray(value) : serializeObject(value) + } + + return undefined + } + + function quoteString (value) { + var quotes = { + "'": 0.1, + '"': 0.2, + }; + + var replacements = { + "'": "\\'", + '"': '\\"', + '\\': '\\\\', + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t', + '\v': '\\v', + '\0': '\\0', + '\u2028': '\\u2028', + '\u2029': '\\u2029', + }; + + var product = ''; + + for (var i = 0; i < value.length; i++) { + var c = value[i]; + switch (c) { + case "'": + case '"': + quotes[c]++; + product += c; + continue + + case '\0': + if (util.isDigit(value[i + 1])) { + product += '\\x00'; + continue + } + } + + if (replacements[c]) { + product += replacements[c]; + continue + } + + if (c < ' ') { + var hexString = c.charCodeAt(0).toString(16); + product += '\\x' + ('00' + hexString).substring(hexString.length); + continue + } + + product += c; + } + + var quoteChar = quote || Object.keys(quotes).reduce(function (a, b) { return (quotes[a] < quotes[b]) ? a : b; }); + + product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]); + + return quoteChar + product + quoteChar + } + + function serializeObject (value) { + if (stack.indexOf(value) >= 0) { + throw TypeError('Converting circular structure to JSON5') + } + + stack.push(value); + + var stepback = indent; + indent = indent + gap; + + var keys = propertyList || Object.keys(value); + var partial = []; + for (var i = 0, list = keys; i < list.length; i += 1) { + var key = list[i]; + + var propertyString = serializeProperty(key, value); + if (propertyString !== undefined) { + var member = serializeKey(key) + ':'; + if (gap !== '') { + member += ' '; + } + member += propertyString; + partial.push(member); + } + } + + var final; + if (partial.length === 0) { + final = '{}'; + } else { + var properties; + if (gap === '') { + properties = partial.join(','); + final = '{' + properties + '}'; + } else { + var separator = ',\n' + indent; + properties = partial.join(separator); + final = '{\n' + indent + properties + ',\n' + stepback + '}'; + } + } + + stack.pop(); + indent = stepback; + return final + } + + function serializeKey (key) { + if (key.length === 0) { + return quoteString(key, true) + } + + var firstChar = String.fromCodePoint(key.codePointAt(0)); + if (!util.isIdStartChar(firstChar)) { + return quoteString(key, true) + } + + for (var i = firstChar.length; i < key.length; i++) { + if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { + return quoteString(key, true) + } + } + + return key + } + + function serializeArray (value) { + if (stack.indexOf(value) >= 0) { + throw TypeError('Converting circular structure to JSON5') + } + + stack.push(value); + + var stepback = indent; + indent = indent + gap; + + var partial = []; + for (var i = 0; i < value.length; i++) { + var propertyString = serializeProperty(String(i), value); + partial.push((propertyString !== undefined) ? propertyString : 'null'); + } + + var final; + if (partial.length === 0) { + final = '[]'; + } else { + if (gap === '') { + var properties = partial.join(','); + final = '[' + properties + ']'; + } else { + var separator = ',\n' + indent; + var properties$1 = partial.join(separator); + final = '[\n' + indent + properties$1 + ',\n' + stepback + ']'; + } + } + + stack.pop(); + indent = stepback; + return final + } + }; + + var JSON5 = { + parse: parse, + stringify: stringify, + }; + + var lib = JSON5; + + var es5 = lib; + + return es5; + +}))); diff --git a/FTY/lf_live_min.js b/FTY/lf_live_min.js new file mode 100644 index 00000000..c5daec38 --- /dev/null +++ b/FTY/lf_live_min.js @@ -0,0 +1 @@ +const _0x5bf905=_0x1538;(function(_0x3ade05,_0x439ad4){const _0x104653=_0x1538,_0x20f0a5=_0x3ade05();while(!![]){try{const _0x2cb555=parseInt(_0x104653(0x118))/0x1*(parseInt(_0x104653(0xb3))/0x2)+parseInt(_0x104653(0xbd))/0x3*(-parseInt(_0x104653(0xba))/0x4)+parseInt(_0x104653(0xda))/0x5+-parseInt(_0x104653(0x9a))/0x6+-parseInt(_0x104653(0xcd))/0x7*(parseInt(_0x104653(0xea))/0x8)+-parseInt(_0x104653(0x98))/0x9+parseInt(_0x104653(0xae))/0xa;if(_0x2cb555===_0x439ad4)break;else _0x20f0a5['push'](_0x20f0a5['shift']());}catch(_0x5b5636){_0x20f0a5['push'](_0x20f0a5['shift']());}}}(_0x731b,0x93958));import _0x588c83 from'assets://js/lib/cheerio.min.js';import'assets://js/lib/crypto-js.js';const config={'epgtw_flag':![],'fetch_interval':0x1388,'iptv_flag':!![],'xjj_flag':![],'search_flag':!![],'cacheSubDB':{},'cacheDetailDB':{},'groupDB':[],'channelDB':{},'classes':[],'player':{},'filter':{},'pics':{},'defaultPicUrl':_0x5bf905(0x110),'headers':{'user-agent':'okhttp/3.12.10'},'headers2':{'user-agent':_0x5bf905(0x101)}};function _0x731b(){const _0x13dbc4=['cacheDetailDB','charAt','push','Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x209_2\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/601.1\x20(KHTML,\x20like\x20Gecko)\x20CriOS/47.0.2526.107\x20Mobile/13C75\x20Safari/601.1.46','lastIndexOf','indexOf','480p','headers2','toArray','未分组','\x5c[localdb\x5c]','streamingData','epgtw_flag','exec','section\x20tbody\x20tr','each','$$$https://epg.pw','www.histar.tv','https://img2.baidu.com/it/u=651971012,3800349450&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500','formats','links','vod_play_from','pop','\x5c[epwdr\x5c]','epg.pw','1080p','22nAGixW','https://www.y2mate.com/mates/convertV2/index','download','xjj_flag','XJJ','name','?quality=','gname','IPTV','360p','parse','length','filter','csrfmiddlewaretoke=pUq0NQiiWg7EpSuU0w1Fif4q8bo0RnPe&channel_search=','###',';m_js_1=string;','format_note','defaultPicUrl','&search_type=s','&k_page=home&hl=en&q_auto=0','/parse','join','qualityLabel','订阅名','[epwdr]','10549485mLIFjE','token=123','3156930GZBCaE','sname','application/x-www-form-urlencoded','includes','resolution','$$$[localdb]','#EXTM3U','$c_end','val','filters','$$$','k_query=','iptv807','&p=','groupDB','&k=','token=','href','https://deturl.com/?url=','youtube.com','27606580totrVe','log','http://m.iptv807.com/?act=home','当前的TVBox壳子不支持异步!建议使用蜂蜜大佬的影视最新版!','piped.video','47266STJzXy','stringify','fromCharCode','slice','section:eq(2)\x20a','线路1','https://10downloader.com/download?v=','12lSPnFG','.downloadBtn','class','471999vVGwzb','attr','小姐姐','charCodeAt','select\x20option','&lang=en&type=video','concat','body\x20script:eq(1)','td:eq(4)\x20a','match','.table-container\x20tbody\x20tr','#genre#','vod_play_url','load','classes','split','147PTlGbF','type_id','720p','https://getyoutubehd.com/api/info?v=','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=','Web_EPG','iptv_flag','POST','replace','map','IPTV_','url','$$$[epwdr]','2982960gyKluv','td\x20a','pics','fetch_interval','[localdb]','iptv.com','lastIndex','$$$线路','https://www.cunshao.com/666666/api/web.php','vpf','http://127.0.0.1:9978/file/','surl','channelDB','cacheSubDB','type_name','getyoutubehd.com','419944IIeRpl','hlsManifestUrl','text','var\x20ytInitialPlayerResponse\x20=\x20','.downloadsTable:eq(0)\x20tbody\x20tr','forEach','okhttp/3.12.10','vpu','m_hken=gghken;m_hkens=gghkens;m_token=ggtoken;','td:eq(0)','index','http://m.iptv807.com/','dlink','search_flag','content','startsWith','headers','mp4','https://epg.pw/search/channel/?lang=zh-hant','$$$$$$'];_0x731b=function(){return _0x13dbc4;};return _0x731b();}function init(_0x3e726a){const _0x3a2a18=_0x5bf905;console[_0x3a2a18(0xaf)]('路飞开始调试了!!!'),parseSub(_0x3e726a);try{config['search_flag']&&async_local_db();}catch(_0x97d44e){config['search_flag']=!![],console[_0x3a2a18(0xaf)](_0x3a2a18(0xb1));}}function home(_0xb0e3e){const _0x2ccbee=_0x5bf905;let _0x592ba7={};return _0xb0e3e&&(_0x592ba7[_0x2ccbee(0xa3)]=config[_0x2ccbee(0x8b)]),_0x592ba7[_0x2ccbee(0xbc)]=config[_0x2ccbee(0xcb)],JSON[_0x2ccbee(0xb4)](_0x592ba7);}function homeVod(){const _0x54c633=_0x5bf905;let _0x4ea5fa={},_0x49fe91=[];if(config['iptv_flag']){let _0x2a72db=req(_0x54c633(0xb0),{'headers':config[_0x54c633(0x105)]})[_0x54c633(0xf8)],_0x2d3e48=_0x588c83[_0x54c633(0xca)](_0x2a72db),_0x282e95=_0x2d3e48('ul[data-role=\x22listview\x22]\x20li');_0x282e95[_0x54c633(0x10d)](function(_0x2eef2f){const _0x3858d2=_0x54c633;_0x2d3e48('a',this)[_0x3858d2(0xec)]()!=''&&_0x49fe91[_0x3858d2(0x100)]({'vod_id':_0x3858d2(0xd7)+_0x2d3e48('a',this)[_0x3858d2(0xec)]()+_0x3858d2(0xa4)+_0x2d3e48('a',this)[_0x3858d2(0xbe)](_0x3858d2(0xab)),'vod_name':_0x2d3e48('a',this)[_0x3858d2(0xec)](),'vod_pic':config[_0x3858d2(0x90)],'vod_remarks':''});}),config[_0x54c633(0x82)]&&_0x49fe91['unshift']({'vod_id':_0x54c633(0x83)+_0x54c633(0xa4)+_0x54c633(0xe2),'vod_name':_0x54c633(0xbf),'vod_pic':config[_0x54c633(0x90)],'vod_remarks':''}),_0x4ea5fa={'list':_0x49fe91};}return JSON[_0x54c633(0xb4)](_0x4ea5fa);}function category(_0x569c44,_0x49e44f,_0x5f109c,_0x20195a){const _0x5de76f=_0x5bf905;let _0x3b3354={},_0x168cec=[],_0xd0d814='',_0x2e4754=[],_0x26631e=[];_0x49e44f=parseInt(_0x49e44f);if(_0x49e44f>=0x2)return JSON[_0x5de76f(0xb4)]({});if(_0x569c44==_0x5de76f(0x10f)){}else{if(_0x569c44=='myIPTV'){}else{let _0x237178=cache_sub_db(_0x569c44);if(_0x237178[_0x5de76f(0x103)](_0x5de76f(0xa0))==0x0){let _0xbebc72=/(.*),(.*)\s*?((?:http|rtmp|mitv)[^#\s]*)/gm;while((_0x26631e=_0xbebc72['exec'](_0x237178))!==null){_0x26631e[_0x5de76f(0xf4)]===_0xbebc72['lastIndex']&&_0xbebc72[_0x5de76f(0xe0)]++;let _0x577c57='未分组';_0x577c57=(_0x26631e[0x1]['match'](/group-title="(.*?)"/)||[null,_0x577c57])[0x1],_0x2e4754[_0x5de76f(0x103)](_0x577c57)==-0x1&&(_0x2e4754[_0x5de76f(0x100)](_0x577c57),_0x168cec['push']({'vod_id':_0x577c57+_0x5de76f(0xa4)+_0x569c44,'vod_name':_0x577c57[_0x5de76f(0xd5)](/\/parse$/,''),'vod_pic':config['pics'][_0x569c44],'vod_remarks':''}));}}else{let _0x6ba0be=/()(?:\B\$c_start|\B#{1,2})?(.*?),?(##|头#|\$c_end|,?#genre#|(?:http|rtmp|mitv)[^\s]*)/gm;while((_0x26631e=_0x6ba0be[_0x5de76f(0x10b)](_0x237178))!==null){_0x26631e[_0x5de76f(0xf4)]===_0x6ba0be['lastIndex']&&_0x6ba0be[_0x5de76f(0xe0)]++;if([_0x5de76f(0xc8),'##','头#','$c_end'][_0x5de76f(0x9d)](_0x26631e[0x3])){let _0xbf9ae7=_0x26631e[0x2];_0x2e4754[_0x5de76f(0x103)](_0xbf9ae7)==-0x1&&(_0x2e4754[_0x5de76f(0x100)](_0xbf9ae7),_0x168cec[_0x5de76f(0x100)]({'vod_id':_0xbf9ae7+_0x5de76f(0xa4)+_0x569c44,'vod_name':_0xbf9ae7['replace'](/\/parse$/,''),'vod_pic':config['pics'][_0x569c44],'vod_remarks':''}));}}}}}return _0x3b3354={'list':_0x168cec,'page':_0x49e44f,'pagecount':0x1,'limit':0x64,'total':0x3e7},JSON[_0x5de76f(0xb4)](_0x3b3354);}function search(_0x150015,_0x2eac0f){const _0x489d8c=_0x5bf905;let _0x409375={},_0x10db4d=[];config[_0x489d8c(0xf7)]&&sync_local_db();if(config['epgtw_flag']){let _0x12300b=req('https://epg.pw/search/channel/?lang=zh-hant',{'headers':{'Content-Type':'application/x-www-form-urlencoded','user-agent':_0x489d8c(0xf0)},'method':'POST','body':_0x489d8c(0x8c)+_0x150015+'&search_type=c'})[_0x489d8c(0xf8)],_0xba6de3=_0x588c83[_0x489d8c(0xca)](_0x12300b),_0x299027=_0xba6de3(_0x489d8c(0xb7));if(_0x299027[_0x489d8c(0x8a)]===0x0){let _0x4addae=req(_0x489d8c(0xfc),{'headers':{'Content-Type':'application/x-www-form-urlencoded','user-agent':_0x489d8c(0xf0)},'method':'POST','body':_0x489d8c(0x8c)+_0x150015+_0x489d8c(0x91)})[_0x489d8c(0xf8)],_0x4c9370=_0x588c83[_0x489d8c(0xca)](_0x4addae),_0x4c7696=_0x4c9370(_0x489d8c(0xc7)),_0xc0a5d4={};_0x4c7696[_0x489d8c(0x10d)](function(_0xc20539){const _0x339f0c=_0x489d8c;let _0x448aae=_0x4c9370('td',this)['eq'](0x0)['text']()[_0x339f0c(0xd5)](/@@\d+$/,'')[_0x339f0c(0xd5)]('台','')[_0x339f0c(0xd5)]('衛視','卫视');_0xc0a5d4[_0x448aae]?_0xc0a5d4[_0x448aae][_0x339f0c(0x100)](_0x4c9370('td:eq(4)\x20a',this)['attr'](_0x339f0c(0xab))):_0xc0a5d4[_0x448aae]=[_0x4c9370(_0x339f0c(0xc5),this)[_0x339f0c(0xbe)](_0x339f0c(0xab))];});for(let _0x171693 in _0xc0a5d4){_0x10db4d[_0x489d8c(0x100)]({'vod_id':_0x171693+_0x489d8c(0xd9)+_0xc0a5d4[_0x171693][_0x489d8c(0x94)](_0x489d8c(0x8d)),'vod_name':_0x171693,'vod_pic':config[_0x489d8c(0x90)],'vod_remarks':_0x489d8c(0xd2)});}}else _0x299027['each'](function(_0x1b6f06){const _0x22c51e=_0x489d8c;_0x10db4d[_0x22c51e(0x100)]({'vod_id':_0xba6de3(this,this)['text']()+_0x22c51e(0x10e)+_0xba6de3(this,this)[_0x22c51e(0xbe)](_0x22c51e(0xab)),'vod_name':_0xba6de3(this,this)[_0x22c51e(0xec)](),'vod_pic':config['defaultPicUrl'],'vod_remarks':'Web_EPG'});});}return _0x10db4d=_0x10db4d[_0x489d8c(0xc3)](local_db_gsearch(_0x150015)),_0x10db4d=_0x10db4d['concat'](local_db_csearch(_0x150015)),_0x409375={'list':_0x10db4d},JSON[_0x489d8c(0xb4)](_0x409375);}function detail(_0x2aed5c){const _0x5248c9=_0x5bf905;let _0x5b1300={},_0x4a2fc1={},_0x66bd2f=[],_0x13404d=_0x2aed5c[_0x5248c9(0xcc)](_0x5248c9(0xa4))[0x1];_0x2aed5c=_0x2aed5c[_0x5248c9(0xcc)]('$$$')[0x0];_0x2aed5c['startsWith'](_0x5248c9(0x87))&&(_0x13404d='http://m.iptv807.com/'+_0x13404d);let _0x3979d7={'vod_id':_0x2aed5c,'vod_name':_0x2aed5c['replace'](/\/parse$/,''),'vod_pic':config[_0x5248c9(0x90)],'type_name':'','vod_year':'','vod_area':'','vod_remarks':'','vod_actor':'','vod_director':'','vod_content':'','vod_play_from':'','vod_play_url':''};if(_0x2aed5c[_0x5248c9(0xf9)]('XJJ')){let _0x4b6bf0=_0x5248c9(0xb8),_0x28f37a='';for(let _0x14c8a6=0x0;_0x14c8a6<0x63;_0x14c8a6++){_0x28f37a=_0x28f37a+_0x5248c9(0xbf)+_0x14c8a6+'$'+_0x13404d+'?t='+_0x14c8a6+'#';}_0x3979d7['vod_play_from']=_0x4b6bf0,_0x3979d7[_0x5248c9(0xc9)]=_0x28f37a[_0x5248c9(0xd5)](/#$/,'');}else{if(_0x13404d[_0x5248c9(0xc6)](_0x5248c9(0x115))&&config[_0x5248c9(0x10a)]){let _0x95e6f3='',_0x666580='';_0x13404d=_0x13404d['replace'](_0x5248c9(0x97),''),_0x13404d=_0x13404d[_0x5248c9(0xcc)](_0x5248c9(0x8d));for(let _0x4e6598=0x0;_0x4e6598<_0x13404d[_0x5248c9(0x8a)];_0x4e6598++){_0x95e6f3=_0x95e6f3+_0x5248c9(0xe1)+_0x4e6598,_0x666580=_0x666580+_0x5248c9(0xa4)+_0x2aed5c+'$'+_0x13404d[_0x4e6598];}_0x3979d7[_0x5248c9(0x113)]=_0x95e6f3[_0x5248c9(0xd5)](/^\$\$\$/,''),_0x3979d7['vod_play_url']=_0x666580[_0x5248c9(0xd5)](/^\$\$\$/,'');}else{if(_0x13404d['match'](_0x5248c9(0x116))&&config['epgtw_flag']){let _0x4f6df1='',_0x200bc5='',_0x7d9999=0x0,_0x5c3aa7=req(_0x13404d,{'headers':config['headers']})['content'],_0x46c399=_0x588c83[_0x5248c9(0xca)](_0x5c3aa7),_0x3eb13f=_0x46c399(_0x5248c9(0x10c));_0x3eb13f['each'](function(_0x3142de){const _0x4c6de1=_0x5248c9;_0x4f6df1=_0x4f6df1+_0x4c6de1(0xe1)+_0x7d9999,_0x200bc5=_0x200bc5+_0x4c6de1(0xa4)+_0x2aed5c+'$'+_0x46c399(_0x4c6de1(0xdb),this)['eq'](0x0)[_0x4c6de1(0xbe)](_0x4c6de1(0xab)),_0x7d9999++;}),_0x3979d7[_0x5248c9(0x113)]=_0x4f6df1[_0x5248c9(0xd5)](/^\$\$\$/,''),_0x3979d7[_0x5248c9(0xc9)]=_0x200bc5[_0x5248c9(0xd5)](/^\$\$\$/,'');}else{if(config[_0x5248c9(0xfe)][_0x2aed5c])_0x3979d7[_0x5248c9(0x113)]=config['cacheDetailDB'][_0x2aed5c][_0x5248c9(0xe3)],_0x3979d7['vod_play_url']=config[_0x5248c9(0xfe)][_0x2aed5c][_0x5248c9(0xf1)];else{if(_0x13404d[_0x5248c9(0xc6)](_0x5248c9(0x108))){let _0x1840dd='',_0x2a958f='';_0x13404d=_0x13404d['replace'](_0x5248c9(0xde),''),_0x13404d=_0x13404d[_0x5248c9(0xcc)](_0x5248c9(0x8d));for(let _0x259038=0x0;_0x259038<_0x13404d['length'];_0x259038++){_0x1840dd=_0x1840dd+_0x5248c9(0xe1)+_0x259038,_0x2a958f=_0x2a958f+'$$$'+_0x2aed5c+'$'+_0x13404d[_0x259038];}_0x3979d7['vod_play_from']=_0x1840dd[_0x5248c9(0xd5)](/^\$\$\$/,''),_0x3979d7[_0x5248c9(0xc9)]=_0x2a958f[_0x5248c9(0xd5)](/^\$\$\$/,''),cache_detail_db(_0x2aed5c,_0x3979d7[_0x5248c9(0x113)],_0x3979d7['vod_play_url']);}else{if(_0x13404d=='www.histar.tv'){}else{if(_0x2aed5c['startsWith']('IPTV')){let _0x204bb5='',_0x40706e='',_0x5b8b36=cache_sub_db(_0x13404d),_0x11a361=_0x588c83[_0x5248c9(0xca)](_0x5b8b36),_0x4d6451=_0x11a361('ul[data-role=\x22listview\x22]\x20li');for(let _0x810aa=0x1;_0x810aa<0xb;_0x810aa++){_0x204bb5=_0x204bb5+_0x5248c9(0xa4)+'线路'+_0x810aa,_0x4d6451['each'](function(_0x4920a1){const _0x51a10e=_0x5248c9;_0x11a361('a',this)['text']()!=''&&(_0x40706e=_0x40706e+'#'+_0x11a361('a',this)['text']()+'$'+_0x51a10e(0xf5)+_0x11a361('a',this)[_0x51a10e(0xbe)](_0x51a10e(0xab))+'&p='+(_0x810aa-0x1));}),_0x40706e=_0x40706e[_0x5248c9(0xd5)](/^#/,''),_0x40706e=_0x40706e+_0x5248c9(0xa4);}_0x3979d7[_0x5248c9(0x113)]=_0x204bb5['replace'](/^\$\$\$/,''),_0x3979d7['vod_play_url']=_0x40706e[_0x5248c9(0xd5)](/\$\$\$#/g,_0x5248c9(0xfd)),cache_detail_db(_0x2aed5c,_0x3979d7['vod_play_from'],_0x3979d7['vod_play_url']);}else{let _0xd3c038=cache_sub_db(_0x13404d);if(_0xd3c038[_0x5248c9(0x103)](_0x5248c9(0xa0))==0x0){let _0x571e25=/(.*),(.*)\s*?((?:http|rtmp|mitv)[^#\s]*)/gm;while((_0x66bd2f=_0x571e25[_0x5248c9(0x10b)](_0xd3c038))!==null){_0x66bd2f[_0x5248c9(0xf4)]===_0x571e25[_0x5248c9(0xe0)]&&_0x571e25['lastIndex']++;let _0x48a2ae=_0x5248c9(0x107);_0x48a2ae=(_0x66bd2f[0x1][_0x5248c9(0xc6)](/group-title="(.*?)"/)||[null,_0x48a2ae])[0x1];if(_0x48a2ae==_0x2aed5c){_0x2aed5c['match'](/\/parse$/)&&(_0x66bd2f[0x3]=_0x66bd2f[0x3][_0x5248c9(0xd5)](/\/$/,''),!_0x66bd2f[0x3]['match'](/\/parse$/)&&(_0x66bd2f[0x3]=_0x66bd2f[0x3]+_0x5248c9(0x93)));if(_0x66bd2f[0x3][_0x5248c9(0x103)](_0x5248c9(0xad))!=-0x1||_0x66bd2f[0x3][_0x5248c9(0x103)](_0x5248c9(0xb2))!=-0x1){_0x66bd2f[0x3]=_0x66bd2f[0x3][_0x5248c9(0xd5)](/\/parse$/,'');!_0x4a2fc1[_0x66bd2f[0x2]]&&(_0x4a2fc1[_0x66bd2f[0x2]]=[]);let _0x4df370=['1080p','720p',_0x5248c9(0x104),_0x5248c9(0x88)];for(let _0x4ede93=0x1;_0x4ede93<=0x4;_0x4ede93++){_0x4a2fc1[_0x66bd2f[0x2]]['push']({'name':'线路'+_0x4ede93,'url':_0x66bd2f[0x3]+'/'+_0x4df370[_0x4ede93-0x1]});}}else{if(_0x4a2fc1[_0x66bd2f[0x2]]){let _0x5bbdf8='线路'+(_0x4a2fc1[_0x66bd2f[0x2]]['length']+0x1);_0x4a2fc1[_0x66bd2f[0x2]][_0x5248c9(0x100)]({'name':_0x5bbdf8,'url':_0x66bd2f[0x3]});}else{_0x4a2fc1[_0x66bd2f[0x2]]=[];let _0x44a4f3=_0x5248c9(0xb8);_0x4a2fc1[_0x66bd2f[0x2]][_0x5248c9(0x100)]({'name':_0x44a4f3,'url':_0x66bd2f[0x3]});}}}}}else{let _0x182a0f=/()(?:\B\$c_start|\B#{1,2})?(.*?),?(##|头#|\$c_end|,?#genre#|(?:http|rtmp|mitv)[^\s]*)/gm,_0x2c7465=!![];while((_0x66bd2f=_0x182a0f[_0x5248c9(0x10b)](_0xd3c038))!==null){_0x66bd2f[_0x5248c9(0xf4)]===_0x182a0f[_0x5248c9(0xe0)]&&_0x182a0f['lastIndex']++;if([_0x5248c9(0xc8),'##','头#','$c_end'][_0x5248c9(0x9d)](_0x66bd2f[0x3])){if(_0x66bd2f[0x2]==_0x2aed5c){_0x2c7465=![];continue;}else{if(!_0x2c7465)break;}}if(_0x2c7465)continue;_0x2aed5c['match'](/\/parse$/)&&(_0x66bd2f[0x3]=_0x66bd2f[0x3][_0x5248c9(0xd5)](/\/$/,''),!_0x66bd2f[0x3]['match'](/\/parse$/)&&(_0x66bd2f[0x3]=_0x66bd2f[0x3]+'/parse'));if(_0x66bd2f[0x3]['indexOf'](_0x5248c9(0xad))!=-0x1||_0x66bd2f[0x3][_0x5248c9(0x103)](_0x5248c9(0xb2))!=-0x1){_0x66bd2f[0x3]=_0x66bd2f[0x3][_0x5248c9(0xd5)](/\/parse$/,'');!_0x4a2fc1[_0x66bd2f[0x2]]&&(_0x4a2fc1[_0x66bd2f[0x2]]=[]);let _0x11fedd=[_0x5248c9(0x117),_0x5248c9(0xcf),_0x5248c9(0x104),_0x5248c9(0x88)];for(let _0x32c0b8=0x1;_0x32c0b8<=0x4;_0x32c0b8++){_0x4a2fc1[_0x66bd2f[0x2]][_0x5248c9(0x100)]({'name':'线路'+_0x32c0b8,'url':_0x66bd2f[0x3]+'/'+_0x11fedd[_0x32c0b8-0x1]});}}else{if(_0x4a2fc1[_0x66bd2f[0x2]]){let _0x429150='线路'+(_0x4a2fc1[_0x66bd2f[0x2]][_0x5248c9(0x8a)]+0x1);_0x4a2fc1[_0x66bd2f[0x2]][_0x5248c9(0x100)]({'name':_0x429150,'url':_0x66bd2f[0x3]});}else{_0x4a2fc1[_0x66bd2f[0x2]]=[];let _0x397f2d=_0x5248c9(0xb8);_0x4a2fc1[_0x66bd2f[0x2]][_0x5248c9(0x100)]({'name':_0x397f2d,'url':_0x66bd2f[0x3]});}}}}let _0x34d540=0x0;for(let _0x15d456 in _0x4a2fc1){_0x4a2fc1[_0x15d456][_0x5248c9(0x8a)]>_0x34d540&&(_0x34d540=_0x4a2fc1[_0x15d456][_0x5248c9(0x8a)]);}let _0x4b6b02={};for(let _0x154ef6=0x1;_0x154ef6<=_0x34d540;_0x154ef6++){_0x4b6b02['线路'+_0x154ef6]=[];for(let _0x4e632f in _0x4a2fc1){let _0x210d96='';_0x154ef6<=_0x4a2fc1[_0x4e632f][_0x5248c9(0x8a)]?_0x210d96=_0x4a2fc1[_0x4e632f][_0x154ef6-0x1][_0x5248c9(0xd8)]:_0x210d96=_0x4a2fc1[_0x4e632f][_0x4a2fc1[_0x4e632f][_0x5248c9(0x8a)]-0x1][_0x5248c9(0xd8)],_0x4b6b02['线路'+_0x154ef6][_0x5248c9(0x100)]({'name':_0x4e632f,'url':_0x210d96});}}let _0x4dcd8d=make_detail_videos(_0x4b6b02);_0x3979d7[_0x5248c9(0x113)]=_0x4dcd8d[_0x5248c9(0x113)],_0x3979d7[_0x5248c9(0xc9)]=_0x4dcd8d[_0x5248c9(0xc9)];}}}cache_detail_db(_0x2aed5c,_0x3979d7[_0x5248c9(0x113)],_0x3979d7['vod_play_url']);}}}}return _0x5b1300={'list':[_0x3979d7]},JSON[_0x5248c9(0xb4)](_0x5b1300);}function play(_0x45fe1a,_0x20028b,_0x770038){const _0x316242=_0x5bf905;let _0x2f38c3={},_0x29ea87='0',_0xf07001='0';if(_0x20028b[_0x316242(0x103)](_0x316242(0xa6))!=-0x1)_0x20028b=m_parse_url(_0x20028b);else{if(_0x20028b['match'](/youtube\.com/m))_0x20028b=direct_play_youtube3(_0x20028b);else{if(_0x20028b['match'](/piped\.video/m)){let _0x8762a9=_0x20028b['slice'](0x0,_0x20028b[_0x316242(0x102)]('/')),_0x10dabe=_0x20028b[_0x316242(0xb6)](_0x20028b[_0x316242(0x102)]('/')+0x1)[_0x316242(0xd5)]('p','');_0x20028b=_0x8762a9+_0x316242(0x85)+_0x10dabe,_0x29ea87='1';}else{if(_0x20028b[_0x316242(0xc6)](/\/parse$/))_0x20028b=_0x20028b[_0x316242(0xd5)](/\/parse$/,''),_0x29ea87='1';else _0x20028b[_0x316242(0xc6)](/cunshao\.com\/666666\/api\/web.php/)&&(_0x29ea87='1');}}}return console['log'](_0x20028b),_0x2f38c3={'parse':_0x29ea87,'jx':_0xf07001,'headers':'','playUrl':'','url':_0x20028b},JSON['stringify'](_0x2f38c3);}function computer_last_path(_0x21ad92,_0xa9e098){const _0x51d585=_0x5bf905;let _0x56b0ec=_0x51d585(0xe4),_0x209ad8=_0xa9e098[_0x51d585(0xb6)](0x0,_0xa9e098[_0x51d585(0x102)]('/')+0x1);_0x21ad92[_0x51d585(0xc6)](/^(\/)/)&&(_0x209ad8=_0x56b0ec);let _0x39b4f0=_0x21ad92[_0x51d585(0xcc)]('/')[_0x51d585(0xb6)](0x0,-0x1),_0x448c9d=_0x21ad92[_0x51d585(0xcc)]('/')[_0x51d585(0x114)]();for(let _0x474b9e=0x0;_0x474b9e<_0x39b4f0['length'];_0x474b9e++){if(_0x39b4f0[_0x474b9e]=='.'){}else{if(_0x39b4f0[_0x474b9e]=='..')_0x209ad8!=_0x56b0ec&&(_0x209ad8=_0x209ad8[_0x51d585(0xd5)](/[^\/]*\/$/,''));else{if(_0x39b4f0[_0x474b9e]==''){}else _0x209ad8=_0x209ad8+_0x39b4f0[_0x474b9e]+'/';}}}return _0x209ad8+_0x448c9d;}function parseSub(_0x499bc7){const _0x3e6fe3=_0x5bf905,_0x58701a=/^#([^#\n]*?)\n([^#\n]+)/gm;let _0x3b6efa='',_0x35837b='',_0x32646f=req(_0x499bc7,{'headers':config[_0x3e6fe3(0xfa)]})[_0x3e6fe3(0xf8)];while((_0x3b6efa=_0x58701a[_0x3e6fe3(0x10b)](_0x32646f))!==null){_0x3b6efa[_0x3e6fe3(0xf4)]===_0x58701a[_0x3e6fe3(0xe0)]&&_0x58701a[_0x3e6fe3(0xe0)]++;if(_0x3b6efa[0x1]==_0x3e6fe3(0x96))continue;if(_0x3b6efa[0x1][_0x3e6fe3(0xc6)](/iptv/i)){_0x3b6efa[0x2]=='1'?config[_0x3e6fe3(0xd3)]=!![]:config['iptv_flag']=![];continue;}if(_0x3b6efa[0x1]['match'](/xjj/i)){_0x3b6efa[0x2]=='1'?config[_0x3e6fe3(0x82)]=!![]:config[_0x3e6fe3(0x82)]=![];continue;}let _0x15952b=_0x3b6efa[0x1],_0x1aa6d2=config['defaultPicUrl'];if(_0x3b6efa[0x1][_0x3e6fe3(0x103)]('(')!=-0x1){let _0x595e01=_0x3b6efa[0x1][_0x3e6fe3(0xc6)](/(.*?)\((.*?)\)/);_0x15952b=_0x595e01[0x1],_0x1aa6d2[_0x3e6fe3(0xc6)](/https?/)?_0x1aa6d2=_0x595e01[0x2]:_0x1aa6d2=computer_last_path(_0x595e01[0x2],_0x499bc7);}_0x3b6efa[0x2]['match'](/https?/)?_0x35837b=_0x3b6efa[0x2]:_0x35837b=computer_last_path(_0x3b6efa[0x2],_0x499bc7),config[_0x3e6fe3(0xdc)][_0x35837b]=_0x1aa6d2,config[_0x3e6fe3(0xdc)][_0x15952b]=_0x1aa6d2,config['classes'][_0x3e6fe3(0x100)]({'type_id':_0x35837b,'type_name':_0x15952b});}}function make_detail_videos(_0x20c9a0){const _0x33f41f=_0x5bf905;let _0x1f8581=[],_0x2384dc='',_0x3c97c9='';for(let _0x54126e in _0x20c9a0){_0x2384dc=_0x2384dc+_0x33f41f(0xa4)+_0x54126e;}for(let _0x5745e1 in _0x20c9a0){_0x3c97c9=_0x3c97c9+'$$$',_0x20c9a0[_0x5745e1][_0x33f41f(0xef)](_0x52dc32=>{const _0x5e21a4=_0x33f41f;_0x3c97c9=_0x3c97c9+_0x52dc32[_0x5e21a4(0x84)]+'$'+_0x52dc32['url']+'#';}),_0x3c97c9=_0x3c97c9[_0x33f41f(0xd5)](/#$/m,'');}return _0x1f8581[_0x33f41f(0x113)]=_0x2384dc[_0x33f41f(0xd5)](/^\$\$\$/,''),_0x1f8581[_0x33f41f(0xc9)]=_0x3c97c9[_0x33f41f(0xd5)](/^\$\$\$/,''),_0x1f8581;}function sync_local_db(){const _0x18d734=_0x5bf905;config[_0x18d734(0xf7)]=![];let _0x2fe48f=[],_0x57e684=[],_0x235509='';for(let _0x5c5b22=0x0;_0x5c5b22{const _0x24cd06=_0x18d7d3;config[_0x24cd06(0xf7)]=![];let _0x4e30e5=config[_0x24cd06(0xcb)][_0x5b4288][_0x24cd06(0xce)],_0x5922be=config[_0x24cd06(0xcb)][_0x5b4288][_0x24cd06(0xe8)],_0x1f1116=[],_0x26b75c=[],_0x48357c='',_0x136e24=cache_sub_db(_0x4e30e5);if(_0x136e24[_0x24cd06(0x103)](_0x24cd06(0xa0))==0x0){let _0x3112e5=/(.*),(.*)\s*?((?:http|rtmp|mitv)[^#\s]*)/gm;while((_0x1f1116=_0x3112e5['exec'](_0x136e24))!==null){_0x1f1116[_0x24cd06(0xf4)]===_0x3112e5[_0x24cd06(0xe0)]&&_0x3112e5[_0x24cd06(0xe0)]++;let _0x2e6cf3=_0x24cd06(0x107);_0x2e6cf3=(_0x1f1116[0x1][_0x24cd06(0xc6)](/group-title="(.*?)"/)||[null,_0x2e6cf3])[0x1];_0x26b75c['indexOf'](_0x2e6cf3)==-0x1&&(_0x26b75c[_0x24cd06(0x100)](_0x2e6cf3),config['groupDB'][_0x24cd06(0x100)]({'sname':_0x5922be,'surl':_0x4e30e5,'gname':_0x2e6cf3}));!config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x2e6cf3]&&(config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x2e6cf3]={});if(_0x1f1116[0x3][_0x24cd06(0x103)](_0x24cd06(0xad))!=-0x1||_0x1f1116[0x3]['indexOf'](_0x24cd06(0xb2))!=-0x1){_0x1f1116[0x3]=_0x1f1116[0x3]['replace'](/\/parse$/,'');!config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x2e6cf3][_0x1f1116[0x2]]&&(config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x2e6cf3][_0x1f1116[0x2]]=[]);let _0x3cae47=[_0x24cd06(0x117),_0x24cd06(0xcf),'480p',_0x24cd06(0x88)];for(let _0x57848f=0x1;_0x57848f<=0x4;_0x57848f++){config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x2e6cf3][_0x1f1116[0x2]][_0x24cd06(0x100)](_0x1f1116[0x3]+'/'+_0x3cae47[_0x57848f-0x1]);}}else _0x2e6cf3[_0x24cd06(0xc6)](/\/parse$/)&&(_0x1f1116[0x3]=_0x1f1116[0x3][_0x24cd06(0xd5)](/\/$/,''),!_0x1f1116[0x3][_0x24cd06(0xc6)](/\/parse$/)&&(_0x1f1116[0x3]=_0x1f1116[0x3]+'/parse')),config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x2e6cf3][_0x1f1116[0x2]]?config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x2e6cf3][_0x1f1116[0x2]][_0x24cd06(0x100)](_0x1f1116[0x3]):(config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x2e6cf3][_0x1f1116[0x2]]=[],config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x2e6cf3][_0x1f1116[0x2]]['push'](_0x1f1116[0x3]));}}else{let _0x3992d7=/()(?:\B\$c_start|\B#{1,2})?(.*?),?(##|头#|\$c_end|,?#genre#|(?:http|rtmp|mitv)[^\s]*)/gm;while((_0x1f1116=_0x3992d7[_0x24cd06(0x10b)](_0x136e24))!==null){_0x1f1116['index']===_0x3992d7[_0x24cd06(0xe0)]&&_0x3992d7[_0x24cd06(0xe0)]++;if([_0x24cd06(0xc8),'##','头#',_0x24cd06(0xa1)][_0x24cd06(0x9d)](_0x1f1116[0x3]))_0x48357c=_0x1f1116[0x2],config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x48357c]={},config[_0x24cd06(0xa8)][_0x24cd06(0x100)]({'sname':_0x5922be,'surl':_0x4e30e5,'gname':_0x1f1116[0x2]});else{if(_0x1f1116[0x3][_0x24cd06(0x103)](_0x24cd06(0xad))!=-0x1||_0x1f1116[0x3][_0x24cd06(0x103)](_0x24cd06(0xb2))!=-0x1){_0x1f1116[0x3]=_0x1f1116[0x3][_0x24cd06(0xd5)](/\/parse$/,'');!config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x48357c][_0x1f1116[0x2]]&&(config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x48357c][_0x1f1116[0x2]]=[]);let _0x34690f=[_0x24cd06(0x117),'720p',_0x24cd06(0x104),_0x24cd06(0x88)];for(let _0x49399c=0x1;_0x49399c<=0x4;_0x49399c++){config['channelDB'][_0x5922be+'-'+_0x48357c][_0x1f1116[0x2]][_0x24cd06(0x100)](_0x1f1116[0x3]+'/'+_0x34690f[_0x49399c-0x1]);}}else _0x48357c[_0x24cd06(0xc6)](/\/parse$/)&&(_0x1f1116[0x3]=_0x1f1116[0x3]['replace'](/\/$/,''),!_0x1f1116[0x3][_0x24cd06(0xc6)](/\/parse$/)&&(_0x1f1116[0x3]=_0x1f1116[0x3]+_0x24cd06(0x93))),config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x48357c][_0x1f1116[0x2]]?config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x48357c][_0x1f1116[0x2]][_0x24cd06(0x100)](_0x1f1116[0x3]):(config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x48357c][_0x1f1116[0x2]]=[],config[_0x24cd06(0xe6)][_0x5922be+'-'+_0x48357c][_0x1f1116[0x2]]['push'](_0x1f1116[0x3]));}}}},config['fetch_interval']);}}function local_db_gsearch(_0xcfc681){const _0xefdd6d=_0x5bf905;let _0x5f2ddb=[],_0x1a59ee=new RegExp(_0xcfc681,'i');for(let _0x2f6cc4=0x0;_0x2f6cc4{const _0x2f09de=_0x170c5b;_0x3d4f1f['mimeType'][_0x2f09de(0xc6)](/video\/mp4/)&&(_0x3d4f1f[_0x2f09de(0x95)]==_0x5e1b77&&(_0x472392=_0x3d4f1f[_0x2f09de(0xd8)]));}),_0x472392;}function direct_play_youtube2(_0x34bb1c){const _0x25064a=_0x5bf905;let _0x2a3667=_0x34bb1c['slice'](0x0,_0x34bb1c['lastIndexOf']('/')),_0x4a3960=_0x34bb1c['slice'](_0x34bb1c[_0x25064a(0x102)]('/')+0x1),_0x2865da='',_0x44bcd6=req(_0x25064a(0xb9)+_0x2a3667+_0x25064a(0xc2),{'headers':config[_0x25064a(0xfa)]})['content'],_0x274b94=_0x588c83[_0x25064a(0xca)](_0x44bcd6),_0x3fd590=_0x274b94(_0x25064a(0xee))[_0x25064a(0xd6)](function(){const _0x1a176d=_0x25064a;return{'title':_0x274b94(_0x1a176d(0xbb),this)['attr'](_0x1a176d(0x81)),'resolution':_0x274b94(_0x1a176d(0xf3),this)[_0x1a176d(0xec)](),'url':_0x274b94(_0x1a176d(0xbb),this)['attr']('href')};})[_0x25064a(0x106)]();for(let _0x101736=0x0;_0x101736<_0x3fd590[_0x25064a(0x8a)];_0x101736++){if(_0x3fd590[_0x101736][_0x25064a(0x9e)]==_0x4a3960){_0x2865da=_0x3fd590[_0x101736][_0x25064a(0xd8)];break;}}return _0x2865da=_0x2865da[_0x25064a(0xd5)](/&title=.*/,''),_0x2865da;}function direct_play_youtube3(_0x49265d){const _0x2a5206=_0x5bf905;let _0x4a32bc=_0x49265d[_0x2a5206(0xb6)](0x0,_0x49265d[_0x2a5206(0x102)]('/')),_0x233136=_0x49265d['slice'](_0x49265d[_0x2a5206(0x102)]('/')+0x1),_0x235d09=_0x4a32bc[_0x2a5206(0xc6)](/v=(.*?)(&|$)/m)[0x1],_0x287e9d='',_0x1be557={},_0x45bf37=[],_0x40c106='',_0x40d69f=req(_0x4a32bc,{'headers':config[_0x2a5206(0xfa)]})[_0x2a5206(0xf8)];if(_0x40d69f['match'](/hlsManifestUrl/)){let _0x1096c9=_0x588c83['load'](_0x40d69f),_0x4ea075=JSON['parse'](_0x1096c9(_0x2a5206(0xc4))[_0x2a5206(0xec)]()['replace'](_0x2a5206(0xed),'')['replace'](/;$/,''));_0x40c106=_0x4ea075[_0x2a5206(0x109)][_0x2a5206(0xeb)];}else{_0x40d69f=req('https://www.y2mate.com/mates/analyzeV2/ajax',{'headers':{'Content-Type':_0x2a5206(0x9c),'user-agent':_0x2a5206(0xf0)},'method':_0x2a5206(0xd4),'body':_0x2a5206(0xa5)+_0x4a32bc+_0x2a5206(0x92)})[_0x2a5206(0xf8)],_0x40d69f=JSON[_0x2a5206(0x89)](_0x40d69f),_0x1be557=_0x40d69f[_0x2a5206(0x112)][_0x2a5206(0xfb)],_0x287e9d='';for(let _0x60a8fd in _0x1be557){if(_0x233136==_0x1be557[_0x60a8fd]['q']){_0x287e9d=_0x1be557[_0x60a8fd]['k'];break;}}_0x40d69f=req(_0x2a5206(0x80),{'headers':{'Content-Type':'application/x-www-form-urlencoded','user-agent':'okhttp/3.12.10'},'method':_0x2a5206(0xd4),'body':'vid='+_0x235d09+_0x2a5206(0xa9)+_0x287e9d})['content'],_0x40d69f=JSON['parse'](_0x40d69f),_0x40c106=_0x40d69f[_0x2a5206(0xf6)];}return console[_0x2a5206(0xaf)](_0x40c106),_0x40c106;}var m_js_1='',m_hken='',m_hkens='',m_token='';function m_decode(_0x51dd82){const _0x588952=_0x5bf905;var _0x2f7d4a=_0x588952(0xd1),_0x1f341a,_0x4693b7,_0x21e52f,_0x3ae5ca,_0x16980c,_0x14c158,_0x57a3cd,_0x2b8068,_0x162e31=0x0,_0x27ee98=0x0,_0x29c0fc='',_0x18bd20=[];if(!_0x51dd82)return _0x51dd82;_0x51dd82+='';do{_0x3ae5ca=_0x2f7d4a['indexOf'](_0x51dd82[_0x588952(0xff)](_0x162e31++)),_0x16980c=_0x2f7d4a['indexOf'](_0x51dd82[_0x588952(0xff)](_0x162e31++)),_0x14c158=_0x2f7d4a[_0x588952(0x103)](_0x51dd82[_0x588952(0xff)](_0x162e31++)),_0x57a3cd=_0x2f7d4a[_0x588952(0x103)](_0x51dd82[_0x588952(0xff)](_0x162e31++)),_0x2b8068=_0x3ae5ca<<0x12|_0x16980c<<0xc|_0x14c158<<0x6|_0x57a3cd,_0x1f341a=_0x2b8068>>0x10&0xff,_0x4693b7=_0x2b8068>>0x8&0xff,_0x21e52f=_0x2b8068&0xff,_0x14c158==0x40?_0x18bd20[_0x27ee98++]=String[_0x588952(0xb5)](_0x1f341a):_0x57a3cd==0x40?_0x18bd20[_0x27ee98++]=String['fromCharCode'](_0x1f341a,_0x4693b7):_0x18bd20[_0x27ee98++]=String[_0x588952(0xb5)](_0x1f341a,_0x4693b7,_0x21e52f);}while(_0x162e31<_0x51dd82[_0x588952(0x8a)]);return _0x29c0fc=_0x18bd20[_0x588952(0x94)](''),_0x29c0fc;}function startPlayer(_0x1db4b2,_0x2dbc45,_0x1a0dc2,_0x76a43e){const _0x4abaa6=_0x5bf905;function _0x321056(_0x3b5f76,_0x2a7d5e){const _0x30e72b=_0x1538;let _0x52dc5b=_0x9cf245(_0x3b5f76),_0x548996=_0x2a7d5e['length'],_0x18e822='';for(let _0x6421d=0x0;_0x6421d<_0x52dc5b['length'];_0x6421d++){let _0x3df938=_0x6421d%_0x548996;_0x18e822+=String[_0x30e72b(0xb5)](_0x52dc5b[_0x30e72b(0xc0)](_0x6421d)^_0x2a7d5e['charCodeAt'](_0x3df938));}let _0xc7a8d1=_0x9cf245(_0x18e822);return _0xc7a8d1;}function _0x9cf245(_0x15ee5b){const _0x422ce8=_0x1538;var _0xf5dc50=_0x422ce8(0xd1),_0x2bb610,_0x55b872,_0xbdb248,_0x37c8dd,_0x1f8357,_0x206fe9,_0x4231e5,_0x21cbb3,_0x43bbeb=0x0,_0x12fdc9=0x0,_0x2aa357='',_0x49b429=[];if(!_0x15ee5b)return _0x15ee5b;_0x15ee5b+='';do{_0x37c8dd=_0xf5dc50['indexOf'](_0x15ee5b[_0x422ce8(0xff)](_0x43bbeb++)),_0x1f8357=_0xf5dc50[_0x422ce8(0x103)](_0x15ee5b[_0x422ce8(0xff)](_0x43bbeb++)),_0x206fe9=_0xf5dc50[_0x422ce8(0x103)](_0x15ee5b[_0x422ce8(0xff)](_0x43bbeb++)),_0x4231e5=_0xf5dc50['indexOf'](_0x15ee5b[_0x422ce8(0xff)](_0x43bbeb++)),_0x21cbb3=_0x37c8dd<<0x12|_0x1f8357<<0xc|_0x206fe9<<0x6|_0x4231e5,_0x2bb610=_0x21cbb3>>0x10&0xff,_0x55b872=_0x21cbb3>>0x8&0xff,_0xbdb248=_0x21cbb3&0xff;if(_0x206fe9==0x40)_0x49b429[_0x12fdc9++]=String[_0x422ce8(0xb5)](_0x2bb610);else _0x4231e5==0x40?_0x49b429[_0x12fdc9++]=String[_0x422ce8(0xb5)](_0x2bb610,_0x55b872):_0x49b429[_0x12fdc9++]=String[_0x422ce8(0xb5)](_0x2bb610,_0x55b872,_0xbdb248);}while(_0x43bbeb<_0x15ee5b[_0x422ce8(0x8a)]);return _0x2aa357=_0x49b429[_0x422ce8(0x94)](''),_0x2aa357;}return _0x1db4b2=_0x1db4b2[_0x4abaa6(0xcc)]('')['reverse']()['join'](''),_0x1db4b2=_0x321056(_0x1db4b2,_0x2dbc45),_0x1db4b2=_0x1db4b2[_0x4abaa6(0xd5)](_0x4abaa6(0x99),'token='+_0x76a43e),_0x1db4b2=_0x1db4b2[_0x4abaa6(0xd5)](_0x4abaa6(0xaa)+_0x1a0dc2,_0x4abaa6(0xaa)+_0x76a43e),_0x1db4b2=_0x1db4b2[_0x4abaa6(0xd5)](_0x2dbc45,''),_0x1db4b2;}function m_parse_url(_0x15bb51){const _0x5a2fd0=_0x5bf905;let _0xd4463c=_0x15bb51['split'](_0x5a2fd0(0xa7))[0x0],_0x1118e5=_0x15bb51[_0x5a2fd0(0xcc)](_0x5a2fd0(0xa7))[0x1],_0x69fbd0=req(_0xd4463c,{'headers':config[_0x5a2fd0(0x105)]})[_0x5a2fd0(0xf8)],_0x409c33=_0x588c83[_0x5a2fd0(0xca)](_0x69fbd0);if(_0x1118e5>=_0x409c33(_0x5a2fd0(0xc1))[_0x5a2fd0(0x8a)])return'';let _0x2c13d0=_0x409c33(_0x5a2fd0(0xc1))['eq'](_0x1118e5)[_0x5a2fd0(0xa2)](),_0x34a5fb=_0x69fbd0[_0x5a2fd0(0xc6)](/