KR/jd_luck_draw.js

36 lines
181 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
2023-09-03 02:07:30 +08:00
活动名称店铺抽奖 · 超级无线/超级会员
活动链接https://lzkj-isv.isvjd.com/lzclient/<活动id>/cjwx/common/entry.html?activityId=<活动id>&gameType=<玩法类型>
https://lzkj-isv.isvjd.com/wxDrawActivity/activity/activity?activityId=<活动id>
2023-07-27 16:14:01 +08:00
https://cjhy-isv.isvjcloud.com/wxDrawActivity/activity/activity?activityId=<活动id>
环境变量LUCK_DRAW_URL // 活动链接
2023-09-03 02:07:30 +08:00
LUCK_DRAW_NOTIFY // 是否推送通知true/false默认不推送
LUCK_DRAW_OPENCARD // 是否入会true/false默认不入会
2023-09-03 17:41:54 +08:00
LUCK_DRAW_BREAK // 493后继续执行默认退出运行true/false
2023-09-03 02:07:30 +08:00
LUCK_DRAW_INTERVAL // 自定义抽奖间隔正整数默认1秒
2023-10-29 10:39:53 +08:00
LUCK_DRAW_CONC // 是否启用并发模式true/false默认不开启
LUCK_DRAW_CONC_THREADS // 控制并发线程数正整数默认3
2023-09-03 02:07:30 +08:00
LUCK_DRAW_MAX_MISS // 最大连续未抽中次数(正整数),达到此次数后会跳过运行对应账号,默认不启用此功能
LUCK_DRAW_NUM //运行账号数量默认运行前7
LUCK_DRAW_Number // 连续无次数跳出,默认 7 次,火爆账号请设置黑名单,否则也会占用次数
2023-07-27 16:14:01 +08:00
LUCK_DRAW_BLACKLIST 黑名单 &隔开 pin值
2023-09-03 02:36:30 +08:00
JD_LZ_OPEN // 是否开启LZ活动运行true/false默认运行
JD_CJ_OPEN // 是否开启CJ活动运行true/false默认运行
2023-07-27 16:14:01 +08:00
2023-09-03 10:16:18 +08:00
只有在没有抽奖次数的情况下才会去做任务获取部分活动涉及定制接口会导致请求响应非法操作
2023-07-27 16:14:01 +08:00
2023-10-29 10:39:53 +08:00
2023/9/6 修复 500错误 修复黑名单无效
2023-07-27 16:14:01 +08:00
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
2023-10-29 10:39:53 +08:00
#店铺抽奖通用活动-加密
1 1 1 1 * jd_luck_draw.js, tag=店铺抽奖通用活动-加密, enabled=true
2023-07-27 16:14:01 +08:00
2023-09-03 02:07:30 +08:00
*/
2023-07-27 16:14:01 +08:00
2023-09-03 02:07:30 +08:00
const $ = new Env('店铺抽奖(超级无线/超级会员)');
2023-10-29 10:39:53 +08:00
var version_='jsjiami.com.v7';const lI1ili=i1iIIlIl;(function(iIIl1,iIl1llil,iIIliIIi,lIiIiiIi,ll11lIii,iliIilll,I1iiiiIi){return iIIl1=iIIl1>>0x3,iliIilll='hs',I1iiiiIi='hs',function(I1I11IIi,IlI1lll,i11IiIl1,lIIlIli,Iil1III){const IIl1iIIi=i1iIIlIl;lIIlIli='tfi',iliIilll=lIIlIli+iliIilll,Iil1III='up',I1iiiiIi+=Iil1III,iliIilll=i11IiIl1(iliIilll),I1iiiiIi=i11IiIl1(I1iiiiIi),i11IiIl1=0x0;const liI1I111=I1I11IIi();while(!![]&&--lIiIiiIi+IlI1lll){try{lIIlIli=-parseInt(IIl1iIIi(0x493,'OJjq'))/0x1+parseInt(IIl1iIIi(0x134,'y99#'))/0x2+parseInt(IIl1iIIi(0x70e,'qh#b'))/0x3+-parseInt(IIl1iIIi(0x1d8,'#*dZ'))/0x4+-parseInt(IIl1iIIi(0x3bc,'fr4['))/0x5*(parseInt(IIl1iIIi(0x81b,'vMvY'))/0x6)+-parseInt(IIl1iIIi(0x4ab,'fr4['))/0x7*(-parseInt(IIl1iIIi(0x1d6,'T83j'))/0x8)+-parseInt(IIl1iIIi(0x858,'D[[m'))/0x9*(-parseInt(IIl1iIIi(0x2dd,'sF]B'))/0xa);}catch(Iil111Ii){lIIlIli=i11IiIl1;}finally{Iil1III=liI1I111[iliIilll]();if(iIIl1<=lIiIiiIi)i11IiIl1?ll11lIii?lIIlIli=Iil1III:ll11lIii=Iil1III:i11IiIl1=Iil1III;else{if(i11IiIl1==ll11lIii['replace'](/[MLFUWStAKkdTqCxIYVg=]/g,'')){if(lIIlIli===IlI1lll){liI1I111['un'+iliIilll](Iil1III);break;}liI1I111[I1iiiiIi](Iil1III);}}}}}(iIIliIIi,iIl1llil,function(iIlIIIl1,iiIiiIil,ii1Il1l,IIIII1il,iiI1IllI,lli1llI1,llllII1){return iiIiiIil='\x73\x70\x6c\x69\x74',iIlIIIl1=arguments[0x0],iIlIIIl1=iIlIIIl1[iiIiiIil](''),ii1Il1l=`\x72\x65\x76\x65\x72\x73\x65`,iIlIIIl1=iIlIIIl1[ii1Il1l]('\x76'),IIIII1il=`\x6a\x6f\x69\x6e`,(0x144ea5,iIlIIIl1[IIIII1il](''));});}(0x668,0x3d19f,illllI11,0xcf),illllI11)&&(version_=lI1ili(0x2aa,'#*dZ'));const Ii1IlI1l=$[lI1ili(0x2b1,'leHY')]()?require(lI1ili(0x40a,'H9oK')):'',i111Iii1=require(lI1ili(0x831,'OJjq')),ii1Ill1i=require(lI1ili(0x16c,'(TzR')),liiIIII1=require(lI1ili(0x60c,'7s*m')),{wuxian_savePrize:l1IiIl}=require(lI1ili(0x781,'CzdY')),iiliIi11=require(lI1ili(0x652,'CzdY'));let l1lillii=[];const iIiIlIIi=process[lI1ili(0x605,'8CKZ')][lI1ili(0x1c8,'H@HX')]||'',I1liI1Il=process[lI1ili(0x8ad,'GtFZ')][lI1ili(0x58e,'wqY4')]===lI1ili(0x5b3,'vMvY'),IilIIIl1=process['env'][lI1ili(0x4d9,'@@0O')]===lI1ili(0x2a5,'0TIt'),ilI1ii1I=process[lI1ili(0x5fb,']W(5')][lI1ili(0x88b,'CzdY')]===lI1ili(0x507,'7Xs5'),IIi1Iiil=process['env']['LUCK_DRAW_CONC']===lI1ili(0x112,'(TzR'),i1IiiiIl=process[lI1ili(0x635,'y99#')]['LUCK_DRAW_CONC_THREADS']||'3',lI1il1ii=process[lI1ili(0x469,'qh#b')]['LUCK_DRAW_INTERVAL']||'';let ll1IIiIi=process['env'][lI1ili(0x44b,'Xh@s')]||'',Il1li1i1=0x7;process['env'][lI1ili(0x297,'B@5C')]&&process[lI1ili(0x481,'H@HX')][lI1ili(0x3d5,'%LAe')]!=0x7&&(Il1li1i1=process['env']['LUCK_DRAW_NUM']);let lIiIIilI=!![],I11lllii=process['env'][lI1ili(0x15f,'cO4$')]?process[lI1ili(0x1b2,'sF]B')][lI1ili(0x625,'H@HX')]:'11',lIIiI1II=process[lI1ili(0x330,'5860')][lI1ili(0x644,'H9oK')]?process[lI1ili(0x513,'leHY')][lI1ili(0x73c,'B@5C')]:lI1ili(0x692,'@@0O'),ill1lIll=process[lI1ili(0x5fb,']W(5')][lI1ili(0x31c,'GtFZ')]?process[lI1ili(0x42e,']zN]')][lI1ili(0x31c,'GtFZ')]:lI1ili(0x4ac,'Xh@s'),iIi1IIil='',iiIIll1l='',li11l='';if($[lI1ili(0x2a1,'qh#b')]()){if(JSON[lI1ili(0x687,'$k#n')](process[lI1ili(0x513,'leHY')])[lI1ili(0x13c,'cO4$')](lI1ili(0x2e9,'leHY'))>-0x1)process[lI1ili(0x577,'u0Hh')](0x0);Object[lI1ili(0x306,'(TzR')](Ii1IlI1l)[lI1ili(0x144,'T83j')](l1iIl1=>{l1lillii['push'](Ii1IlI1l[l1iIl1]);});if(process[lI1ili(0x247,'(TzR')][lI1ili(0x875,'G!*J')]&&process['env'][lI1ili(0x4de,']W(5')]===lI1ili(0x7b2,'Xh@s'))console['log']=()=>{};}else l1lillii=[$[lI1ili(0x30d,'%LAe')](lI1ili(0x547,'%LAe')),$['getdata']('CookieJD2'),...$[lI1ili(0x298,'5860')]($[lI1ili(0x65f,'@Q7O')](lI1ili(0x407,'#*dZ'))||'[]')['map'](IIiI11li=>IIiI11li[lI1ili(0x217,'H@HX')])][lI1ili(0x366,'sF]B')](iiII1Iil=>!!iiII1Iil);!l1lillii[0x0]&&($[lI1ili(0x49c,'7s*m')]($[lI1ili(0x5a8,'(TzR')],lI1ili(0x8af,'pHkP')),process['exit'](0x1));let Iilliiil='',Ii1ii1='';$[lI1ili(0x1d0,'9]kF')]=process[lI1ili(0x4dd,'eSiG')][lI1ili(0x658,'B@5C')]||Iilliiil,$['blacklist']=process[lI1ili(0x87e,'@Q7O')][lI1ili(0x620,'yxiu')]||Ii1ii1,llilill1(),Ii111ll1(),!(async()=>{const lIiil1i1=lI1ili,iIllii1l={'VNqPv':function(illiIlIl,illI11il){return illi
2023-07-27 16:14:01 +08:00
// prettier-ignore
2023-09-03 02:07:30 +08:00
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