2024-11-12 11:17:55 +08:00
|
|
|
|
/*
|
2024-11-21 14:54:16 +08:00
|
|
|
|
活动名称:惊喜红包
|
2024-11-12 11:17:55 +08:00
|
|
|
|
|
2024-11-21 14:54:16 +08:00
|
|
|
|
cron:15 12 * * *
|
2024-11-12 11:17:55 +08:00
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
2024-11-21 14:54:16 +08:00
|
|
|
|
const $ = new Env('惊喜红包')
|
2024-12-16 19:51:07 +08:00
|
|
|
|
function puTSQQ5(){}var a2l4BS=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],wb3aYQ,aUu9K_x,f0Cz_0Q,HziKc6,Pr48Tjg,bA_MV3V,QFw9he,gTmIFxP,Zx4wmjQ,KYjiX_H,wof9ig7,MbeydBl,Nb2vq1,L6Ze_M,SxC0t2M,v8eDV_v,AuTvWQz,ZeQADK;function adrYqmg(puTSQQ5){return wb3aYQ[puTSQQ5<0x4f?puTSQQ5-0x8:puTSQQ5-0x3]}puTSQQ5(wb3aYQ=UuZHf1E(),aUu9K_x=FF9Wyu((puTSQQ5,a2l4BS)=>{return a2l4BS(puTSQQ5())},0x2)(P04U9E0,UyWPk9o));var RixjYmv=[],drYdAu=['\x31\x69\x6a\x66\x65\x5b\x24\x54\x5f',X9WbnCE(adrYqmg(0xd)),X9WbnCE(adrYqmg(0xc)),'\x43\x53\x61\x42\x4c\x3f\x6b\x2e','\x71\x40\x34\x5b\x36','\x4e\x6f\x59\x5b','\x61\x7d\x33\x26\x7e\x33\x7e\x2e\x7d\x5d\x65\x2f\x6b\x52\x7c\x65\x63\x7d\x33\x26\x46\x3f\x2b\x25\x4c\x47\x3a\x53\x7b\x22','\x61\x7d\x33\x26\x7e\x33\x7e\x2e\x7d\x5d\x65\x2f\x6b\x52\x7c\x65\x63\x7d\x3f\x2a\x40\x4c\x47\x2a\x5b\x6b\x7b\x72\x50\x39',X9WbnCE(adrYqmg(0x31)),'\x61\x7d\x33\x26\x7e\x33\x7e\x2e\x7d\x5d\x65\x2f\x6b\x52\x7c\x65\x63\x7d\x5e\x74\x63\x24\x57\x74\x29\x3e\x58','\x61\x7d\x33\x26\x7e\x33\x7e\x2e\x7d\x5d\x65\x2f\x6b\x52\x7c\x65\x63\x7d\x5e\x74\x41\x24\x57\x74\x29\x3e\x58',X9WbnCE(adrYqmg(0x15)),'\x61\x7d\x33\x26\x7e\x33\x7e\x2e\x7d\x5d\x65\x2f\x6b\x52\x7c\x65\x63\x7d\x4a\x2c\x77\x23\x44\x5e\x7e\x69\x60\x5f\x7c\x66\x77','A~uEq?;','b:W$e',X9WbnCE(adrYqmg(0x1e)),'\x6f\x66\x51\x76\x45\x6c\x7e\x2e','QY.8+yt)','\u0040\u0030\u002c\u0076',adrYqmg(0x8),X9WbnCE(adrYqmg(0x17)),X9WbnCE(0x6),'\u0023\u0077\u0049\u0043\u0036\u0030\u0060\u0063','\u0043\u0023\u0038\u0075\u002b\u0064\u003c','\u0063\u0054\u0036\u006f\u0052',X9WbnCE(adrYqmg(0x1c)),'\u0043\u0042\u0032\u006a\u0047\u0022\u004b\u0060\u0031\u002a\u0033\u0035\u004e','W%Qu#',X9WbnCE(adrYqmg(0x1b)),'\u004a\u0068\u0030\u0042\u0063\u003c\u007e\u002e','\u006f\u0066\u006d\u0045\u006b\u0046\u0029\u0074\u0028',X9WbnCE(adrYqmg(0x20)),'\u0072\u0066\u007a\u0076',X9WbnCE(adrYqmg(0xb)),adrYqmg(0xa),'\u0032\u0026\u005b\u0077\u004b\u005f\u0062\u0040\u006e\u006f\u0051\u0059\u0038\u004b\u0037\u0051\u0050\u0073\u005d\u007d\u004c\u0031\u0043\u0074\u007a\u0066\u0058\u006a\u0023\u0053\u0028\u003f\u0078\u003e\u0039\u0068\u005d\u0056\u003c\u0052\u0051\u0024\u007b\u007c\u003d\u0069\u0063\u0067\u0057\u0048\u0073\u0033\u0068','\u0041\u003a\u0052\u002c\u0035\u0032\u0063\u0026\u0074\u006d\u003e\u0067\u0043\u003f\u0044\u0037\u004e\u0066\u0061\u0042\u0053\u004c\u002a\u002a\u003a\u004b',X9WbnCE(0xb),adrYqmg(0x8),'\u0069\u003a\u004b\u005b\u005e\u003c\u0054\u0072\u0063\u0043\u0030\u005f\u0066\u002b\u0038\u0054\u0048\u0029','\u0043\u0032\u0021\u005a\u006c',X9WbnCE(adrYqmg(0x14)),X9WbnCE(adrYqmg(0x19)),adrYqmg(0x9),'\u0044\u003f\u0030\u0065\u003d\u0066\u003b\u003b\u0072\u006f','i:`EblYm%GMg)',X9WbnCE(adrYqmg(0x1a)),'\u0051\u0055\u003a\u005d\u0036\u006b\u007b\u003b\u0045','\x73\x22\x4f\x25\x21\x62\x3b',X9WbnCE(0xb),X9WbnCE(adrYqmg(0x10)),X9WbnCE(0x10),'\x71\x76\x34\x61\x2c\x3d\x4b\x7d','\u0052\u0075\u0060\u0045\u0061\u0030\u0029\u006d\u0033\u003e\u0041\u005d\u002b\u0039',X9WbnCE(0x11),adrYqmg(0x9),X9WbnCE(0x12),'\u005a\u0077\u007c\u0023','uUh#iEa>YduT{&9.X_LL;6U^Ul5LFsD*5OqQD`tP6',adrYqmg(0xa),'\x32\x23\x55\x45\x62\x57\x31\x3c\x7e\x68\x3b\x25\x38\x58\x34\x41\x2b\x41\x5f\x5e','\x41\x3a\x52\x2c\x35\x32\x63\x26\x74\x6d\x3e\x67\x43\x3f\x44\x37\x4e\x66\x61\x42\x53\x4c\x2a\x2a\x3a\x4b','\x4a\x51\x7c\x5e\x72',X9WbnCE(0x13),X9WbnCE(0x14),'01gt7r5HFGN_)',adrYqmg(0xa),'Zw|#',X9WbnCE(0x15),'\x4d\x24\x41\x61\x2f\x76\x43\x3a\x7c\x62\x3b\x45\x31\x7b\x5b\x4e\x71\x77\x4b\x68\x73\x63\x50\x50\x24\x37',X9WbnCE(0x16),X9WbnCE(adrYqmg(0x26)),X9WbnCE(0x18),X9WbnCE(0x19),X9WbnCE(adrYqmg(0xb)),X9WbnCE(0x1a),'\x6e\x55\x65\x2e\x32\x35\x40\x45\x42','\u002a\u0031\u0033\u0062\u004c','\u0066\u0068\u0079\u0076\u006e\u0024\u0078\u002a\u0059\u006d\u0048\u007b\u004a\u0061\u002b\u0037\u003b\u0039\u0049\u005b\u0022\u0023\u0075\u0041\u0028',X9WbnCE(0x1b),X9WbnCE(adrYqmg(0x28)),X9WbnCE(0x1d),'\x50\x3a\x70\x43\x21\x2c\x34\x4a\x44\x63\x40\x3d\x24\x37\x44\x54\x2f\x50','\x40\x3e\x4d\x60\x6c\x48\x56\x67\x6f\x77','\x29\x39\x60\x45\x54\x3c\x21\x28\x22\x6d\x61\x67\x63\x44\x22\x59\x57\x29','\u007e\u0066\u0034\u0045\u0071\u003f\u002a\u0048\u0034\u006b','\
|
2024-11-21 14:54:16 +08:00
|
|
|
|
|
2024-11-12 11:17:55 +08:00
|
|
|
|
// prettier-ignore
|
|
|
|
|
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"])
|