faker3/jd_red1111_task.js

18 lines
96 KiB
JavaScript
Raw Normal View History

2024-10-14 17:05:11 +08:00
/*
活动名称双1111红包日常任务
环境变量jd_1111_url // 活动链接
jd_1111_ids // 分享码,多个用英文逗号,@换行分割一般是链接后面的s=xxx参数5个字符
jd_1111_threads // 控制并发线程数正整数默认1最大5尽量使用默认值否则请开启代理运行
jd_1111_interval // 自定义运行间隔时长整数单位毫秒默认2000
jd_1111_notify // 是否推送通知true/false默认不推送
jd_1111_pinFilter // 账号pin过滤多个用@进行分割
2024-10-15 20:17:18 +08:00
随机定时
2024-10-14 17:05:11 +08:00
*/
const $ = new Env('双1111红包日常任务')
2024-10-15 20:51:15 +08:00
function fakerb8dh9g(){}var fakerykzza=Object['defineProperty'],faker8p7gja,fakerx4gv5m,fakerh70k2,fakerjo4vr5,fakerys2epd,fakergiz768,faker4l5wgp,fakergqqgfu,faker799np,faker9atysb,fakeryy70k9,faker5gum5,faker3b5wgl,faker0fcr48,fakerz6y3j,fakerbm1v8s,fakeruo5j8o,fakern5ksw;function fakervrxi24(fakerb8dh9g){return faker8p7gja[fakerb8dh9g>0x1d?fakerb8dh9g-0x37:fakerb8dh9g>-0x63?fakerb8dh9g>0x1d?fakerb8dh9g-0x21:fakerb8dh9g+0x62:fakerb8dh9g+0x29]}faker8p7gja=faker3z2r8q.call(this);var faker3xj7bl=[],fakert3rf65=['s:PN"ju1cQ$6h#','s:PN"jsZ2rdb7','fGRF$U|v','LuF183wJ','2NPfD','R,zju4Z9','01NIIUm','ZsW^T:]7BWIP9)B','dd~cS`58kj6JlW&>Q9',']S6kv','xz)hW','_>?k','OgHQzR,PJI1%}[','OgHQzR,PJIpoP;','q~{X]H"','9[|i',fakervrxi24(-0x52),'>WFiXT~8','OgHQzR,PDCnxWIBR7z{','OgHQzR,PJIqjRI5>k[Fi','o_Y[g','OgHQzR,PDCj0VC93Q9','OgHQzR,PDC/0VC93Q9','LoEXq','OgHQzR,PDCW$Va9?wUMAs','Bdf<s',fakervrxi24(-0x50),'8[6Xq','_8jUC6om^s#7LCTHU0ym^;|Lq`XBR>6rdX%cq','|o;W[','y5>ItT5c>C','#g4C*aH8R>b]k[','|f$]ga;FV>b]k[','y5Un?TRlX>b]k[','Pd+=]a=AmC','~#AO3TsdV)fbk[','Wtjz6h28','zWYkQT"','8[6Xq',fakervrxi24(-0x61),fakervrxi24(-0x4b),'n{J`?:"','+tzcV|~8','>WpX5N9AK','!tpXq','bW,i','6[2i3SwEEf',fakervrxi24(-0x62),'UEk*Y:BSR>F?!YrF}(jg`#0A,W=$hoKH7y[tj.|LF<PlMeVZf2(nt','?t_kKhFQP','?t_k','zW6Xq','=TCV(cNhlKfoO9Oqp?xi',fakervrxi24(-0x62),'edjz>JM2z,v!x!K?n5{','XFMT,3MR,i.|%W&RddbNO:Z$|eHyxLFr|ouk4n(wf0Bn9','edpX&_"','cdukv','rt|i','Bz;p40{','zf^m40?u','9$`M','="e8$PB]$;qhC|q0,DniFSXwtc<7rQ)"tk[8QZ14/eJbZ)wYA=','+t@i','J.SON#nc0JWz3wwH*wRjY{9B~Vl5qK','#d5`<HW8','?UYkfHI)!A*J=dM>RUOcMN?)!jMy]T1dl{5`K&G&$5I~9CymI>#N=XZ&B,./n/S+$s=`=`"','u=YkX<+popzZ9',fakervrxi24(-0x5f),'u=YkX<+popzZ9','n_8;"$VU^*N9l$K','vdNA4RkeApzZ9','u=YkX<+popzZ9','vdNA4RU)U5bG9','+t@i','+t@i','qdL@&UVEApyZ0HCr_WOco`QQdY','Wt5`cS9pHe',fakervrxi24(-0x60),'#d5`<HW8','/>D@AnQQW5',fakervrxi24(-0x61),fakervrxi24(-0x59),'(;1u)B"','+t@i',fakervrxi24(-0x60),'edJ`B<Q,/y_cW/Wwk9','_U+@*hO8','L{DXOz9pnyqj/[',']oqz|H7ZSfnx9','0oOc`H58',fakervrxi24(-0x5f),'/>D@AnQQW5','>WAk','5D,d^XZt+V5UNwEHaYll%6DkD};lJG.F;2L=.T/m6',fakervrxi24(-0x62),'edDXo`9AO,%[?a)>_>Yk',fakervrxi24(-0x5e),'A[jK8','edYkq<nZO,z:W/!w29','qtaiQTn|P',fakervrxi24(-0x62),fakervrxi24(-0x5e),'s=ukW','edpX&_"','[t2VBN"@cA^,k8k*d~GN=`k,I7]BJ{13+#:zQTi)$*i}uHXfGoE8uh.Q,7N~V[E!)^6ds60_|iQT[QsGK$|L[p4SoW.Xpv=;ydfFf!zRE8uh.Q,7rZ6OCrt^[=5>AW:zXVNRgAq_*n4RLRrNAR!v=@;]d+5R){oXcVf9CiC}"','vdQc&}58','z#ZArb&2NG_:9','|Rs`t|"',fakervrxi24(-0x47),'){&cw|pHMz.|,[','){&cw|C~FYF4`[','){&cw|_)$5Ly9','){&cw|`w/e1`W8','OgS@','OgD@','Og?k','%#ukdH[3%,F','EPKNgHh2P','EPKNLNpASf',']orNgH`KK',']orNgHipsjG0`[','?UYkfHI)W@&%?a+O$sNAJ}AEcA9b%/IC~iDXqLx&^@{n]OUwhxvhS%53M,u$YC^BKhcs#SN&"0t0gas+UJK[]HL}P','vdNA4RU)U5bG9','9[J`?:"','ToFi','+t@i',fakervrxi24(-0x62),'f@!6yVa?r}KA:he','edJ`B<Z8zpca9','6[2iv','v=MA?)IvPp>kaLWw7W,zc<vK}p','L{f<V|ZQ%pa~VCg','L{DX2',fakervrxi24(-0x5c),fakervrxi24(-0x5b),'Vtqz*4jEP','%o!X@]R|9y4',fakervrxi24(-0x62),'@[=`VS=8Nf',fakervrxi24(-0x5d),fakervrxi24(-0x4f),'8qE6OwF?r}KA:he','%#ZAcT$|/ysj0HWwrt,i',fakervrxi24(-0x4e),'FUo@4nF8','d@hO7;#XXWTZJfC','Wtxi2N02`Gdj3LEOD{=`W',fakervrxi24(-0x5d),'K~QK/J9q<S]yuaV3','U/:j>,cGg.J=*l#wT0~j','/>bN!','L{f<V|ZQ%pa~VCg','+t5`p7n&$5BPW/2R',fakervrxi24(-0x5a),fakervrxi24(-0x5c),fakervrxi24(-0x5b),'Vtqz*4jEP','gXnW]_z)dJc','FUo@4nF8','+t@i','(sf>aBF~|N08s/I',fakervrxi24(-0x4a),'FUo@4nF8','Y9]2','X;A?=K7c=BKA:h0|c/;','6[2i3SwEEf',fakervrxi24(-0x58),fakervrxi24(-0x57),'2dYkX<e8',fakervrxi24(-0x56),'pdo@sT+pK',')ms`gh58','+zMAlch>EfJ:9',']oair)"',fakervrxi24(-0x55),fakervrxi24(-0x54),fakervrxi24(-0x5a),'QdDXJ}N&HyxZ9',fakervrxi24(-0x53),'Lo%c!',fakervrxi24(-0x51),fakervrxi24(-0x59),fakervrxi24(-0x58),fakervrxi24(-0x57),'9[z4#TNZ6jT/]O*','2dYkX<e8',fakervrxi24(-0x56),'pdo@sT+pK',')ms`gh58',fakervrxi24(-0x48),'1*~cw|tuK',']oair)"',fakervrxi24(-0x55),fakervrxi24(-0x54),'+tBc`H,&?p','9[J`?:"','QdDXJ}N&HyxZ9',fakervrxi24(-0x53),fakervrxi24(-0x52),fakervrxi24(-0x51),fakervrxi24(-0x59),'WtQcq','edDXV|n&6j*a/[',fakervrxi24(-0x62),'L{DX2','%#ZAcT6uPp','9[J`?:"','+t@i','+t@i',fakervrxi24(-0x50),'f@cRC6hq~Xr$}Pe','%#ZAcT$
2024-10-14 17:05:11 +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"])