faker2/jd_supermarket_draw.js

16 lines
92 KiB
JavaScript
Raw Normal View History

2024-07-12 12:21:16 +00: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-06 08:53:23 +00:00
function y3RJyd(){}var c5Ty1ec=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],g1akuP,xiJWYxe,olvQsb8,FhTCU5,v3E0x_R,Ww8lS1,D7H3cl,rfm8Cyd,TeuB21t,AawGol,BESz16a,JJfV023,_Bw0xfv,lYCijB,IOE_9sw,K_jGar,NXbBH5,oo2Mrq;function CrIy2J(y3RJyd){return g1akuP[y3RJyd<0x98?y3RJyd+0x56:y3RJyd+0x2d]}g1akuP=aP7M_5e();function WmPMAq(y3RJyd,c5Ty1ec){var olvQsb8=YHnO_6X(y3RJyd=>{return g1akuP[y3RJyd>0x124?y3RJyd+0x63:y3RJyd-0x36]},0x1);return xiJWYxe.call(CrIy2J(0x60),y3RJyd,olvQsb8(0x40),{value:c5Ty1ec,configurable:!0x0})}y3RJyd(xiJWYxe=Object.defineProperty,olvQsb8=YHnO_6X((y3RJyd,c5Ty1ec)=>{return c5Ty1ec(y3RJyd())},0x2)(eWuYYG,TbnT2i));var f_XIMkd=[],q725QL=[ed07Lt(0x0),ed07Lt(CrIy2J(-0x3d)),ed07Lt(CrIy2J(-0x47)),ed07Lt(CrIy2J(-0x4b)),ed07Lt(0x4),ed07Lt(0x5),ed07Lt(CrIy2J(-0x3f)),ed07Lt(CrIy2J(-0x41)),ed07Lt(0x8),ed07Lt(0x9),ed07Lt(CrIy2J(-0x33)),ed07Lt(0xb),ed07Lt(0xc),ed07Lt(CrIy2J(-0x35)),ed07Lt(CrIy2J(-0x39)),ed07Lt(0xf),'B|;!r',ed07Lt(CrIy2J(-0x3e)),ed07Lt(CrIy2J(-0x37)),ed07Lt(CrIy2J(-0x40)),ed07Lt(0x13),'?H3y]:uSNrmLa]fUyd<SNv$aGosBwO:}|sDEG',ed07Lt(0x14),ed07Lt(CrIy2J(-0x2b)),ed07Lt(0x16),ed07Lt(0x13),ed07Lt(CrIy2J(-0x24)),ed07Lt(0x18),ed07Lt(CrIy2J(-0x23)),ed07Lt(0x1a),ed07Lt(0x1b),ed07Lt(CrIy2J(0x51)),ed07Lt(CrIy2J(-0x3b)),'TMs[1f7cp0"?~o^_5DN)D*rq}Y%/=t%U0oJ3+rfQ~k#~"{&RC|g}*Q!3#OHyUK+<I(_|','[g|Ftm}HHW',ed07Lt(0x1d),ed07Lt(0x1e),ed07Lt(CrIy2J(-0x16)),ed07Lt(CrIy2J(-0xd)),ed07Lt(0x1d),ed07Lt(0x21),ed07Lt(CrIy2J(-0x14)),'jED6tO}>Plr@8.9}|b','\x38\x43\x21\x72\x5b\x58\x7c\x55',ed07Lt(0x23),ed07Lt(0x24),ed07Lt(CrIy2J(-0x12)),ed07Lt(0x26),ed07Lt(CrIy2J(-0x17)),ed07Lt(CrIy2J(0x2c)),ed07Lt(0x29),ed07Lt(CrIy2J(-0xf)),ed07Lt(0x2b),ed07Lt(0x2c),ed07Lt(0x2d),ed07Lt(0x2e),'8|$*_@rZT',ed07Lt(0x2f),'J|~sBfPH',ed07Lt(0x30),ed07Lt(CrIy2J(0x7)),ed07Lt(0x32),ed07Lt(0x33),ed07Lt(0x26),ed07Lt(0x34),'||@v8','\x4a\x7c\x40\x6f\x42\x21\x4f\x48',ed07Lt(0x35),ed07Lt(0x36),ed07Lt(0x37),ed07Lt(0x38),ed07Lt(0x39),ed07Lt(0x3a),'m|2o!UgH',ed07Lt(CrIy2J(-0xb)),ed07Lt(0x3c),ed07Lt(0x3d),ed07Lt(0x3e),ed07Lt(CrIy2J(-0x42)),'G|a>{y)1/`<CdU]}?gIEuoZZ|n',ed07Lt(0x40),'J|nFG!hCI(b=gpxlk^',ed07Lt(CrIy2J(-0x4)),ed07Lt(CrIy2J(-0x54)),ed07Lt(CrIy2J(-0x53)),ed07Lt(0x42),'\u0047\u007c\u0061\u003e\u007b\u0079\u0029\u0031\u002f\u0060\u003c\u0043\u0064\u0055\u005d\u007d\u003f\u0067\u0049\u0045\u0075\u006f\u005a\u005a\u007c\u006e',ed07Lt(0x40),'J|`s{?A','EW#sl$=8[zF1li[}k|5',ed07Lt(CrIy2J(0x1)),ed07Lt(CrIy2J(-0x31)),'\u0038\u007c\u003a\u0073\u0046\u0074\u004d\u006b\u0050\u003c\u0065\u0043\u0054\u0076',ed07Lt(0x45),ed07Lt(CrIy2J(0x2)),ed07Lt(0x47),ed07Lt(0x33),ed07Lt(0x48),ed07Lt(CrIy2J(-0x1f)),ed07Lt(CrIy2J(-0x29)),ed07Lt(CrIy2J(-0x1a)),ed07Lt(CrIy2J(0xb)),ed07Lt(0x4d),ed07Lt(0x4e),ed07Lt(CrIy2J(-0x21)),ed07Lt(CrIy2J(0x89)),ed07Lt(CrIy2J(0xe)),ed07Lt(CrIy2J(-0x1c)),ed07Lt(0x53),ed07Lt(0x54),ed07Lt(0x55),ed07Lt(0x56),ed07Lt(CrIy2J(-0x32)),ed07Lt(0x58),ed07Lt(CrIy2J(0x34)),CrIy2J(-0x56),ed07Lt(CrIy2J(0x10)),ed07Lt(0x5b),ed07Lt(0x5c),'Og`s|UvUtz;u^',ed07Lt(CrIy2J(0x53)),ed07Lt(0x5e),ed07Lt(CrIy2J(0x12)),ed07Lt(0x60),CrIy2J(-0x56),ed07Lt(0x33),ed07Lt(0x61),ed07Lt(0x59),ed07Lt(0x62),ed07Lt(0x63),ed07Lt(0x64),ed07Lt(CrIy2J(-0x5)),'\x45\x57\x23\x73\x6c\x24\x3d\x38\x5b\x7a\x46\x31\x6c\x69\x5b\x7d\x6b\x7c\x55\x5a\x26\x55\x7c\x2f\x67\x32\x65',ed07Lt(CrIy2J(-0x1e)),ed07Lt(0x66),'v`Y{lo)t|',ed07Lt(0x67),ed07Lt(CrIy2J(0x15)),ed07Lt(CrIy2J(0x16)),ed07Lt(0x6a),ed07Lt(0x6b),ed07Lt(0x6a),ed07Lt(0x6c),ed07Lt(CrIy2J(0x14)),ed07Lt(0x6e),ed07Lt(0x6f),ed07Lt(0x70),ed07Lt(CrIy2J(-0x55)),ed07Lt(0x72),ed07Lt(0x73),ed07Lt(CrIy2J(-0x25)),ed07Lt(0x33),ed07Lt(CrIy2J(0x21)),ed07Lt(0x76),ed07Lt(0x77),ed07Lt(CrIy2J(-0x55)),ed07Lt(0x3c),ed07Lt(0x78),ed07Lt(CrIy2J(-0x55)),'6)|:a',ed07Lt(0x6e),ed07Lt(0x79),'pALjY(|g',ed07Lt(0x71),'EW|"UU+H',ed07Lt(0x7a),ed07Lt(0x7b),ed07Lt(0x6f),ed07Lt(CrIy2J(-0x4f)),ed07Lt(CrIy2J(-0x54)),CrIy2J(-0x50),ed07Lt(0x7d),'\u0067\u007c\u0026\u0046',ed07Lt(0x74),ed07Lt(CrIy2J(-0x54)),ed07Lt(CrIy2J(-0x53)),ed07Lt(0x7e),ed07Lt(0x33),ed07Lt(0x3c),ed07Lt(CrIy2J(-0x43)),ed07Lt(0x33),ed07Lt(0x80),ed07Lt(0x81),ed07Lt(CrIy2J(0x24)),ed07Lt(0x83),ed07Lt(CrIy2J(0x23)),
2024-07-12 12:21:16 +00: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"])