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-27 09:30:31 +08:00
var version_='jsjiami.com.v7';const i11IiIIl=l1lI1lIl;(function(iI1IIl1i,lilIIi1l,i1IiI1i1,IIIIiilI,lii1Ili1,ii1iii1,l1iilIII){return iI1IIl1i=iI1IIl1i>>0x2,ii1iii1='hs',l1iilIII='hs',function(Il1liliI,iIII1li,liIiIii,iII1IiIl,Ii1iIill){const ll1i1I11=l1lI1lIl;iII1IiIl='tfi',ii1iii1=iII1IiIl+ii1iii1,Ii1iIill='up',l1iilIII+=Ii1iIill,ii1iii1=liIiIii(ii1iii1),l1iilIII=liIiIii(l1iilIII),liIiIii=0x0;const iIiiilll=Il1liliI();while(!![]&&--IIIIiilI+iIII1li){try{iII1IiIl=-parseInt(ll1i1I11(0x6ff,'0zj5'))/0x1+parseInt(ll1i1I11(0x2ba,'zEpb'))/0x2+-parseInt(ll1i1I11(0x1de,'e*B@'))/0x3+-parseInt(ll1i1I11(0x47b,'N*ex'))/0x4+-parseInt(ll1i1I11(0x417,'JGs4'))/0x5+-parseInt(ll1i1I11(0x2d3,'79[!'))/0x6*(parseInt(ll1i1I11(0x659,'Sy0]'))/0x7)+parseInt(ll1i1I11(0x30e,'@Ros'))/0x8*(parseInt(ll1i1I11(0x573,'pOIP'))/0x9);}catch(II1Ii11i){iII1IiIl=liIiIii;}finally{Ii1iIill=iIiiilll[ii1iii1]();if(iI1IIl1i<=IIIIiilI)liIiIii?lii1Ili1?iII1IiIl=Ii1iIill:lii1Ili1=Ii1iIill:liIiIii=Ii1iIill;else{if(liIiIii==lii1Ili1['replace'](/[qhHwCXLtlWNJbBfrxSd=]/g,'')){if(iII1IiIl===iIII1li){iIiiilll['un'+ii1iii1](Ii1iIill);break;}iIiiilll[l1iilIII](Ii1iIill);}}}}}(i1IiI1i1,lilIIi1l,function(l11iil1,lll1IiI,IIIIIIil,lil11iiI,lIill1II,I1Iillil,i1lIilI){return lll1IiI='\x73\x70\x6c\x69\x74',l11iil1=arguments[0x0],l11iil1=l11iil1[lll1IiI](''),IIIIIIil=`\x72\x65\x76\x65\x72\x73\x65`,l11iil1=l11iil1[IIIIIIil]('\x76'),lil11iiI=`\x6a\x6f\x69\x6e`,(0x1401fc,l11iil1[lil11iiI](''));});}(0x2f0,0xa4255,lIii11l,0xbe),lIii11l)&&(version_=lIii11l);const lI11111=$['isNode']()?require(i11IiIIl(0x5d3,'e*B@')):'',iIl1iIII=require(i11IiIIl(0x353,'WZjq')),IIl11l1=require(i11IiIIl(0x378,'kFD#')),liII1ii1=require(i11IiIIl(0x240,'^)$P')),iII1lIiI=require(i11IiIIl(0x6b5,'@7MR')),{wuxian_savePrize:li111Iil}=require('./function/krsavePrize'),ii1i11=require('crypto-js');let li11IiI1=[];const iiII1il=process[i11IiIIl(0x3ec,'DGAc')]['LUCK_DRAW_URL']||'',i1l1IiIi=process['env'][i11IiIIl(0x267,'GLmT')]==='true',liIl1iii=process['env'][i11IiIIl(0x379,'kFD#')]==='true',li11iliI=process['env'][i11IiIIl(0x1f1,'pOIP')]===i11IiIIl(0x541,'Ql#i'),I1llIIII=process[i11IiIIl(0x2b8,'rwyG')][i11IiIIl(0x464,'0zj5')]||'';let ili1iii1=process[i11IiIIl(0x372,'Sy0]')][i11IiIIl(0x1ae,'ux6&')]||'',lI11lI1i=0x7;process[i11IiIIl(0x617,'R4Ze')]['LUCK_DRAW_NUM']&&process[i11IiIIl(0x5b3,'7miv')][i11IiIIl(0x278,'JGs4')]!=0x7&&(lI11lI1i=process['env'][i11IiIIl(0x4e2,'i6!)')]);let IlIIIli1=!![],i1i1I1li=process[i11IiIIl(0x6d7,'L)vP')]['LUCK_DRAW_Number']?process[i11IiIIl(0x305,'Lcz5')][i11IiIIl(0x4f6,'#2]K')]:'11',Il11lI1=process[i11IiIIl(0x1db,'0zj5')]['JD_LZ_OPEN']?process[i11IiIIl(0x1db,'0zj5')]['JD_LZ_OPEN']:i11IiIIl(0x1b4,'kFD#'),IIi1ili1=process[i11IiIIl(0x5d5,'gsGm')][i11IiIIl(0x57c,'yDYt')]?process[i11IiIIl(0x4d3,'h%BR')][i11IiIIl(0x476,'pOIP')]:i11IiIIl(0x42e,'yDYt'),I1Il1lIi='',l1Iiliil='',IllI1i1l='';if($['isNode']()){if(JSON['stringify'](process[i11IiIIl(0x174,'JGs4')])['indexOf'](i11IiIIl(0x41c,'qIcr'))>-0x1)process[i11IiIIl(0x6f7,'7miv')](0x0);Object[i11IiIIl(0x208,'pOIP')](lI11111)[i11IiIIl(0x17a,'k#7I')](I1II11ll=>{const liliiIIi=i11IiIIl;li11IiI1[liliiIIi(0x5f5,'Ql#i')](lI11111[I1II11ll]);});if(process[i11IiIIl(0x305,'Lcz5')][i11IiIIl(0x2d4,'l#O0')]&&process[i11IiIIl(0x409,'e*B@')][i11IiIIl(0x1ed,'qIcr')]==='false')console[i11IiIIl(0x45f,'l#O0')]=()=>{};}else li11IiI1=[$['getdata'](i11IiIIl(0x6b7,'5qjV')),$[i11IiIIl(0x18f,'gsGm')]('CookieJD2'),...$[i11IiIIl(0x209,'6F[i')]($[i11IiIIl(0x646,'aZHA')](i11IiIIl(0x200,'#XFQ'))||'[]')[i11IiIIl(0x1df,'L)vP')](lI1iIl11=>lI1iIl11[i11IiIIl(0x37a,'i6!)')])][i11IiIIl(0x30b,'@Ros')](i11i11II=>!!i11i11II);!li11IiI1[0x0]&&($['msg']($[i11IiIIl(0x5fc,'kFD#')],i11IiIIl(0x2a4,'e*B@')),process['exit'](0x1));let i1i1II='',ili1lIlI='';$[i11IiIIl(0x692,'Ql#i')]=process[i11IiIIl(0x174,'JGs4')][i11IiIIl(0x2b2,'zElq')]||i1i1II,$['blacklist']=process[i11IiIIl(0x1c6,'zEpb')][i11IiIIl(0x6dd,'zEpb')]||ili1lIlI,IilIilI1(),IIlillll(),!(async()=>{const lIiii11=i11IiIIl,liil1ll1={'YDfCz':lIiii11(0x31c,'R2$X'),'HwSrB':lIiii11(0x6b6,'gsGm'),'bTNua':lIiii11(0x670,'qIcr'),'AFOaT':function(lIi
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