2024-07-30 16:37:38 +08:00
|
|
|
|
const _0x769467=_0x1f44;(function(_0x22c23b,_0x211342){const _0x539a48=_0x1f44,_0x3fcf43=_0x22c23b();while(!![]){try{const _0x56d664=parseInt(_0x539a48(0x2bb,'[Erf'))/0x1*(-parseInt(_0x539a48(0x29a,'OaUk'))/0x2)+parseInt(_0x539a48(0x231,'9iK&'))/0x3+-parseInt(_0x539a48(0x256,'mzZm'))/0x4+-parseInt(_0x539a48(0x22c,'1WSM'))/0x5*(-parseInt(_0x539a48(0x307,']ZG]'))/0x6)+parseInt(_0x539a48(0x30a,'xD2W'))/0x7+parseInt(_0x539a48(0x1ee,'S#9y'))/0x8+-parseInt(_0x539a48(0x2cb,'mzZm'))/0x9*(-parseInt(_0x539a48(0x30e,'yMsM'))/0xa);if(_0x56d664===_0x211342)break;else _0x3fcf43['push'](_0x3fcf43['shift']());}catch(_0x44f4aa){_0x3fcf43['push'](_0x3fcf43['shift']());}}}(_0x5d13,0xa9470));const jdCookie=require(_0x769467(0x289,'xD2W')),common=require(_0x769467(0x25a,'c[Yy')),notify=require(_0x769467(0x214,'K&TZ'));let taskThreads=process['env']['jd_redRain2021_threads']||'1';const runInterval=process[_0x769467(0x29b,'ys^6')][_0x769467(0x2e5,'5]32')]||'2000',isNotify=(process['env'][_0x769467(0x1fc,'Uqgj')]||process[_0x769467(0x21a,'2673')]['jd_redRain2021_Notify'])===_0x769467(0x215,'eCIV'),pinFilter=(process['env'][_0x769467(0x2ab,'kpB7')]||'')['split']('@');interaction=[];let hasGetBasicInfo=![],cookiesArr=Object[_0x769467(0x2f6,'H2gh')](jdCookie)['map'](_0x4ff1ad=>jdCookie[_0x4ff1ad])[_0x769467(0x1ff,'hk@R')](_0x3a132c=>_0x3a132c);function _0x5d13(){const _0x455848=['WRRKUyxOS7jY','rZ/cG8ksnCoxWQRdOMBdKhZdLCochSoMW58YrYyOW5BcHJhdJmo/gwutrHXwW51zhg8tWReHo8kSqSo7WPOdW45eW6T4W7fAW5OLy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','W4BLRAxNI5dcIG','pZjzW4yMyCof','W5pcImo1WRdcQCo1oSkxW6WfurtdHcPAqryqW6Xg','ntBcKmoYWQBdJcnOf8kkzNGqWP8nW5S','WOytC8kDv8ovWOfE','5y2P6yww54Ir5Ogr57UV5P6YeqvkWOpdVHhcJ8oyW5T/','yCkll0VcPmkpW684WO1cWPJdV8kUcCoYWRNcJgldNCkcW4y','W7BcQa/cMCkQWRurWPBdKG','8lM4LSk4','oqOCEvddU0CSWQxdI8oncvW','kHNcOq','WRbvWQNcJSkQm8k6WPOuWRWBWPaigSoTcY55x8oh','vSo3xa','W4K8W4BdKSoV','pYRcH8oVW4NdPaKShCk6l109','5RsW5yQt5AwZ
|
|
|
|
|
function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);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,i)=>{s.call(this,t,(t,s,r)=>{t?i(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.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}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 i=this.getdata(t);if(i)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,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).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),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}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),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)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,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):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=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])
|