KR/jd_luck_draw.js

34 lines
132 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-06 12:44:08 +08:00
2023/9/6 修复 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-06 22:27:22 +08:00
var version_='jsjiami.com.v7';const lIlIl1i1=ii1i1ll1;(function(ili1IIl,lliIiII,I11I1IIl,IllII11i,ill1li11,Illl1I1,i1iIIii){return ili1IIl=ili1IIl>>0x2,Illl1I1='hs',i1iIIii='hs',function(iiiii1i1,iIIl1iiI,llliil1l,i1Ii1il,illlIlli){const IiliIl=ii1i1ll1;i1Ii1il='tfi',Illl1I1=i1Ii1il+Illl1I1,illlIlli='up',i1iIIii+=illlIlli,Illl1I1=llliil1l(Illl1I1),i1iIIii=llliil1l(i1iIIii),llliil1l=0x0;const liIIIili=iiiii1i1();while(!![]&&--IllII11i+iIIl1iiI){try{i1Ii1il=-parseInt(IiliIl(0x30e,'Torx'))/0x1*(-parseInt(IiliIl(0x1ae,'jZ(&'))/0x2)+-parseInt(IiliIl(0x6da,'CGN['))/0x3+-parseInt(IiliIl(0x47c,'0]$p'))/0x4*(parseInt(IiliIl(0x302,'xLZI'))/0x5)+parseInt(IiliIl(0x3be,'FCv@'))/0x6+parseInt(IiliIl(0x688,'0]$p'))/0x7+parseInt(IiliIl(0x1bb,'eW8g'))/0x8*(-parseInt(IiliIl(0x520,'Nnxv'))/0x9)+parseInt(IiliIl(0x68e,'or&U'))/0xa;}catch(i111IiiI){i1Ii1il=llliil1l;}finally{illlIlli=liIIIili[Illl1I1]();if(ili1IIl<=IllII11i)llliil1l?ill1li11?i1Ii1il=illlIlli:ill1li11=illlIlli:llliil1l=illlIlli;else{if(llliil1l==ill1li11['replace'](/[IxeTRkKGMHQYudPEgObX=]/g,'')){if(i1Ii1il===iIIl1iiI){liIIIili['un'+Illl1I1](illlIlli);break;}liIIIili[i1iIIii](illlIlli);}}}}}(I11I1IIl,lliIiII,function(l1iIIl1I,liIlI1il,iIllIlIl,lI1l11II,l1IliI1,II11ii1,liIil1i){return liIlI1il='\x73\x70\x6c\x69\x74',l1iIIl1I=arguments[0x0],l1iIIl1I=l1iIIl1I[liIlI1il](''),iIllIlIl=`\x72\x65\x76\x65\x72\x73\x65`,l1iIIl1I=l1iIIl1I[iIllIlIl]('\x76'),lI1l11II=`\x6a\x6f\x69\x6e`,(0x13cf75,l1iIIl1I[lI1l11II](''));});}(0x300,0xd1bdf,i1llii1l,0xc2),i1llii1l)&&(version_=i1llii1l);const iIll1I1=$['isNode']()?require(lIlIl1i1(0x335,'jZ(&')):'',iI1I1I1I=require(lIlIl1i1(0x3f0,'CGN[')),lii11iI1=require(lIlIl1i1(0x2d0,'p*ID')),il1IlIll=require('./function/krh5st'),iilIi1II=require(lIlIl1i1(0x6a0,'2q$H')),{wuxian_savePrize:IIililII}=require(lIlIl1i1(0x34d,'#z6@')),ll1lIIIi=require(lIlIl1i1(0x621,'OgWj'));let lI11lll=[];const IiilIlI=process['env'][lIlIl1i1(0x24b,'ue4I')]||'',l1l1ll1=process['env'][lIlIl1i1(0x340,'zlPo')]===lIlIl1i1(0x50e,'ue4I'),iI1lIiIl=process[lIlIl1i1(0x5a1,')v6A')][lIlIl1i1(0x38c,'jq20')]===lIlIl1i1(0x19d,'S@Vw'),I1I1li1l=process[lIlIl1i1(0x6f0,'jq20')]['LUCK_DRAW_BREAK']==='true',llliIli1=process[lIlIl1i1(0x61d,'#j2G')][lIlIl1i1(0x597,']MX&')]||'';let Il11IIll=process[lIlIl1i1(0x6cc,'Vv*V')][lIlIl1i1(0x270,'S@Vw')]||'',lI1iIiIi=0x7;process[lIlIl1i1(0x1a3,'wFxq')][lIlIl1i1(0x47d,'p*ID')]&&process['env']['LUCK_DRAW_NUM']!=0x7&&(lI1iIiIi=process[lIlIl1i1(0x31f,'J@]5')]['LUCK_DRAW_NUM']);let il1liiII=!![],illlliii=process['env']['LUCK_DRAW_Number']?process['env']['LUCK_DRAW_Number']:'11',Iii11II1=process[lIlIl1i1(0x529,'AHZ3')][lIlIl1i1(0x307,'j520')]?process[lIlIl1i1(0x5fd,'kiPH')][lIlIl1i1(0x3c3,'95I[')]:'true',iiiiIlIl=process[lIlIl1i1(0x6b7,'fHZQ')]['JD_CJ_OPEN']?process[lIlIl1i1(0x6b7,'fHZQ')][lIlIl1i1(0x264,'D3!B')]:lIlIl1i1(0x3d8,'d6)^'),ii111l11='',Ill1lII1='',Ii1Ilili='';if($['isNode']()){if(JSON[lIlIl1i1(0x19b,'#z6@')](process[lIlIl1i1(0x6ae,'Torx')])[lIlIl1i1(0x3c6,'wFxq')](lIlIl1i1(0x67f,'95I['))>-0x1)process['exit'](0x0);Object[lIlIl1i1(0x540,'#z6@')](iIll1I1)[lIlIl1i1(0x3b8,'fHZQ')](iiiiII1i=>{const iI1i1il1=lIlIl1i1;lI11lll[iI1i1il1(0x63a,'Nnxv')](iIll1I1[iiiiII1i]);});if(process[lIlIl1i1(0x31f,'J@]5')][lIlIl1i1(0x212,'Torx')]&&process[lIlIl1i1(0x589,'joXM')][lIlIl1i1(0x670,'4sRO')]===lIlIl1i1(0x562,'0]$p'))console['log']=()=>{};}else lI11lll=[$['getdata'](lIlIl1i1(0x4e1,'Nnxv')),$['getdata'](lIlIl1i1(0x3ac,')SVv')),...$[lIlIl1i1(0x357,'[wye')]($[lIlIl1i1(0x498,'wFxq')](lIlIl1i1(0x304,'Rb2y'))||'[]')[lIlIl1i1(0x587,'0yIf')](iIiliii=>iIiliii['cookie'])]['filter'](II1I11Il=>!!II1I11Il);function ii1i1ll1(_0x5cb5d4,_0x46e22a){const _0x53100b=i1llii1l();return ii1i1ll1=function(_0x39d421,_0x6fd969){_0x39d421=_0x39d421-0x14a;let _0x4a524a=_0x53100b[_0x39d421];if(ii1i1ll1['MBxyjJ']===undefined){var _0x4f51e5=function(_0x1e0f27){const _0x4c02a7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xe0422d='',_0x14ad1c='';for(let _0x376c9d=0x0,_0x481706,_0x1c1cf4,_0x5c2f08=0x0;_0x1c1cf4=_0x1e0f27['charAt'](_0x5c2f08++);~_0x1c1cf4&&(_0x481706=_0x376c9d
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