KR/jd_luck_draw.js

34 lines
130 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秒
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-09-08 09:15:50 +08:00
2023/9/8 修复 500错误 修复黑名单无效
2023-07-27 16:14:01 +08:00
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
2023-09-03 17:41:54 +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-09-08 09:15:50 +08:00
var version_='jsjiami.com.v7';const iIIill1l=llll11I1;(function(iIl1IiII,IlIillI,Iii1IIi1,IlI11iIi,l1Il111I,IIIi1lll,i1Il11ll){return iIl1IiII=iIl1IiII>>0x5,IIIi1lll='hs',i1Il11ll='hs',function(i1llliIi,I1I1l1lI,IIIII1lI,i1I11lIi,IliIiiI1){const ii11l1li=llll11I1;i1I11lIi='tfi',IIIi1lll=i1I11lIi+IIIi1lll,IliIiiI1='up',i1Il11ll+=IliIiiI1,IIIi1lll=IIIII1lI(IIIi1lll),i1Il11ll=IIIII1lI(i1Il11ll),IIIII1lI=0x0;const I1ii1IIl=i1llliIi();while(!![]&&--IlI11iIi+I1I1l1lI){try{i1I11lIi=-parseInt(ii11l1li(0x5cb,'1kHx'))/0x1+parseInt(ii11l1li(0x34d,'*vmF'))/0x2*(parseInt(ii11l1li(0x315,'bg5q'))/0x3)+parseInt(ii11l1li(0x6f3,'*vmF'))/0x4*(-parseInt(ii11l1li(0x50c,'gBp9'))/0x5)+-parseInt(ii11l1li(0x37f,'LT2w'))/0x6*(parseInt(ii11l1li(0x739,'*hWk'))/0x7)+parseInt(ii11l1li(0x466,'1kHx'))/0x8+parseInt(ii11l1li(0x2e9,'7Y@*'))/0x9*(parseInt(ii11l1li(0x428,'Ks^8'))/0xa)+-parseInt(ii11l1li(0x4a6,'zsfV'))/0xb*(parseInt(ii11l1li(0x363,'M8[t'))/0xc);}catch(l1l1iliI){i1I11lIi=IIIII1lI;}finally{IliIiiI1=I1ii1IIl[IIIi1lll]();if(iIl1IiII<=IlI11iIi)IIIII1lI?l1Il111I?i1I11lIi=IliIiiI1:l1Il111I=IliIiiI1:IIIII1lI=IliIiiI1;else{if(IIIII1lI==l1Il111I['replace'](/[tAFLMdPKDEhHrwnGOqS=]/g,'')){if(i1I11lIi===I1I1l1lI){I1ii1IIl['un'+IIIi1lll](IliIiiI1);break;}I1ii1IIl[i1Il11ll](IliIiiI1);}}}}}(Iii1IIi1,IlIillI,function(liiII1ii,I11IlI,i11iI1Il,llI1Ii1,ii1lI1ii,II1ii1Ii,llii1lII){return I11IlI='\x73\x70\x6c\x69\x74',liiII1ii=arguments[0x0],liiII1ii=liiII1ii[I11IlI](''),i11iI1Il=`\x72\x65\x76\x65\x72\x73\x65`,liiII1ii=liiII1ii[i11iI1Il]('\x76'),llI1Ii1=`\x6a\x6f\x69\x6e`,(0x13d27c,liiII1ii[llI1Ii1](''));});}(0x17c0,0x2f693,I1lIiIiI,0xc0),I1lIiIiI)&&(version_=I1lIiIiI);const lII11I1I=$['isNode']()?require(iIIill1l(0x59d,'M8[t')):'',liil1lI1=require(iIIill1l(0x225,'*hWk')),II1I111I=require('./function/sendJDNotify'),IlIIiili=require('./function/krh5st'),llIIiilI=require('./function/krgetToken'),{wuxian_savePrize:Ii1IIiil}=require('./function/krsavePrize'),I1I1IilI=require(iIIill1l(0x4ad,'gy(L'));let Iii11i1i=[];const iliiI1i1=process[iIIill1l(0x587,'DVOP')][iIIill1l(0x3e5,'gy(L')]||'',II1IIl1l=process[iIIill1l(0x4f1,'2J!O')]['LUCK_DRAW_OPENCARD']===iIIill1l(0x4fd,'Ibns'),Il1i1IiI=process[iIIill1l(0x650,'iC(U')]['LUCK_DRAW_NOTIFY']==='true',iiII1il1=process['env'][iIIill1l(0x2e7,'Ks^8')]==='true',ll1l1il=process[iIIill1l(0x502,'LT2w')][iIIill1l(0x481,'8Ibg')]||'';let liliIiIi=process[iIIill1l(0x600,'M8[t')][iIIill1l(0x63f,'VAaB')]||'',I11i111I=0x7;process[iIIill1l(0x523,'Wln7')][iIIill1l(0x57d,'5kYx')]&&process['env'][iIIill1l(0x65a,'7Y@*')]!=0x7&&(I11i111I=process['env'][iIIill1l(0x37d,'^hR%')]);let Ii1liiII=!![],lIIl1III=process[iIIill1l(0x596,'gy(L')]['LUCK_DRAW_Number']?process[iIIill1l(0x523,'Wln7')][iIIill1l(0x6e6,'5kYx')]:'11',IiII1lI1=process[iIIill1l(0x600,'M8[t')]['JD_LZ_OPEN']?process[iIIill1l(0x56a,'zsfV')]['JD_LZ_OPEN']:'true',il11IIli=process['env'][iIIill1l(0x521,'p$nx')]?process[iIIill1l(0x2ea,'!7h2')]['JD_CJ_OPEN']:'true',IIilIIi1='',Iil1liIl='',iiIilili='';if($[iIIill1l(0x2b1,'^#XW')]()){if(JSON[iIIill1l(0x5fc,'MwMC')](process[iIIill1l(0x5a1,'BrSQ')])[iIIill1l(0x6d2,'JYEt')]('GITHUB')>-0x1)process[iIIill1l(0x555,'N&]E')](0x0);Object['keys'](lII11I1I)['forEach'](iiIllIii=>{const IlilI1Ii=iIIill1l;Iii11i1i[IlilI1Ii(0x350,'zsfV')](lII11I1I[iiIllIii]);});if(process['env']['JD_DEBUG']&&process[iIIill1l(0x4d2,'TzZx')][iIIill1l(0x629,'YYvi')]===iIIill1l(0x2d8,'jgfj'))console[iIIill1l(0x6fc,'1K]Q')]=()=>{};}else Iii11i1i=[$['getdata'](iIIill1l(0x415,'8Ibg')),$[iIIill1l(0x5e3,'wMae')](iIIill1l(0x408,'!7h2')),...$[iIIill1l(0x689,'1K]Q')]($[iIIill1l(0x29b,'TzZx')](iIIill1l(0x70a,'[D7K'))||'[]')['map'](IiiIllii=>IiiIllii[iIIill1l(0x5ff,'Wln7')])][iIIill1l(0x73d,'BrSQ')](lIllI1I=>!!lIllI1I);!Iii11i1i[0x0]&&($['msg']($['name'],'【提示】请先获取Cookie'),process['exit'](0x1));let IiI111Ii='',Iil1iIll='';$['whitelist']=process[iIIill1l(0x277,'8E[G')][iIIill1l(0x4f2,'LT2w')]||IiI111Ii,$[iIIill1l(0x5a0,'^hR%')]=process[iIIill1l(0x70f,'VAaB')]['LUCK_DRAW_BLACKLIST']||Iil1iIll,liliIili(),iIiIiIil(),!(async()=>{const i1lii1I1=iIIill1l,I1I11iil={'tcCzn':functio
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