-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathXingtikukecheng.js
4 lines (2 loc) · 14.7 KB
/
Xingtikukecheng.js
1
2
3
4
var version_='jsjiami.com.v7';const _0x40f939=_0x33fb;(function(_0xc8cb15,_0x8b14f,_0x3a7c63,_0x50519c,_0xa2a274,_0x4f2293,_0x1dfeb1){return _0xc8cb15=_0xc8cb15>>0x5,_0x4f2293='hs',_0x1dfeb1='hs',function(_0x42095e,_0x2e0b91,_0x95f5d7,_0x557aa2,_0x3cfc6e){const _0x2072f9=_0x33fb;_0x557aa2='tfi',_0x4f2293=_0x557aa2+_0x4f2293,_0x3cfc6e='up',_0x1dfeb1+=_0x3cfc6e,_0x4f2293=_0x95f5d7(_0x4f2293),_0x1dfeb1=_0x95f5d7(_0x1dfeb1),_0x95f5d7=0x0;const _0x38b503=_0x42095e();while(!![]&&--_0x50519c+_0x2e0b91){try{_0x557aa2=-parseInt(_0x2072f9(0x1e4,'E*Q8'))/0x1*(-parseInt(_0x2072f9(0x1e0,'pFgt'))/0x2)+parseInt(_0x2072f9(0x1ee,'Th2V'))/0x3*(parseInt(_0x2072f9(0x1f0,'V@W9'))/0x4)+-parseInt(_0x2072f9(0x1e8,'sZr)'))/0x5*(parseInt(_0x2072f9(0x1dd,'kwa^'))/0x6)+-parseInt(_0x2072f9(0x1e6,'Y8)n'))/0x7*(parseInt(_0x2072f9(0x1ea,'C9av'))/0x8)+parseInt(_0x2072f9(0x1dc,'wVw6'))/0x9+parseInt(_0x2072f9(0x1da,'wVw6'))/0xa*(-parseInt(_0x2072f9(0x1e5,'MySm'))/0xb)+parseInt(_0x2072f9(0x1d5,'Y8)n'))/0xc;}catch(_0x33f4ef){_0x557aa2=_0x95f5d7;}finally{_0x3cfc6e=_0x38b503[_0x4f2293]();if(_0xc8cb15<=_0x50519c)_0x95f5d7?_0xa2a274?_0x557aa2=_0x3cfc6e:_0xa2a274=_0x3cfc6e:_0x95f5d7=_0x3cfc6e;else{if(_0x95f5d7==_0xa2a274['replace'](/[YCkHURPwhOMbIpNe=]/g,'')){if(_0x557aa2===_0x2e0b91){_0x38b503['un'+_0x4f2293](_0x3cfc6e);break;}_0x38b503[_0x1dfeb1](_0x3cfc6e);}}}}}(_0x3a7c63,_0x8b14f,function(_0x52e5e0,_0x3f62a7,_0x6b6426,_0x2e3f83,_0x29c7d0,_0x2e11e9,_0x430527){return _0x3f62a7='\x73\x70\x6c\x69\x74',_0x52e5e0=arguments[0x0],_0x52e5e0=_0x52e5e0[_0x3f62a7](''),_0x6b6426='\x72\x65\x76\x65\x72\x73\x65',_0x52e5e0=_0x52e5e0[_0x6b6426]('\x76'),_0x2e3f83='\x6a\x6f\x69\x6e',(0x142bb9,_0x52e5e0[_0x2e3f83](''));});}(0x1920,0x1bebb,_0x2247,0xcb),_0x2247)&&(version_=_0x2247);const $=new Env('GOGOGOGO');let url=$request[_0x40f939(0x1eb,'Y8)n')],headers=$request['headers'];function _0x33fb(_0x178730,_0x475118){const _0x224708=_0x2247();return _0x33fb=function(_0x33fbb0,_0x2a85c1){_0x33fbb0=_0x33fbb0-0x1d5;let _0x30d22a=_0x224708[_0x33fbb0];if(_0x33fb['TWBuhG']===undefined){var _0x5438db=function(_0x5d6587){const _0x210ee7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5c7570='',_0x176fa2='';for(let _0x34213c=0x0,_0x52dc9b,_0x4032ca,_0x1ff4a7=0x0;_0x4032ca=_0x5d6587['charAt'](_0x1ff4a7++);~_0x4032ca&&(_0x52dc9b=_0x34213c%0x4?_0x52dc9b*0x40+_0x4032ca:_0x4032ca,_0x34213c++%0x4)?_0x5c7570+=String['fromCharCode'](0xff&_0x52dc9b>>(-0x2*_0x34213c&0x6)):0x0){_0x4032ca=_0x210ee7['indexOf'](_0x4032ca);}for(let _0x69d93a=0x0,_0x3bc03a=_0x5c7570['length'];_0x69d93a<_0x3bc03a;_0x69d93a++){_0x176fa2+='%'+('00'+_0x5c7570['charCodeAt'](_0x69d93a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x176fa2);};const _0x3cd4af=function(_0x1cc2b2,_0x12d31f){let _0x2ca813=[],_0x188094=0x0,_0x465c3a,_0x5a0b73='';_0x1cc2b2=_0x5438db(_0x1cc2b2);let _0xbfe14e;for(_0xbfe14e=0x0;_0xbfe14e<0x100;_0xbfe14e++){_0x2ca813[_0xbfe14e]=_0xbfe14e;}for(_0xbfe14e=0x0;_0xbfe14e<0x100;_0xbfe14e++){_0x188094=(_0x188094+_0x2ca813[_0xbfe14e]+_0x12d31f['charCodeAt'](_0xbfe14e%_0x12d31f['length']))%0x100,_0x465c3a=_0x2ca813[_0xbfe14e],_0x2ca813[_0xbfe14e]=_0x2ca813[_0x188094],_0x2ca813[_0x188094]=_0x465c3a;}_0xbfe14e=0x0,_0x188094=0x0;for(let _0x7b6f12=0x0;_0x7b6f12<_0x1cc2b2['length'];_0x7b6f12++){_0xbfe14e=(_0xbfe14e+0x1)%0x100,_0x188094=(_0x188094+_0x2ca813[_0xbfe14e])%0x100,_0x465c3a=_0x2ca813[_0xbfe14e],_0x2ca813[_0xbfe14e]=_0x2ca813[_0x188094],_0x2ca813[_0x188094]=_0x465c3a,_0x5a0b73+=String['fromCharCode'](_0x1cc2b2['charCodeAt'](_0x7b6f12)^_0x2ca813[(_0x2ca813[_0xbfe14e]+_0x2ca813[_0x188094])%0x100]);}return _0x5a0b73;};_0x33fb['AZOfLE']=_0x3cd4af,_0x178730=arguments,_0x33fb['TWBuhG']=!![];}const _0x28ef69=_0x224708[0x0],_0x32ce0c=_0x33fbb0+_0x28ef69,_0x4f5ff6=_0x178730[_0x32ce0c];return!_0x4f5ff6?(_0x33fb['tEBaSs']===undefined&&(_0x33fb['tEBaSs']=!![]),_0x30d22a=_0x33fb['AZOfLE'](_0x30d22a,_0x2a85c1),_0x178730[_0x32ce0c]=_0x30d22a):_0x30d22a=_0x4f5ff6,_0x30d22a;},_0x33fb(_0x178730,_0x475118);}const pattern=/^https:\/\/cm15-c110-3\.play\.bokecc\.com\/flvs\/.*\.m3u8\?.*$/,userAgent=headers['User-Agent'],userAgentPattern=/AppleCoreMedia/i;function _0x2247(){const _0x53c27c=(function(){return[version_,'kCwjHYksMjbOkibIaCmihUp.PcwCoNeRm.HvhPU7==','CvbEW7qsoG7dMv3dOCoocr0','jqOqvmo3W6ih','5BsJ57IO5yYX6ysn6l2wfhxcQWek5BQ75y2g6ycZ6l6T6yg655+J77+U5lUg5yAY6l6h6kob6iAq5P6G','aMC9jmknW5hdSSomwfVdPLRcSH8','WQfdwJ8','W6RcO8kqBx3cNCoeWQJcIq','FGW+','W6lcPSkykaBdJmoDWQpcN8ovtCko','WRBcJmogbmkiE8kr'].concat((function(){return['W5nLa8o9ptxcNHK5W6SE','54og5ywX5Q2F6ygO55+H5z+s57QD6ksT556o','amk4cmkoWOvlDmkax2WmWQ0','jmodWPRcICkQWQhcPmkTFCklWRZcPa','6kEa556c55Qy5Pwv5yog6k285B6P5yEZ6zs26iA+5PYg','jCotWPi','lSkUW6xdJ8oJW6xcHG','FNWMmmkDWOKkW7iiW60h','D1rDW7P/ue7dN1ddGW','WPesf8ktWP9NWPddUuOb','uJn4wColWO/dJSoVFvVdHuW'].concat((function(){return['lCodWP7cG8orW6tcISkoB8km','W41guCoiWR13WRBdNKa6','nryd','WQlcGMy0W59Bvmkqk0pcRSo2rGmpAa','6k+M56IH6i2V5y645OIt5yIS','DmkSWOFcTqGNDCoyrmkuW58','lWX/WQC9jYdcJ8oSk8ozW6emgq','C0HXBMvsW6hcLa'];}()));}()));}());_0x2247=function(){return _0x53c27c;};return _0x2247();};if($[_0x40f939(0x1d8,'sZr)')]('matchedURL')&&$[_0x40f939(0x1ef,'WD]3')]('sentNotification'))console[_0x40f939(0x1e3,'S@PP')](_0x40f939(0x1d7,'YB)s'));else pattern['test'](url)&&userAgentPattern[_0x40f939(0x1d9,'G]bi')](userAgent)&&($[_0x40f939(0x1db,'p](V')](_0x40f939(0x1ed,'FCsO'),_0x40f939(0x1df,'p%kW'),_0x40f939(0x1e2,'*#LO'),url),$[_0x40f939(0x1e7,'C9av')]=url,$[_0x40f939(0x1ec,'YB)s')]=!![]);$['done']({});var version_ = 'jsjiami.com.v7';
function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,a)=>{s.call(this,t,(t,s,r)=>{t?a(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const a=this.getdata(t);if(a)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,a)=>e(a))})}runScript(t,e){return new Promise(s=>{let a=this.getdata("@chavy_boxjs_userCfgs.httpapi");a=a?a.replace(/\n/g,"").trim():a;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[i,o]=a.split("@"),n={url:`http://${o}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":i,Accept:"*/*"},timeout:r};this.post(n,(t,e,a)=>s(a))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),a=!s&&this.fs.existsSync(e);if(!s&&!a)return{};{const a=s?t:e;try{return JSON.parse(this.fs.readFileSync(a))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),a=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):a?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const a=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of a)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,a)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[a+1])>>0==+e[a+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,a]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,a,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,a,r]=/^@(.*?)\.(.*?)$/.exec(e),i=this.getval(a),o=a?"null"===i?null:i||"{}":"{}";try{const e=JSON.parse(o);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),a)}catch(e){const i={};this.lodash_set(i,r,t),s=this.setval(JSON.stringify(i),a)}}else s=this.setval(t,e);return s}getval(t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(t);case"Quantumult X":return $prefs.valueForKey(t);case"Node.js":return this.data=this.loaddata(),this.data[t];default:return this.data&&this.data[t]||null}}setval(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(t,e);case"Quantumult X":return $prefs.setValueForKey(t,e);case"Node.js":return this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0;default:return this.data&&this.data[e]||null}}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){switch(t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"],delete t.headers["content-type"],delete t.headers["content-length"]),t.params&&(t.url+="?"+this.queryStr(t.params)),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,a)=>{!t&&s&&(s.body=a,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),e(t,s,a)});break;case"Quantumult X":this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:a,headers:r,body:i,bodyBytes:o}=t;e(null,{status:s,statusCode:a,headers:r,body:i,bodyBytes:o},i,o)},t=>e(t&&t.error||"UndefinedError"));break;case"Node.js":let s=require("iconv-lite");this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:a,statusCode:r,headers:i,rawBody:o}=t,n=s.decode(o,this.encoding);e(null,{status:a,statusCode:r,headers:i,rawBody:o,body:n},n)},t=>{const{message:a,response:r}=t;e(a,r,r&&s.decode(r.rawBody,this.encoding))})}}post(t,e=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";switch(t.body&&t.headers&&!t.headers["Content-Type"]&&!t.headers["content-type"]&&(t.headers["content-type"]="application/x-www-form-urlencoded"),t.headers&&(delete t.headers["Content-Length"],delete t.headers["content-length"]),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient[s](t,(t,s,a)=>{!t&&s&&(s.body=a,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),e(t,s,a)});break;case"Quantumult X":t.method=s,this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:a,headers:r,body:i,bodyBytes:o}=t;e(null,{status:s,statusCode:a,headers:r,body:i,bodyBytes:o},i,o)},t=>e(t&&t.error||"UndefinedError"));break;case"Node.js":let a=require("iconv-lite");this.initGotEnv(t);const{url:r,...i}=t;this.got[s](r,i).then(t=>{const{statusCode:s,statusCode:r,headers:i,rawBody:o}=t,n=a.decode(o,this.encoding);e(null,{status:s,statusCode:r,headers:i,rawBody:o,body:n},n)},t=>{const{message:s,response:r}=t;e(s,r,r&&a.decode(r.rawBody,this.encoding))})}}time(t,e=null){const s=e?new Date(e):new Date;let a={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in a)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?a[e]:("00"+a[e]).substr((""+a[e]).length)));return t}queryStr(t){let e="";for(const s in t){let a=t[s];null!=a&&""!==a&&("object"==typeof a&&(a=JSON.stringify(a)),e+=`${s}=${a}&`)}return e=e.substring(0,e.length-1),e}msg(e=t,s="",a="",r){const i=t=>{switch(typeof t){case void 0:return t;case"string":switch(this.getEnv()){case"Surge":case"Stash":default:return{url:t};case"Loon":case"Shadowrocket":return t;case"Quantumult X":return{"open-url":t};case"Node.js":return}case"object":switch(this.getEnv()){case"Surge":case"Stash":case"Shadowrocket":default:{let e=t.url||t.openUrl||t["open-url"];return{url:e}}case"Loon":{let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}case"Quantumult X":{let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl,a=t["update-pasteboard"]||t.updatePasteboard;return{"open-url":e,"media-url":s,"update-pasteboard":a}}case"Node.js":return}default:return}};if(!this.isMute)switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:$notification.post(e,s,a,i(r));break;case"Quantumult X":$notify(e,s,a,i(r));break;case"Node.js":}if(!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),a&&t.push(a),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:this.log("",`❗️${this.name}, 错误!`,t);break;case"Node.js":this.log("",`❗️${this.name}, 错误!`,t.stack)}}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;switch(this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:$done(t);break;case"Node.js":process.exit(1)}}}(t,e)}