KR/jd_lzkj_loreal_cart.js

23 lines
102 KiB
JavaScript
Raw Normal View History

2023-07-28 21:29:02 +08:00
/**
lzkj_loreal加购有礼
2023-07-27 16:14:01 +08:00
2023-07-28 21:29:02 +08:00
必须条件配置文件或者环境变量中添加变量
## lzkj_loreal加购有礼-jd_lzkj_loreal_cart.js
//export jd_lzkj_loreal_cart_url="活动链接"
此类活动必须强制入会否则无法参加
请使用本地IP环境 请使用本地IP环境 请使用本地IP环境
2023-07-27 16:14:01 +08:00
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#lzkj_loreal加购有礼
1 1 1 1 * jd_lzkj_loreal_cart.js, tag=lzkj_loreal加购有礼, enabled=true
*/
const $ = new Env("加购有礼lzkj_loreal");
2023-07-28 23:36:10 +08:00
var version_='jsjiami.com.v7';const iiiiI=iii1II;(function(lii1i,lliIl,lliIi,l1Iii1,IIiIi1,I1i1,iiiii){return lii1i=lii1i>>0x4,I1i1='hs',iiiii='hs',function(iiiil,iiIlII,il11II,l11l1,l11lI){const lliII=iii1II;l11l1='tfi',I1i1=l11l1+I1i1,l11lI='up',iiiii+=l11lI,I1i1=il11II(I1i1),iiiii=il11II(iiiii),il11II=0x0;const Il1l11=iiiil();while(!![]&&--l1Iii1+iiIlII){try{l11l1=-parseInt(lliII(0x35b,'hCxM'))/0x1+parseInt(lliII(0x1ae,'%pU1'))/0x2*(-parseInt(lliII(0x43f,'xNmW'))/0x3)+-parseInt(lliII(0x4e4,'e!)7'))/0x4*(parseInt(lliII(0x3f4,'TG7T'))/0x5)+parseInt(lliII(0x2fd,'w9wf'))/0x6*(-parseInt(lliII(0x320,'9Nl3'))/0x7)+parseInt(lliII(0x298,'xNmW'))/0x8*(parseInt(lliII(0x257,'h&nK'))/0x9)+-parseInt(lliII(0x112,'lS67'))/0xa*(-parseInt(lliII(0x4c5,'8&@u'))/0xb)+parseInt(lliII(0x361,'rZca'))/0xc;}catch(I1II1l){l11l1=il11II;}finally{l11lI=Il1l11[I1i1]();if(lii1i<=l1Iii1)il11II?IIiIi1?l11l1=l11lI:IIiIi1=l11lI:il11II=l11lI;else{if(il11II==IIiIi1['replace'](/[gFKMBeLXPVOqdlNbpJwE=]/g,'')){if(l11l1===iiIlII){Il1l11['un'+I1i1](l11lI);break;}Il1l11[iiiii](l11lI);}}}}}(lliIi,lliIl,function(lli1ii,I1II1i,lli1il,lii1I,IIiIiI,ll1l,ll1i){return I1II1i='\x73\x70\x6c\x69\x74',lli1ii=arguments[0x0],lli1ii=lli1ii[I1II1i](''),lli1il='\x72\x65\x76\x65\x72\x73\x65',lli1ii=lli1ii[lli1il]('\x76'),lii1I='\x6a\x6f\x69\x6e',(0x136afa,lli1ii[lii1I](''));});}(0xc00,0x555e5,Iii11l,0xc2),Iii11l)&&(version_=Iii11l);const l1iiil=$[iiiiI(0xbd,'@BD6')]()?require(iiiiI(0x2d8,'%pU1')):'',l1ilI=$[iiiiI(0x377,'MpdB')]()?require(iiiiI(0x4de,'oM1#')):'',IIi1=require('./function/krgetToken'),illl1i=require(iiiiI(0x2c3,'cmwW')),l1iiii=require('./function/krgetua');let iiiIi1={},illl1l=process['env'][iiiiI(0x467,'YK8#')],Il11I=null,li1lll='',lill1='';$['activityEnd']=![];let IiIIl=null,IiIIi=[],li1lli='',iiiIl1='',I1i1I='';if($[iiiiI(0x12b,'QFt^')]()){if(process['env'][iiiiI(0x476,'5A(V')])illl1l=process[iiiiI(0x409,'%pU1')]['jd_lzkj_loreal_cart_url'];if(JSON[iiiiI(0xde,'h&nK')](process[iiiiI(0x345,'lK1Z')])[iiiiI(0x1f7,'Ya84')](iiiiI(0x4f3,')X$$'))>-0x1)process[iiiiI(0x15e,'&aCN')](0x0);Object['keys'](l1ilI)[iiiiI(0x142,'8&@u')](llIiIl=>{const iiIlIl=iiiiI;IiIIi[iiIlIl(0x143,'YK8#')](l1ilI[llIiIl]);});if(process['env'][iiiiI(0x4c1,')X$$')]&&process[iiiiI(0x319,'X)Nz')]['JD_DEBUG']==='false')console[iiiiI(0x1a8,'o0ku')]=()=>{};}else IiIIi=[$[iiiiI(0x1b5,'lK1Z')]('CookieJD'),$['getdata'](iiiiI(0x12f,'YelP')),...$['toObj']($[iiiiI(0x16b,'B1Pz')]('CookiesJD')||'[]')[iiiiI(0x36e,'#dSm')](I1i1i=>I1i1i['cookie'])][iiiiI(0xb7,'QFt^')](lIi1II=>!!lIi1II);let IIl1=typeof $request!=='undefined';IIl1&&(GetCookie(),$[iiiiI(0x158,'lK1Z')]());if(illl1l){const iiiIii='0|3|4|2|1'[iiiiI(0x1e3,'StHc')]('|');let IllI1=0x0;while(!![]){switch(iiiIii[IllI1++]){case'0':Il11I=llIiIi(''+illl1l,iiiiI(0x11c,'A566'));continue;case'1':$[iiiiI(0x46c,'#4Wv')]=illl1l[iiiiI(0xf2,'rZca')](/https?:\/\/([^/]+)/)[0x1];continue;case'2':if(illl1l['includes'](iiiiI(0x322,'F*6C')))wxActType=iiiiI(0x374,'rZca');else illl1l[iiiiI(0x404,'StHc')]('lzkj')?wxActType=illl1l[iiiiI(0x3d0,'5A(V')](/\/(prod\/cc\/interact\w*)\//)[0x1]:console[iiiiI(0x3bb,'oM1#')](iiiiI(0x122,'cmwW'));continue;case'3':activityType=llIiIi(''+illl1l,iiiiI(0x378,'&aCN'));continue;case'4':templateId=llIiIi(''+illl1l,iiiiI(0x8b,'X)Nz'));continue;}break;}}let l1ili=iiiiI(0x4cb,'o0ku')+$[iiiiI(0xa2,'hu0K')];!(async()=>{const iiIlIi=iiiiI,iiiIil={'UNAGI':iiIlIi(0x203,'5A(V'),'TxynN':function(l1iilI,lilli){return l1iilI+lilli;},'bJbcX':iiIlIi(0x436,'hCxM'),'rjSPx':'活动id不存在','lKNUc':'活动入口:','TOmwr':iiIlIi(0x402,'oM1#'),'ZmPkq':function(iiII,Iil11){return iiII===Iil11;},'iDimC':iiIlIi(0x1c5,'oM1#'),'vfkWz':function(Ill1iI,i1Ii1l){return Ill1iI!=i1Ii1l;},'WLmrr':function(IIll,i1Ii1i){return IIll==i1Ii1i;},'PvbJj':function(iiiIll,iilliI){return iiiIll!==iilliI;},'SsKPA':iiIlIi(0x16d,'pV*C'),'RZQpL':iiIlIi(0x18e,'MpdB'),'ImDxU':iiIlIi(0x401,'8&@u'),'MxBEq':function(iII1i,ilI1ii){return iII1i<ilI1ii;},'ybBbg':function(iII1l,ilI1il){return iII1l===ilI1il;},'qifAr':'MHDgK','DTrsu':'随机抽取到的收货地址信息格式存在错误<EFBFBD>
2023-07-27 16:14:01 +08:00
// prettier-ignore
2023-07-28 21:29:02 +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