faker3/jd_supermarket_draw.js

16 lines
96 KiB
JavaScript
Raw Permalink Normal View History

2024-07-12 20:19:07 +08:00
/*
活动名称超市卡抽奖
环境变量jd_supermarket_threads // 控制并发线程数正整数默认1最大3尽量使用默认值否则请开启代理运行
jd_supermarket_interval // 自定义运行间隔时长整数单位毫秒默认1000
jd_supermarket_notify // 是否推送通知true/false默认不推送
jd_supermarket_pinFilter // 账号pin过滤多个用@进行分割
cron:1 1 1 1 *
*/
const $ = new Env('超市卡抽奖')
2024-09-15 04:05:38 +08:00
function Qk0Q_f(){}var fF9VVRV=Object['defineProperty'],lo741f0,DjwAL5Q,wxhhCs,j7aC9H,asYp1M,lNxb51,KMjSJZ,dv9CfhF,y4F76f,hwvZ06,xn9wi8,eX7NBJp,xlp2oz,EbfPEq1,TfNDxx,FW_7TZp,OpLVtB;function Uykzo0(Qk0Q_f){return lo741f0[Qk0Q_f<0x11a?Qk0Q_f>0x34?Qk0Q_f-0x35:Qk0Q_f+0x2d:Qk0Q_f-0x1b]}lo741f0=R00W9AE();function wW3axfd(Qk0Q_f,fF9VVRV){return DjwAL5Q(Qk0Q_f,'length',{value:fF9VVRV,configurable:Uykzo0(0x87)})}Qk0Q_f(DjwAL5Q=Object.defineProperty,wxhhCs=M0EILOX((Qk0Q_f,fF9VVRV)=>{return fF9VVRV(Qk0Q_f())},0x2)(gczxHBl,O26wCS5));var DVw2_vY=[],TszdUK=['\u0051\u0063\u007e\u007c\u0069\u0077\u0053\u0072\u0023',KApbXJ8(Uykzo0(0x4a)),KApbXJ8(Uykzo0(0x48)),KApbXJ8(Uykzo0(0x4c)),KApbXJ8(Uykzo0(0x4b)),KApbXJ8(Uykzo0(0x44)),'k|T[R#Ep',KApbXJ8(Uykzo0(0x59)),KApbXJ8(Uykzo0(0x52)),KApbXJ8(0x7),KApbXJ8(Uykzo0(0x58)),KApbXJ8(Uykzo0(0x56)),KApbXJ8(0xa),KApbXJ8(0xb),KApbXJ8(0xc),KApbXJ8(0xd),KApbXJ8(Uykzo0(0x61)),KApbXJ8(Uykzo0(0x51)),KApbXJ8(0x10),KApbXJ8(0x11),KApbXJ8(Uykzo0(0x53)),KApbXJ8(Uykzo0(0x6b)),KApbXJ8(0x14),KApbXJ8(0x15),KApbXJ8(0x16),KApbXJ8(0x17),KApbXJ8(0x18),'\x7c\x6e\x3a\x62\x44\x58\x70\x51\x79\x75\x54\x60\x48',KApbXJ8(0x19),KApbXJ8(Uykzo0(0x63)),KApbXJ8(Uykzo0(0x35)),KApbXJ8(0x17),KApbXJ8(Uykzo0(0x79)),KApbXJ8(0x1d),KApbXJ8(Uykzo0(0x6e)),KApbXJ8(0x1f),'Y}Sqjno|k%rE~x:pM*BA','\u0026\u0076\u0041\u005a\u006f\u007c\u0068\u0026\u0040\u0049\u0056\u007b\u0066\u0060\u003e\u006f\u003f\u0045\u0035\u006a',KApbXJ8(Uykzo0(0x99)),KApbXJ8(Uykzo0(0x37)),KApbXJ8(0x22),'g3iP.x#V>|]Gz_HeFv6RvjOYo/h1(^h!|_I*WOx9ztKz])N`ydMoj9[*KkB}!$W"bued',KApbXJ8(Uykzo0(0x65)),KApbXJ8(Uykzo0(0x8e)),KApbXJ8(Uykzo0(0x36)),KApbXJ8(Uykzo0(0x6f)),KApbXJ8(0x26),'X3[YuVK7|.&',KApbXJ8(0x22),KApbXJ8(Uykzo0(0x6c)),KApbXJ8(Uykzo0(0x76)),KApbXJ8(0x28),KApbXJ8(0x29),KApbXJ8(0x1a),KApbXJ8(Uykzo0(0x35)),KApbXJ8(Uykzo0(0x40)),KApbXJ8(Uykzo0(0x77)),KApbXJ8(0x2c),KApbXJ8(0x2d),KApbXJ8(Uykzo0(0x5e)),KApbXJ8(Uykzo0(0xb0)),KApbXJ8(0x30),KApbXJ8(0x31),KApbXJ8(0x32),KApbXJ8(Uykzo0(0xa7)),KApbXJ8(0x34),'\x3c\x41\x7e\x4e\x7c\x72\x38',KApbXJ8(Uykzo0(0x38)),KApbXJ8(Uykzo0(0xdf)),KApbXJ8(Uykzo0(0x75)),KApbXJ8(0x38),KApbXJ8(Uykzo0(0x36)),KApbXJ8(0x30),KApbXJ8(Uykzo0(0x7d)),KApbXJ8(0x3a),KApbXJ8(Uykzo0(0x7b)),KApbXJ8(0x3c),KApbXJ8(Uykzo0(0x5b)),KApbXJ8(Uykzo0(0x37)),KApbXJ8(Uykzo0(0x7c)),KApbXJ8(0x3f),KApbXJ8(Uykzo0(0x7e)),KApbXJ8(Uykzo0(0x36)),'IdziE_H1buvZY9|kGkSq',KApbXJ8(0x41),KApbXJ8(Uykzo0(0x38)),KApbXJ8(0x42),KApbXJ8(0x43),KApbXJ8(Uykzo0(0x82)),KApbXJ8(Uykzo0(0x36)),KApbXJ8(0x45),KApbXJ8(0x46),KApbXJ8(Uykzo0(0x84)),KApbXJ8(0x2c),KApbXJ8(0x48),KApbXJ8(0x49),KApbXJ8(0x35),KApbXJ8(Uykzo0(0x86)),KApbXJ8(Uykzo0(0x88)),KApbXJ8(0x4c),KApbXJ8(0x4d),KApbXJ8(0x24),KApbXJ8(Uykzo0(0x92)),KApbXJ8(Uykzo0(0x89)),KApbXJ8(Uykzo0(0x3e)),KApbXJ8(0x51),KApbXJ8(0x27),KApbXJ8(Uykzo0(0x36)),KApbXJ8(Uykzo0(0x112)),KApbXJ8(0x53),KApbXJ8(0x54),KApbXJ8(Uykzo0(0x8a)),KApbXJ8(0x56),KApbXJ8(0x57),KApbXJ8(Uykzo0(0x60)),KApbXJ8(0x59),'\x52\x45\x7b\x5e\x32\x3a\x2c\x7c\x41',KApbXJ8(0x5a),KApbXJ8(Uykzo0(0x3c)),KApbXJ8(Uykzo0(0x3f)),KApbXJ8(0x5d),KApbXJ8(0x5e),KApbXJ8(0x23),KApbXJ8(0x5f),KApbXJ8(0x60),KApbXJ8(0x61),KApbXJ8(Uykzo0(0x85)),KApbXJ8(0x2a),KApbXJ8(0x63),KApbXJ8(0x64),'WKQueDH,|_ivh',KApbXJ8(Uykzo0(0x41)),KApbXJ8(0x5e),KApbXJ8(Uykzo0(0xca)),KApbXJ8(0x22),KApbXJ8(0x66),KApbXJ8(0x67),KApbXJ8(0x68),KApbXJ8(0x69),KApbXJ8(Uykzo0(0x90)),KApbXJ8(Uykzo0(0x38)),KApbXJ8(Uykzo0(0xb7)),KApbXJ8(Uykzo0(0x5c)),KApbXJ8(0x6d),KApbXJ8(0x6e),KApbXJ8(0x6f),KApbXJ8(0x70),KApbXJ8(Uykzo0(0x93)),'J@Kin4(aP%q.c>Po>}31Y|8',KApbXJ8(Uykzo0(0x94)),KApbXJ8(Uykzo0(0x95)),KApbXJ8(0x74),KApbXJ8(0x75),KApbXJ8(Uykzo0(0x3a)),KApbXJ8(Uykzo0(0x36)),KApbXJ8(0x76),KApbXJ8(0x77),KApbXJ8(0x78),KApbXJ8(0x22),KApbXJ8(Uykzo0(0x39)),KApbXJ8(Uykzo0(0x3b)),KApbXJ8(Uykzo0(0x97)),KApbXJ8(Uykzo0(0x36)),KApbXJ8(Uykzo0(0x39)),KApbXJ8(0x7b),KApbXJ8(Uykzo0(0x98)),KApbXJ8(0x75),KApbXJ8(0x2a),KApbXJ8(0x7d),KApbXJ8(0x22),KApbXJ8(0x7e),KApbXJ8(Uykzo0(0x9a)),KApbXJ8(0x35),KApbXJ8(0x76),KApbXJ8(Uykzo0(0x36)),KApbXJ8(Uykzo0(0x3a)),KApbXJ8(0x77),KApbXJ8(0x78),KApbXJ8(Uykzo0(0x36)),KApbXJ8(0x3f),KApbXJ8(Uykzo0(0x3b)),KApbXJ8(Uykzo0(0x3c)),KApbXJ8(0x22),KApbXJ8(Uykzo0(0x3
2024-07-12 20:19:07 +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"])