mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-03-13 22:24:45 +08:00
19 lines
69 KiB
JavaScript
19 lines
69 KiB
JavaScript
|
/*
|
|||
|
活动名称:3.8 抽钻石助力
|
|||
|
活动链接:https://pro.m.jd.com/mall/active/dHh4DUQDWgLsTVLQysZ6sHwFRPJ/index.html
|
|||
|
环境变量:jd_czs_interval // 自定义运行间隔时长(整数,单位毫秒),默认2500
|
|||
|
jd_czs_notify // 是否推送通知(true/false),默认不推送
|
|||
|
jd_czs_pinFilter // 账号pin过滤,多个用@进行分割
|
|||
|
jd_czs_num // 指定人数 非必须,不填默认跑全部账号
|
|||
|
jd_czs_inviterId // 指定助力码 非必须,不填默认助力账号一
|
|||
|
|
|||
|
cron:59 23 29 2 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('3.8 抽钻石助力')
|
|||
|
function J6W8Cw(){}var aehjR97=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],rKsuTW,jLseoR,ZPYZy_o,Pi77F1,qOBwJX,a5wMdRF,gvRCu8h,XPBDsG,_DldFYt,O6yrNLa,qdk4zIB,p_lTiy,plYN1v0,_y4H_3p,C0L_KdH,vPkMdeo,zdK6AlG;function UWI_4H4(J6W8Cw){return rKsuTW[J6W8Cw>0x67?J6W8Cw-0x3f:J6W8Cw<0x67?J6W8Cw<0x15?J6W8Cw-0x5a:J6W8Cw<0x15?J6W8Cw-0x54:J6W8Cw-0x16:J6W8Cw-0x62]}J6W8Cw(rKsuTW=QFmcZR(),jLseoR=ndCJ_7((J6W8Cw,aehjR97)=>{return aehjR97(J6W8Cw())},0x2)(DZVneC,_TTO7_));var J_NXeW=[],VlFfdX2=['\u0031\u0075\u0076\u0060\u007b\u0066\u007e\u0056',OjFxco(UWI_4H4(0x1e)),'\x58\x3f\x78\x7b\x22','\u007e\u0053\u007a\u007b','\x79\x76\x6d\x68\x73\x63\x42\x63\x60\x31\x6d\x55\x33\x49\x30\x67\x4e\x28',OjFxco(UWI_4H4(0x2b)),'\x40\x3f\x4a\x25\x76','\x79\x76\x6d\x68\x73\x63\x42\x63\x7a\x33\x59\x45\x23\x52\x35\x2f',OjFxco(UWI_4H4(0x31)),OjFxco(UWI_4H4(0x22)),OjFxco(0x4),'\u0034\u002a\u005e\u0061\u0058\u0056\u006e','\x79\x76\x6d\x68\x73\x63\x42\x63\x32\x62\x29\x43\x26\x2e\x7c\x67\x77\x3c\x44\x37','\x79\x76\x6d\x68\x73\x63\x42\x63\x7a\x33\x57\x5f\x28',OjFxco(0x5),'\u0079\u005d\u007c\u0025\u003f\u0054\u0065\u006a\u0076\u0035\u005e\u0047\u0048\u006d\u005f\u0022\u0025\u0025\u0058\u003b\u005a\u004c\u0021\u006a\u0076\u003f\u0029',OjFxco(0x6),'\u0028\u0025\u0069\u0075','\x53\x3c\x5d\x75\x61\x4d\x2a\x3a','?G7u',UWI_4H4(0x16),'\x7e\x3a\x46\x40\x36\x78\x29\x2f\x41\x3b\x2b\x5b\x4b\x36\x4d\x56\x40\x70\x5f\x2f\x41\x74\x69\x4b\x34\x54\x61\x71\x3e\x53\x78\x65\x49\x61\x55\x21\x34','@YNu"','\u003c\u0039\u0046\u0047\u0078\u0044\u004e\u003a',OjFxco(UWI_4H4(0x20)),UWI_4H4(0x16),'\x62\x49\x66\x61\x71\x4d\x7a\x6a\x23\x35\x5a\x77\x28',OjFxco(UWI_4H4(0x2a)),'\x6d\x5e\x59\x54\x7a\x45\x6e',OjFxco(UWI_4H4(0x25)),'\x53\x3c\x6a\x61\x31\x43\x28\x4c\x48','\u0030\u0039\u006a\u0061\u0034',OjFxco(0xa),'\x23\x24\x4a\x7b\x61\x6f\x67\x6a\x29\x6a\x47\x77\x28',UWI_4H4(0x18),'\u0036\u005e\u007c\u0030\u0046\u0063\u0060\u006a\u006a\u003d',UWI_4H4(0x17),'\u0021\u006a\u0054\u0056\u0064\u0052\u006c\u0063\u0055\u0032\u002b\u0039\u004d\u0064\u0043\u002b\u0072\u0073\u0034\u005f\u005b\u002e\u0062\u0077\u0068\u0049\u0076\u0038\u0026\u006b\u0029\u0037\u007d\u0024\u005e\u0071\u0034\u0023\u0079\u0074\u002b\u003e\u002f\u004c\u003b\u004a\u0040\u003a\u003d\u007c\u0073\u0025\u0071','\x59\x29\x77\x54\x39\x69\x6e','\u0021\u0028\u0079\u007e\u0028\u0062\u004f\u004a\u0052\u003e\u004d\u006c\u007b\u0052\u0053\u0067\u0067\u0049\u003a\u0050\u0042\u0029\u0030\u006c\u0052\u004e\u0074\u0021\u0024\u0028\u002c\u0031\u004a\u0029\u0070\u0076\u002e\u004c\u0072\u002a\u0031\u0028\u0054\u0040\u007c\u0038\u0030\u003a\u0031\u0024\u006c\u007e\u0023\u0055\u0066\u0046\u002f\u003e\u0026\u005b\u0023\u0079\u0060\u0066\u0035\u0033\u0042\u003a\u006a\u0022\u0044\u0052\u0056\u0028\u0028',OjFxco(0xb),'\u0067\u0039\u0037\u0075',UWI_4H4(0x16),OjFxco(0xc),'Q94G0','\u0062\u006b\u0042\u0058\u005b\u0037\u0045\u0035','\x3f\x64\x7a\x7a\x24\x48\x45\x2f\x30\x45\x33',OjFxco(0xd),OjFxco(0xe),'\u0062\u0049\u0066\u0061\u0071\u004d\u007a\u006a\u0023\u0035\u005a\u0077\u0028','\x4e\x3c\x79\x30\x51\x31\x59\x67\x2f',OjFxco(0xf),UWI_4H4(0x17),OjFxco(UWI_4H4(0x23)),OjFxco(UWI_4H4(0x24)),OjFxco(0x12),'K^fayG(jm_4F.%',OjFxco(0x13),OjFxco(0x14),UWI_4H4(0x18),'\x2e\x53\x66\x37\x4c\x6d\x64\x64\x3c\x31','\x53\x3c\x4c\x7b','\u0031\u0066\u0033\u0049\u0041\u0061\u0077\u0039\u0067\u0051\u0031\u0040\u0043\u0060\u0068\u0056\u0052\u004a\u006b\u006b\u0055\u0078\u0066\u007b\u0066\u006c\u0074\u006b\u0059\u0035\u0050\u005d\u0074\u004e\u004b\u0024\u0050\u004d\u002e\u002f\u0078','\x62\x49\x4a\x7b\x34\x6f\x6d\x77\x79\x33\x47\x45\x3c\x2e\x30\x60\x4e\x28',OjFxco(0x15),OjFxco(0x16),'>lXY',OjFxco(0x17),'bIjac~n',OjFxco(0x16),'\x23\x24\x4a\x7b\x61\x6f\x67\x6a\x29\x6a\x47\x77\x28',OjFxco(0x18),OjFxco(0x16),'\u002e\u0053\u004b\u0061\u0058\u0056\u0072\u0067\u0032\u005f\u0051\u0052\u003d\u004b\u0068\u0079\u0052\u002c\u0032\u0043\u0039\u0069\u004a\u0032\u0077\u0033\u0026\u0077\u0028',OjFxco(UWI_4H4(0x34)),'\u0078\u0025\u004e\u0075\u003d\u003f\u0060\u0068\u0068\u007d',OjFxco(0x1a),UWI_4H4(0x1c),'U+wL!MHVhFFEk<,',OjFxco(UWI_4H4(0x36)),'<9dZiVVWA1f;V$$g',OjFxco(0x1c),OjFxco(0x
|
|||
|
|
|||
|
// 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"])
|