mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
22 lines
60 KiB
JavaScript
22 lines
60 KiB
JavaScript
|
/*
|
|||
|
攒券赢大奖任务
|
|||
|
|
|||
|
cron "25 4,16 * * *" script-path=jd_zqydj.js, tag=攒券赢大奖任务
|
|||
|
|
|||
|
首页 右下角图标 赌运气,中奖会收到短信
|
|||
|
|
|||
|
一般是晚上 8点开奖
|
|||
|
|
|||
|
每期活动 id都会变动
|
|||
|
|
|||
|
远程数据随缘更新 所以需要玩的请自行抓取
|
|||
|
|
|||
|
变量:
|
|||
|
jd_zqydj_id // 格式为 PbB1EhPXQd8FpIo3tu_dhg@2273 2个参数用@链接
|
|||
|
|
|||
|
*/
|
|||
|
const $ = new Env('攒券赢大奖任务');
|
|||
|
var version_='jsjiami.com.v7';const illi11Il=ii111llI;(function(lllIIlIl,iIi11ili,IIlil1I,iI1ilIll,iIllIlIl,iilIllil,Iii11iIl){return lllIIlIl=lllIIlIl>>0x2,iilIllil='hs',Iii11iIl='hs',function(I1i11il1,l111IilI,IIIiIliI,IIiliIii,iIlli11I){const I1Iili=ii111llI;IIiliIii='tfi',iilIllil=IIiliIii+iilIllil,iIlli11I='up',Iii11iIl+=iIlli11I,iilIllil=IIIiIliI(iilIllil),Iii11iIl=IIIiIliI(Iii11iIl),IIIiIliI=0x0;const l11I11I1=I1i11il1();while(!![]&&--iI1ilIll+l111IilI){try{IIiliIii=-parseInt(I1Iili(0x104,'wYk*'))/0x1+parseInt(I1Iili(0x2a2,'2v!7'))/0x2*(-parseInt(I1Iili(0x1e9,'oP8t'))/0x3)+-parseInt(I1Iili(0x98,'@A9s'))/0x4+-parseInt(I1Iili(0xb4,'@A9s'))/0x5*(parseInt(I1Iili(0x16c,'6oqM'))/0x6)+-parseInt(I1Iili(0xca,'$8K1'))/0x7+-parseInt(I1Iili(0x134,'#Y!T'))/0x8+parseInt(I1Iili(0x113,'#Y!T'))/0x9;}catch(illl1II){IIiliIii=IIIiIliI;}finally{iIlli11I=l11I11I1[iilIllil]();if(lllIIlIl<=iI1ilIll)IIIiIliI?iIllIlIl?IIiliIii=iIlli11I:iIllIlIl=iIlli11I:IIIiIliI=iIlli11I;else{if(IIIiIliI==iIllIlIl['replace'](/[KWHUhAxwLVfPnGCkTSY=]/g,'')){if(IIiliIii===l111IilI){l11I11I1['un'+iilIllil](iIlli11I);break;}l11I11I1[Iii11iIl](iIlli11I);}}}}}(IIlil1I,iIi11ili,function(l1IlIl11,Ili11il,IiiiIIlI,I1IIliIi,l1llI,IIi1l,i1l1lI1I){return Ili11il='\x73\x70\x6c\x69\x74',l1IlIl11=arguments[0x0],l1IlIl11=l1IlIl11[Ili11il](''),IiiiIIlI=`\x72\x65\x76\x65\x72\x73\x65`,l1IlIl11=l1IlIl11[IiiiIIlI]('\x76'),I1IIliIi=`\x6a\x6f\x69\x6e`,(0x140847,l1IlIl11[I1IIliIi](''));});}(0x30c,0xa273a,iiiiiIIi,0xc5),iiiiiIIi)&&(version_=iiiiiIIi);const IIiiIlii=$['isNode']()?require(illi11Il(0x23f,'H$TR')):'',lIl1lII1=$[illi11Il(0x183,'6oqM')]()?require(illi11Il(0x116,'oP8t')):'',iiIl1iI1=require(illi11Il(0x246,'$8K1'));let iI1i1l1i=!![],li1ii1i=process[illi11Il(0xba,'I!eF')][illi11Il(0x17a,'NgGD')]?process['env']['jd_zqydj_id']:'',iiillIiI=Date[illi11Il(0x241,'4]da')](),lllI11iI=li1ii1i[illi11Il(0x199,'#Y!T')]('@');linkId=lllI11iI[0x0],taskId=lllI11iI[0x1];let I1I1llI=[],ll11IiIl='',ilil1iil;if($[illi11Il(0x121,'%cx3')]()){Object[illi11Il(0x1c5,'DRc(')](lIl1lII1)[illi11Il(0x143,'I!eF')](Iiii1IIi=>{const llIIlll=illi11Il;I1I1llI[llIIlll(0xc8,'4]da')](lIl1lII1[Iiii1IIi]);});if(process['env'][illi11Il(0xde,'Jsw%')]&&process[illi11Il(0x14f,'@A9s')][illi11Il(0x1a2,'$8K1')]===illi11Il(0x263,'t5YQ'))console['log']=()=>{};}else I1I1llI=[$[illi11Il(0xac,'t5YQ')]('CookieJD'),$[illi11Il(0x29b,'k@qU')]('CookieJD2'),...l1li11il($['getdata'](illi11Il(0x1fa,'tZP#'))||'[]')['map'](I1iiIlIl=>I1iiIlIl['cookie'])][illi11Il(0x150,'jDQC')](IIi1l1l1=>!!IIi1l1l1);!(async()=>{const II1lIl1i=illi11Il,lil1l1il={'LjhdD':'CookieJD','CyeBJ':II1lIl1i(0x2af,'Jsw%'),'VcnFa':function(iI1Ilili,ilI1ii1){return iI1Ilili(ilI1ii1);},'HCose':II1lIl1i(0x146,'I3Q$'),'PtTqf':II1lIl1i(0x234,'$i9P'),'zVdRU':II1lIl1i(0x225,'wYk*'),'KWrDJ':'lotteryPrice','VEsui':II1lIl1i(0x11c,'@aQK'),'tEmeU':'count','qNunH':function(iIllIl11,l1ilI1l1){return iIllIl11!=l1ilI1l1;},'uXOxJ':function(i1Il1i1I,liI1il11){return i1Il1i1I-liI1il11;},'oOwcJ':II1lIl1i(0x265,'I3Q$'),'aTDnr':'https://bean.m.jd.com/bean/signIndex.action','zTjAZ':function(Ilili1i1,Il1I1i1i){return Ilili1i1||Il1I1i1i;},'eOuDx':function(iI11Iil,II1lI1i){return iI11Iil(II1lI1i);},'aqWtc':II1lIl1i(0xb8,'t5YQ'),'xejrI':function(IlIilIi,i1lI1llI,iIlIi111){return IlIilIi(i1lI1llI,iIlIi111);},'aPdmW':II1lIl1i(0x1f8,'NgGD'),'xomoG':function(iIIll1ii,iiI1iIIl){return iIIll1ii!==iiI1iIIl;},'ZdFmd':II1lIl1i(0x16a,'L#%C'),'lffmG':II1lIl1i(0x1d6,'I3Q$'),'YYcPQ':II1lIl1i(0x12a,'gIK*'),'ytuBy':II1lIl1i(0xbd,'p#m^'),'LnGIW':II1lIl1i(0x125,'oP8t'),'jpJIf':function(l1lilIi1,ll1i1lIi,Ii1iill1){return l1lilIi1(ll1i1lIi,Ii1iill1);},'bGtJf':function(lIii1lII,li1IiiIi){return lIii1lII+li1IiiIi;},'DImEc':'当期活动:','WdUYJ':function(l1iIli11,ii1lI1iI){return l1iIli11<ii1lI1iI;},'mElRO':II1lIl1i(0x1a4,'6oqM'),'geFAf':function(i1IiI11l,illIiil1){return i1IiI11l+illIiil1;},'vFZJz':II1lIl1i(0x142,')th0'),'YnSdD':function(i1IlIliI){return i1IlIliI();},'hrwmZ':function(l1lIilli){return l1lIilli();},'ZCWMS':function(liliIII,li1l1lIl){return liliIII*li1l1lIl;}};if(!I1I1llI[0x0]){$[II1lIl1i(0xc4
|
|||
|
// 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
|