2024-11-12 11:17:55 +08:00
|
|
|
|
/*
|
|
|
|
|
活动名称:天天领豆
|
|
|
|
|
环境变量:jd_beanday_interval // 自定义运行间隔时长(整数,单位毫秒),默认1500
|
|
|
|
|
jd_beanday_notify // 是否推送通知(true/false),默认不推送
|
|
|
|
|
jd_beanday_pinFilter // 账号pin过滤,多个用@进行分割
|
|
|
|
|
|
|
|
|
|
cron:15 1,14 * * *
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
const $ = new Env('天天领豆')
|
2024-12-12 14:33:07 +08:00
|
|
|
|
function M05j5m(){}var AoC6gH7=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],D_ce92,joV_dO,UgaKgy,MdJnsZI,yHwTq9,UxJTli,UYHqDL,qpMExrK,VraQAO,GHRilC,tN7PVn5,NMKNq0B,J3cPgD,DGrPDq,StKqblx,GPKt5vw,FeRo5U9;function ZZEmFs2(M05j5m){return D_ce92[M05j5m>0x5c?M05j5m<0xac?M05j5m<0xac?M05j5m<0x5c?M05j5m+0x3c:M05j5m-0x5d:M05j5m+0x4d:M05j5m-0x32:M05j5m+0x13]}M05j5m(D_ce92=PuEFqK(),joV_dO=p1O7A4((M05j5m,AoC6gH7)=>{return AoC6gH7(M05j5m())},0x2)(uO97LY,UtPrnt));var bhaDyQO=[],xpkdiB=[QotIHbl(ZZEmFs2(0x61)),'\u003b\u003c\u0063\u003e\u0047\u007a\u0029\u0077','\u005a\u0073\u0068\u0045\u006d','\u004f\u002b\u0077\u0045','\u0021\u007c\u0028\u0026\u0072\u0053\u0054\u0049\u006f\u0078\u0057\u0049\u007d\u0054\u0074\u002b\u0053\u0061\u0021\u005b\u0023\u002f\u0070\u004b','\x21\x7c\x28\x26\x72\x53\x54\x49\x6f\x78\x57\x49\x2b\x44\x64\x21\x5b\x44\x55\x60\x2e\x36\x66\x4b','\u006c\u0073\u006e\u004e\u007c','\x21\x7c\x28\x26\x72\x53\x54\x49\x6f\x78\x57\x49\x57\x53\x3b\x59\x23\x67\x24\x5b\x71','\u0021\u007c\u0028\u0026\u0072\u0053\u0054\u0049\u006f\u0078\u0057\u0049\u0057\u0053\u007c\u0059\u0023\u0067\u0024\u005b\u0071',QotIHbl(0x1),'\x21\x7c\x28\x26\x72\x53\x54\x49\x6f\x78\x57\x49\x38\x4e\x47\x77\x2c\x31\x4d\x48\x49\x79\x32\x51\x47','V$PuZyR','\u0037\u0044\u0038\u007b\u005e','\x3f\x4e\x49\x48','\x2b\x67\x70\x48\x75\x53\x24\x4b',QotIHbl(0x2),ZZEmFs2(0x5d),'\u004a\u0044\u0071\u0023\u003e\u0072\u003a\u007a\u0037\u0042\u0056\u0069\u0026\u003e\u005d\u002b\u0023\u0061\u0067\u007a\u0037\u0045\u002a\u0026\u0048\u005a\u003b\u0057\u006a\u003c\u0072\u006f\u0034\u003b\u0024\u0055\u0048','#YTw^','\x67\x32\x7e\x23\x68\x46\x5d\x4b','\u0023\u0067\u006e\u0045\u0071\u0053\u0052',ZZEmFs2(0x5d),'1D0u7SwCQx`b?',QotIHbl(0x3),QotIHbl(0x4),QotIHbl(ZZEmFs2(0x68)),'\u002b\u0067\u0043\u0075\u002a\u0033\u003f\u0026\u0047','\u0072\u0032\u0043\u0075\u0056',QotIHbl(0x6),QotIHbl(ZZEmFs2(0x5e)),QotIHbl(ZZEmFs2(0x5f)),'\x4e\x55\x62\x6b\x7c\x3b\x7a\x50\x5a\x75\x26\x79\x22\x7c\x5f\x26\x69\x3e\x7d\x36\x58\x73\x6a\x63\x70\x47\x3d\x4d\x71\x34\x40\x51\x78\x67\x54\x30\x7d\x59\x46\x45\x26\x32\x57\x23\x35\x6c\x3f\x2c\x2f\x31\x3e\x6e\x30',QotIHbl(ZZEmFs2(0x69)),QotIHbl(0x8),ZZEmFs2(0x5d),'">RYoG3[X6<bG+]cCdv~*mPX>0}*~J&Ihr8*gmi;kM1/tj','\x31\x44\x6e\x45\x28\x49\x3a\x41\x76\x25\x23\x34\x67\x2e\x72\x3a\x5d\x3f','\x76\x32\x56\x23\x72',QotIHbl(ZZEmFs2(0x73)),QotIHbl(0xb),'\u004d\u0044\u002a\u0039\u007b\u0079\u0067\u004b',QotIHbl(ZZEmFs2(0x63)),QotIHbl(0xd),'\x6d\x44\x49\x48\x41\x36\x5e\x71\x55',QotIHbl(ZZEmFs2(0x6b)),'J}ZA','\x71\x6f\x43\x75\x58\x39\x31\x4b','1D697{qW.JO[g.g:E?','O_i,eF!K','\x74\x50\x30\x75\x21\x23\x3f\x43\x54\x4a\x56\x7e\x2e\x4e','\u005a\u0061\u0056\u0023\u0049\u0079\u0058\u0062\u0073\u0038\u0054\u006c\u003f','\u0025\u0061\u0021\u005b\u0039\u0079\u002a\u004b',QotIHbl(ZZEmFs2(0x62)),'\x2e\x2b\x30\x2c\x26\x54\x71\x71\x67\x2a','\u002b\u0067\u0026\u0045','\x34\x68\x21\x37\x69\x48\x7b\x26\x4b\x66\x34\x5f\x3d\x3b\x25\x4a\x31\x30\x40\x40\x22\x3e\x68\x6c\x68\x29\x6e\x40\x7a\x46\x2b\x36\x6e\x54\x62\x2c\x2b\x59\x57\x5b\x3e','\x69\x32\x2c\x48',QotIHbl(0x10),'s7bGQ_f%N?w{yJ2aU~PZj$uu70',QotIHbl(ZZEmFs2(0x65)),QotIHbl(0x11),QotIHbl(0x12),'\x69\x32\x2c\x48','\u002b\u0067\u0026\u0045','\x46\x3e\x65\x77\x3b\x68\x22\x77\x57\x67\x71\x23\x26\x55\x38','VDt,<_vd&CJb%y;YOg![a9qqDn','\u005e\u006f\u0051\u0045\u0067',QotIHbl(ZZEmFs2(0x77)),'\x31\x44\x43\x75\x41\x54\x46\x5d\x55','\u0033\u0036\u0026\u0045\u0025\u0063\u0073\u0041\u003b\u006e\u0059\u005a\u0067\u006a\u0076\u0042\u0033\u0036\u0026\u0045\u0025\u0063\u0073\u0041\u003b\u006e\u0059\u005a\u0067\u006a\u0076\u0042\u0033\u0036\u0026\u0045\u0025\u0063\u0073\u0041\u003b\u006e\u0059\u005a\u0067\u006a\u0076\u0042\u006d\u003f',QotIHbl(0x14),QotIHbl(ZZEmFs2(0x76)),QotIHbl(ZZEmFs2(0x5e)),QotIHbl(0x16),'\x7d\x37\x3d\x59\x35\x2c\x7d\x4c','\u0069\u0032\u002c\u0048',QotIHbl(0x17),'!|[^O6rCbW[~Ej',QotIHbl(0x18),QotIHbl(0x19),'DDPuVt2Qv%h>j"Xvg2WHDFXq9x)$O;*+H?',ZZEmFs2(0x60),'\x68\x4e\x5d\x48\x6d','cdfPS1kii+','.trZM','\u0074\u0050\u0030\u0075\u005d','\u006d\u0044\u0073\u0075\u0056\u0033\u0058\u004b','08~X);,Qc%uO`d',QotIHbl(ZZEmFs2(0x5f)),Qo
|
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"])
|