KR/jd_luck_draw.js

34 lines
133 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-10-27 00:33:44 +08:00
var version_='jsjiami.com.v7';function iil1l1l(_0x2bb4c7,_0x5356cf){const _0x598f8a=IlII1li();return iil1l1l=function(_0xd1b9f7,_0x1e2d7b){_0xd1b9f7=_0xd1b9f7-0x19a;let _0x2c3516=_0x598f8a[_0xd1b9f7];if(iil1l1l['ILHDnU']===undefined){var _0x5e5206=function(_0x5d099c){const _0x1c365f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4c6182='',_0x555300='';for(let _0x57ad9c=0x0,_0x1ccbf8,_0x27dcf6,_0x571c95=0x0;_0x27dcf6=_0x5d099c['charAt'](_0x571c95++);~_0x27dcf6&&(_0x1ccbf8=_0x57ad9c%0x4?_0x1ccbf8*0x40+_0x27dcf6:_0x27dcf6,_0x57ad9c++%0x4)?_0x4c6182+=String['fromCharCode'](0xff&_0x1ccbf8>>(-0x2*_0x57ad9c&0x6)):0x0){_0x27dcf6=_0x1c365f['indexOf'](_0x27dcf6);}for(let _0x5db46f=0x0,_0x55b2f9=_0x4c6182['length'];_0x5db46f<_0x55b2f9;_0x5db46f++){_0x555300+='%'+('00'+_0x4c6182['charCodeAt'](_0x5db46f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x555300);};const _0x2a0e33=function(_0x371941,_0x2dd6b0){let _0x1e8f4f=[],_0x103819=0x0,_0x498c2e,_0x5891e9='';_0x371941=_0x5e5206(_0x371941);let _0x502163;for(_0x502163=0x0;_0x502163<0x100;_0x502163++){_0x1e8f4f[_0x502163]=_0x502163;}for(_0x502163=0x0;_0x502163<0x100;_0x502163++){_0x103819=(_0x103819+_0x1e8f4f[_0x502163]+_0x2dd6b0['charCodeAt'](_0x502163%_0x2dd6b0['length']))%0x100,_0x498c2e=_0x1e8f4f[_0x502163],_0x1e8f4f[_0x502163]=_0x1e8f4f[_0x103819],_0x1e8f4f[_0x103819]=_0x498c2e;}_0x502163=0x0,_0x103819=0x0;for(let _0x27e77d=0x0;_0x27e77d<_0x371941['length'];_0x27e77d++){_0x502163=(_0x502163+0x1)%0x100,_0x103819=(_0x103819+_0x1e8f4f[_0x502163])%0x100,_0x498c2e=_0x1e8f4f[_0x502163],_0x1e8f4f[_0x502163]=_0x1e8f4f[_0x103819],_0x1e8f4f[_0x103819]=_0x498c2e,_0x5891e9+=String['fromCharCode'](_0x371941['charCodeAt'](_0x27e77d)^_0x1e8f4f[(_0x1e8f4f[_0x502163]+_0x1e8f4f[_0x103819])%0x100]);}return _0x5891e9;};iil1l1l['eGTrGg']=_0x2a0e33,_0x2bb4c7=arguments,iil1l1l['ILHDnU']=!![];}const _0xb106db=_0x598f8a[0x0],_0x5211b4=_0xd1b9f7+_0xb106db,_0x1d89f5=_0x2bb4c7[_0x5211b4];return!_0x1d89f5?(iil1l1l['sVhGGG']===undefined&&(iil1l1l['sVhGGG']=!![]),_0x2c3516=iil1l1l['eGTrGg'](_0x2c3516,_0x1e2d7b),_0x2bb4c7[_0x5211b4]=_0x2c3516):_0x2c3516=_0x1d89f5,_0x2c3516;},iil1l1l(_0x2bb4c7,_0x5356cf);}const ii1I111l=iil1l1l;(function(lilIiiIi,Ill11li1,lI1I11lI,I1I1lil1,illli1i1,IiI11l1i,i1I1l11i){return lilIiiIi=lilIiiIi>>0x6,IiI11l1i='hs',i1I1l11i='hs',function(IIIlIil,il1Il11I,ilIIIlII,lil1i,lilll1II){const lIlliI=iil1l1l;lil1i='tfi',IiI11l1i=lil1i+IiI11l1i,lilll1II='up',i1I1l11i+=lilll1II,IiI11l1i=ilIIIlII(IiI11l1i),i1I1l11i=ilIIIlII(i1I1l11i),ilIIIlII=0x0;const I11li1li=IIIlIil();while(!![]&&--I1I1lil1+il1Il11I){try{lil1i=parseInt(lIlliI(0x412,'GeNR'))/0x1+-parseInt(lIlliI(0x25c,'kcBL'))/0x2+-parseInt(lIlliI(0x653,'Sk%v'))/0x3+-parseInt(lIlliI(0x31a,'L3)%'))/0x4*(parseInt(lIlliI(0x396,'C5cI'))/0x5)+-parseInt(lIlliI(0x6f0,'n56z'))/0x6*(parseInt(lIlliI(0x31e,'oqFk'))/0x7)+-parseInt(lIlliI(0x3a8,'5(A['))/0x8+parseInt(lIlliI(0x1c1,'5(A['))/0x9;}catch(IIiiilIi){lil1i=ilIIIlII;}finally{lilll1II=I11li1li[IiI11l1i]();if(lilIiiIi<=I1I1lil1)ilIIIlII?illli1i1?lil1i=lilll1II:illli1i1=lilll1II:ilIIIlII=lilll1II;else{if(ilIIIlII==illli1i1['replace'](/[ALNfdCxDbtOygBqPWHweh=]/g,'')){if(lil1i===il1Il11I){I11li1li['un'+IiI11l1i](lilll1II);break;}I11li1li[i1I1l11i](lilll1II);}}}}}(lI1I11lI,Ill11li1,function(i1l11i1l,i1lIIII,iil1il1,l11IIlI,llili11i,lIiil1II,IIIllIil){return i1lIIII='\x73\x70\x6c\x69\x74',i1l11i1l=arguments[0x0],i1l11i1l=i1l11i1l[i1lIIII](''),iil1il1=`\x72\x65\x76\x65\x72\x73\x65`,i1l11i1l=i1l11i1l[iil1il1]('\x76'),l11IIlI=`\x6a\x6f\x69\x6e`,(0x14499e,i1l11i1l[l11IIlI](''));});}(0x30c0,0xd3a27,IlII1li,0xc5),IlII1li)&&(version_=ii1I111l(0x5fd,'4w0k'));const i1iIl11l=$['isNode']()?require('./jdCookie'):'',i1Ii1ili=require(ii1I111l(0x343,'NNYS')),lIIilII1=require(ii1I111l(0x350,'V6#M')),lilII11i=require(ii1I111l(0x46a,'b8)*')),{wuxian_savePrize:illIlI11}=require(ii1I111l(0x2ad,'C5cI')),illi1III=require(ii1I111l(0x493,'YCuH'));let iiililIl=[];const i1l1111I=process[ii1I111l(0x518,'dP]W')][ii1I111l(0x68a,'ov%l')]||'',IiiliIIi=process[ii1I111l(0x518,'dP]W')][ii1I111l(0
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