faker3/jd_opencard_shopleague.js

20 lines
122 KiB
JavaScript
Raw Normal View History

2024-11-12 11:17:55 +08:00
/*
活动名称超店会员福利社 通用开卡
活动链接https://lzdz1-isv.isvjcloud.com/dingzhi/shop/league/activity?activityId=<活动id>
环境变量jd_opencard_shopleague_id // 活动ID
jd_opencard_wait // 延时参数默认1秒
jd_opencard_viewShop // 是否true/false做浏览任务默认不做
jd_opencard_draw // 最大抽奖次数默认3次
jd_opencard_break // IP被限制后继续执行默认退出运行true/false
不会自动运行请在有水的时候运行
cron "1 1 1 1 *" script-path=jd_opencard_shopleague.js
*/
const $ = new Env('超店会员福利社通用开卡');
2025-02-13 18:05:59 +08:00
function Kx3MhnO(){}var Aw0iGCp=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],c7umc4d,cM_50D,hhKJ5nl,eRVzvB,pgsXuWy,dmXdrRh,nvDyx61,nQKnvcP,ksiIQ0,zQWJkw,_5B8FdC,oysWjeG,hbUTCJ,Poe5WvN,u7mY_Yv,eSFfkrg,uzMdBz4,wtOI5bw,DKWA21;function fxSzwp(Kx3MhnO){return c7umc4d[Kx3MhnO>-0x4?Kx3MhnO+0x3:Kx3MhnO-0xa]}Kx3MhnO(c7umc4d=ePRX0T(),cM_50D=GUCsCEr((Kx3MhnO,Aw0iGCp)=>{return Aw0iGCp(Kx3MhnO())},0x2)(jnaaOXi,Oceb1j));var wVQLjG=[],DBYUqK=[h1cKu3(0x0),'\x41\x64\x33\x4f\x60\x25\x56\x51',h1cKu3(0x1),h1cKu3(fxSzwp(0x26)),h1cKu3(fxSzwp(0x13)),h1cKu3(fxSzwp(0x24)),'Ed?y','\u0049\u0032\u002c\u004d\u0042\u0024\u0074\u005f\u007e\u006e\u002e\u0059\u0054\u006f\u0029\u0064\u0051\u007d\u005f\u002b\u004c\u004b\u0043\u003e\u0034\u0048\u0066\u007e\u0055\u0047\u0032','\x49\x32\x2c\x4d\x42\x24\x74\x5f\x7e\x6e\x2e\x59\x54\x6f\x73\x61\x76\x75\x6d\x5a\x6c','\u006f\u0029\u004d\u0031\u003b','\u0049\u0032\u002c\u004d\u0042\u0024\u0074\u005f\u007e\u006e\u002e\u0059\u0054\u006f\u006c\u0069\u0042\u0038\u0045\u0079','I2,MB$t_~n.YTo/>ilAy',h1cKu3(0x5),h1cKu3(fxSzwp(0x11)),'\u007c\u0075\u0057\u002e\u006a',h1cKu3(fxSzwp(0x12)),h1cKu3(fxSzwp(0x1d)),h1cKu3(fxSzwp(0x29)),'\x45\x53\x48\x68\x54\x4e\x29\x3d\x74\x6a\x35\x33\x6f\x54\x4b\x58\x68\x7a\x23\x3d\x74\x70\x5f\x6f\x3b\x7b\x31\x7c\x61\x64\x4e\x46\x75\x31\x59\x51\x3b','hR7+v','\x3f\x68\x41\x79\x2b\x3e\x46\x67\x64\x6e\x7c\x29\x2f\x4b\x55\x57\x6c\x48\x44\x5d\x7c\x64\x53\x5e\x31\x41\x4b\x7a\x5f\x38\x77\x69\x34\x2b\x36\x73\x55\x59\x2f\x72\x61\x23\x4e\x52\x53\x77\x7c\x61\x56\x28\x62\x73\x77\x3c\x62\x60\x3f\x56','\x35\x75\x25\x7b\x2e\x58\x6c\x53',h1cKu3(0xa),'hMyfAe|}PgONc{i&Z:cag~`C1<)c<)?X[}rH3SdOMKNN6n`3huxaDeV8,g[WAcL&]XT(S','?hAy+>Fgdn|)/KUWlHD]|dS^1AKz_8wi4+6sUY/ra#NRSw|aV(FZ_[`7MWL4ZoMI','\x35\x58\x71\x4e\x4d\x4b\x73\x5a\x31\x64\x54\x43\x6e\x31\x57\x40\x44\x53\x50\x39\x3b\x31\x7a\x51\x5e\x31\x4e\x71\x6a\x73\x42\x58\x67\x7b\x72\x48\x5e\x6a\x5f\x6f\x3b\x7b\x31\x7c\x32\x3c\x32\x44\x34\x75\x7a\x24\x46','\x21\x28\x41\x79\x31\x2e\x69\x56\x29\x56\x26\x36\x30',h1cKu3(0xb),h1cKu3(0xc),'^+q1;o<7xzk)0',fxSzwp(-0x2),'\u0021\u0028\u0041\u0079\u0031\u002e\u0069\u0056\u0029\u0056\u0026\u0036\u0030',h1cKu3(fxSzwp(0x1c)),'\u006f\u0060\u0073\u0031\u0056\u0034\u0040\u003e\u0067\u0076\u003b\u0044\u007a','\x6c\x7d\x48\x26\x4e\x3c\x37\x53','\u0026\u006c\u0041\u0079\u004c\u004b\u0022','\x57\x21\x51\x4d\x24\x6b\x72\x26','GdLQwb"','\u0061\u0021\u0077\u004d\u004e\u0024\u0061\u0037\u0071\u007c\u0028','\x66\x55\x54\x2a\x21\x49\x56\x4f\x4f\x32','\x43\x21\x77\x4d\x4e\x24\x61\x37\x71\x7c\x36\x58\x72\x71\x72\x5e\x33\x7a',h1cKu3(0xe),'C!8106"','\x37\x75\x28\x7b\x44\x52\x50\x4c\x42','\u007a\u0029\u0049\u0051\u007b\u0058\u0025\u0053','\u0044\u006c\u0035\u005a\u0021\u0063\u003b\u004d\u004d\u0057','\x48\x34\x3f\x51\x44\x24\x5a\x5f\x61\x58\x60\x74\x4d\x29','\x6e\x47\x2a\x42\x3d\x4b\x70\x4d\x30','\u0043\u004a\u003c\u0051\u0049\u0031\u002e\u0066\u0069\u003a\u0046\u0032\u0045\u0029',fxSzwp(-0x3),'\x42\x38\x40\x2b\x51\x2e\x50\x53','\x72\x75\x71\x31\x7c\x4b\x3f\x56\x21\x6e\x63\x36\x30','\u005f\u006f\u0066\u0031\u006c\u004d\u005f\u0038\u0044\u0038\u0077\u0065\u0070\u005a\u0079\u0025',h1cKu3(0xf),',kR{?e"',h1cKu3(0x10),h1cKu3(0x11),']}V1;',h1cKu3(0x12),'\u0041\u005e\u0062\u0073\u0079\u0071\u003e\u0021\u0021\u006e\u0034','\x2a\x6b\x34\x31\x33\x7b\x72\x53','\u0071\u0029\u006d\u005a\u0023\u0055\u0060\u0060\u005b\u0056','\u0045\u0064\u004d\u004a\u006d\u003c\u0044\u004c\u0042',fxSzwp(-0x1),'\x72\x6c\x40\x2b',h1cKu3(fxSzwp(0x0)),'\x6a\x58\x6f\x49\x69\x61\x4c\x51\x52\x2e\x74\x39\x73\x72\x40\x5f\x72\x6d\x59\x3d\x75\x61\x4b\x3a\x71\x37\x69\x71\x76\x56\x3a\x43\x46\x72\x37\x21\x68\x65\x56\x38\x2c\x67\x5b\x57\x53',h1cKu3(fxSzwp(0x7e)),h1cKu3(fxSzwp(0x2b)),'\u005d\u0028\u007c\u0063\u0021\u005a\u0043\u003e\u0042',h1cKu3(fxSzwp(0x2c)),h1cKu3(0x17),'\u004d\u004b\u0056\u0029\u002a\u0061\u0021\u0068\u0058\u002f\u007c\u0034\u0072\u0044\u0039\u0035\u0044\u0055\u0048\u004f\u003d\u0061\u0079\u004e\u006b\u0032\u002a\u006b\u0025\u007b\u004e\u0036\u0047\u0044\u0032\u0075\u0064\u0071\u007b\u003f\u0053\u006a\u003c\u0067\u0069',fxSzwp
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.d