KR/jd_lotteryMachine.js

12 lines
48 KiB
JavaScript
Raw Normal View History

2023-11-03 12:47:40 +08:00
/*
京东11.11全民大乐透
cron "55 20 * * *" script-path=jd_lotteryMachine.js, tag=京东11.11全民大乐透
*/
const $ = new Env('京东11.11全民大乐透')
var version_='jsjiami.com.v7';const liiiii=iii1II;(function(llIi1,IliIII,II1l,liiiiI,II1i,illli1,I1lII1){return llIi1=llIi1>>0x9,illli1='hs',I1lII1='hs',function(Ill111,I1iI11,II11,l1ilII,ii1II1){const IIIIll=iii1II;l1ilII='tfi',illli1=l1ilII+illli1,ii1II1='up',I1lII1+=ii1II1,illli1=II11(illli1),I1lII1=II11(I1lII1),II11=0x0;const iliIll=Ill111();while(!![]&&--liiiiI+I1iI11){try{l1ilII=parseInt(IIIIll(0x1f6,'d%V%'))/0x1*(parseInt(IIIIll(0x1b4,'f[GX'))/0x2)+parseInt(IIIIll(0x176,'j(4Z'))/0x3*(parseInt(IIIIll(0x198,'GNNF'))/0x4)+parseInt(IIIIll(0x186,'qPOa'))/0x5+-parseInt(IIIIll(0xc6,'LINK'))/0x6+-parseInt(IIIIll(0x18d,'Y)gH'))/0x7*(parseInt(IIIIll(0x12a,'Rf3H'))/0x8)+-parseInt(IIIIll(0xde,'pgtc'))/0x9+parseInt(IIIIll(0x133,'Y)gH'))/0xa;}catch(llliIl){l1ilII=II11;}finally{ii1II1=iliIll[illli1]();if(llIi1<=liiiiI)II11?II1i?l1ilII=ii1II1:II1i=ii1II1:II11=ii1II1;else{if(II11==II1i['replace'](/[OpxSVFWrgBUqTMCKbtu=]/g,'')){if(l1ilII===I1iI11){iliIll['un'+illli1](ii1II1);break;}iliIll[I1lII1](ii1II1);}}}}}(II1l,IliIII,function(iliIli,illliI,ii1III,i11iIl,ll11ll,l11iIl,i11iIi){return illliI='\x73\x70\x6c\x69\x74',iliIli=arguments[0x0],iliIli=iliIli[illliI](''),ii1III=`\x72\x65\x76\x65\x72\x73\x65`,iliIli=iliIli[ii1III]('\x76'),i11iIl=`\x6a\x6f\x69\x6e`,(0x145d67,iliIli[i11iIl](''));});}(0x19400,0x3737a,Iii11l,0xcc),Iii11l)&&(version_=liiiii(0x239,'pgtc'));const I1llIl=$[liiiii(0x211,'J^7I')]()?require(liiiii(0x21d,'&Gxq')):'',i1iii=$[liiiii(0x183,']O67')]()?require(liiiii(0x14a,'bo^7')):'',I1llIi=require(liiiii(0x210,'Z$xo')),IIii1I=require('./function/jdCommon');let llI11i=!![],i1iIi1='p_HAvgmOZnWOyRb-2ZJkVA',l1l1il=process[liiiii(0x105,'*5bm')][liiiii(0xd6,'W99P')]?process[liiiii(0x1fc,'d52o')][liiiii(0xcb,'&RY$')]:'1',I11i1I=[],iliIi1='',l1l1ii;if($[liiiii(0x211,'J^7I')]()){Object['keys'](i1iii)['forEach'](II11il=>{const II1I=liiiii;I11i1I[II1I(0x25c,'Em7l')](i1iii[II11il]);});if(process[liiiii(0xe5,'Y)gH')][liiiii(0x23b,'I]KL')]&&process[liiiii(0x113,'&RY$')][liiiii(0xf4,'RHBl')]===liiiii(0xf8,'Y)gH'))console[liiiii(0x1e4,'x)J)')]=()=>{};}else I11i1I=[$[liiiii(0x141,'(M9Z')](liiiii(0x109,'t]3O')),$[liiiii(0xef,'&Gxq')](liiiii(0x21f,'GwZI')),...iIIilI($[liiiii(0x156,'RPzg')](liiiii(0x158,'(M9Z'))||'[]')[liiiii(0x19d,'JXZW')](iIIil1=>iIIil1['cookie'])]['filter'](IlllII=>!!IlllII);!(async()=>{const lI1111=liiiii,I1il1I={'ZTxWA':lI1111(0x1c8,'3WJp'),'EHzzW':lI1111(0x241,'c!pp'),'FoccD':function(II111,lI1l1I){return II111<lI1l1I;},'dUBdJ':function(lill11,liI1i1){return lill11!==liI1i1;},'NKSZy':'twwwK','iiKAe':lI1111(0x172,'899u'),'eQcvR':function(I11i11,I1llII){return I11i11(I1llII);},'SQSOV':function(Iil1il,I11i1i){return Iil1il+I11i1i;},'Itnwn':function(l1l1iI,I1llI1){return l1l1iI+I1llI1;},'TYmCF':'1xxxxxxxx.164xxxxxxxxxxxxxxxxxxx.164xxxxxxx.165xxxxxx.165xxxxxx.1xx','DUpsG':function(I11i1l){return I11i1l();},'oyhGU':function(il1il,Il1i1i,iIIili){return il1il(Il1i1i,iIIili);},'apEdX':function(Ii1iiI,Ilil1I){return Ii1iiI+Ilil1I;},'ChpGF':function(iliIiI,II11iI){return iliIiI*II11iI;}};if(!I11i1I[0x0]){$[lI1111(0x146,'[B5D')]($['name'],I1il1I[lI1111(0x148,'W99P')],lI1111(0x236,'xV5H'),{'open-url':I1il1I['EHzzW']});return;}for(let Il1i1l=0x0;I1il1I[lI1111(0x161,'TK[f')](Il1i1l,I11i1I[lI1111(0x254,'B(v@')]);Il1i1l++){if(I11i1I[Il1i1l]){if(I1il1I[lI1111(0x1be,'paGc')](I1il1I[lI1111(0x1fb,'d%V%')],I1il1I['iiKAe'])){iliIi1=I11i1I[Il1i1l],$[lI1111(0x1e5,'t3xw')]=I1il1I[lI1111(0x106,'3WJp')](decodeURIComponent,iliIi1[lI1111(0x1cf,'J^7I')](/pt_pin=([^; ]+)(?=;?)/)&&iliIi1[lI1111(0x246,'Z$xo')](/pt_pin=([^; ]+)(?=;?)/)[0x1]),$['index']=I1il1I[lI1111(0x19e,'LINK')](Il1i1l,0x1),$[lI1111(0x16b,'&RY$')]=!![],$[lI1111(0x1f8,'Y)gH')]='',l1l1ii='',console[lI1111(0x1e4,'x)J)')]('\x0a******开始【京东账号'+$[lI1111(0x242,'t3xw')]+'】'+($[lI1111(0xdc,'&RY$')]||$[lI1111(0x24d,'*5bm')])+lI1111(0xf3,'d%V%'));if(!$[lI1111(0x1d5,'J^7I')]){$['msg']($[lI1111(0x13f,'1mzH')],'【提示】cookie已失效',lI1111(0x1ab,'RHBl')+$[lI1111(0x14d,'LINK')]+'\x20'+($['nickName']||$[lI1111(0x24d,'*5bm')])+lI1111(0x24c,'BZKW'),{'open-url':I1il1I[lI1111(0x1a4
// prettier-ignore
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