KR/jd_lzkj_loreal_draw.js

23 lines
108 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/**
2023-07-28 21:29:02 +08:00
lzkj_loreal抽奖
必须条件配置文件或者环境变量中添加变量
## lzkj_loreal抽奖-jd_lzkj_loreal_draw.js
//export jd_lzkj_loreal_draw_url="活动链接"
此类活动必须强制入会否则无法参加
请使用本地IP环境 请使用本地IP环境 请使用本地IP环境
2023-07-27 16:14:01 +08:00
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
2023-07-28 21:29:02 +08:00
#lzkj_loreal抽奖
1 1 1 1 * jd_lzkj_loreal_draw.js, tag=lzkj_loreal抽奖, enabled=true
2023-07-27 16:14:01 +08:00
*/
const $ = new Env("幸运抽奖lzkj_loreal");
2023-07-28 23:36:10 +08:00
var version_='jsjiami.com.v7';const ilIIII=iii1II;(function(iIiII1,I1l1,Il11I1,i11liI,iilI11,lIiiiI,iiI1Il){return iIiII1=iIiII1>>0x3,lIiiiI='hs',iiI1Il='hs',function(iiI1Ii,Il1i1,IlIiil,IlIiii,ilIII1){const I1Iili=iii1II;IlIiii='tfi',lIiiiI=IlIiii+lIiiiI,ilIII1='up',iiI1Il+=ilIII1,lIiiiI=IlIiil(lIiiiI),iiI1Il=IlIiil(iiI1Il),IlIiil=0x0;const lll1lI=iiI1Ii();while(!![]&&--i11liI+Il1i1){try{IlIiii=parseInt(I1Iili(0x48f,'o9V]'))/0x1*(-parseInt(I1Iili(0x467,'sdNX'))/0x2)+-parseInt(I1Iili(0x506,'%mBk'))/0x3+-parseInt(I1Iili(0x3d2,'%mBk'))/0x4*(-parseInt(I1Iili(0x40a,'31bd'))/0x5)+-parseInt(I1Iili(0x172,'!n8k'))/0x6*(parseInt(I1Iili(0x390,'r&hK'))/0x7)+parseInt(I1Iili(0x299,'aVz5'))/0x8*(parseInt(I1Iili(0x580,'gvCZ'))/0x9)+parseInt(I1Iili(0x36a,'lem*'))/0xa*(parseInt(I1Iili(0x491,'xr^L'))/0xb)+parseInt(I1Iili(0x42b,'%09B'))/0xc*(parseInt(I1Iili(0x53b,'pVsd'))/0xd);}catch(lliliI){IlIiii=IlIiil;}finally{ilIII1=lll1lI[lIiiiI]();if(iIiII1<=i11liI)IlIiil?iilI11?IlIiii=ilIII1:iilI11=ilIII1:IlIiil=ilIII1;else{if(IlIiil==iilI11['replace'](/[gDOnyJBbhLPIwTdEARGNpQ=]/g,'')){if(IlIiii===Il1i1){lll1lI['un'+lIiiiI](ilIII1);break;}lll1lI[iiI1Il](ilIII1);}}}}}(Il11I1,I1l1,function(ll1iiI,lIIlll,ll1ii1,i11li1,iIlI1,IiIlII,iI11i){return lIIlll='\x73\x70\x6c\x69\x74',ll1iiI=arguments[0x0],ll1iiI=ll1iiI[lIIlll](''),ll1ii1='\x72\x65\x76\x65\x72\x73\x65',ll1iiI=ll1iiI[ll1ii1]('\x76'),i11li1='\x6a\x6f\x69\x6e',(0x136af9,ll1iiI[i11li1](''));});}(0x5f0,0x55597,Iii11l,0xc0),Iii11l)&&(version_=Iii11l);const iiI1=$[ilIIII(0x3c2,'MDnv')]()?require(ilIIII(0x3e3,'r&hK')):'',Il11l=$['isNode']()?require('./jdCookie.js'):'',l1iiil=require(ilIIII(0x38f,'ysFl')),l1ilI=require('./function/krh5st'),IIi1=require(ilIIII(0x1ea,'350R'));let illl1i={},l1iiii=process[ilIIII(0x33c,'31bd')][ilIIII(0x159,'pVsd')],iiiIi1='',illl1l=null,Il11I='';$[ilIIII(0x3d5,'hFke')]=![];let li1lll=null,lill1=[],IiIIl='',IiIIi='',li1lli='';if($['isNode']()){if(process[ilIIII(0x142,'^Snt')]['jd_lzkj_loreal_draw_url'])l1iiii=process[ilIIII(0x29e,'H9@V')][ilIIII(0x480,'sdNX')];if(JSON[ilIIII(0x1f5,'H$4*')](process[ilIIII(0x3e5,'N1F)')])['indexOf']('GITHUB')>-0x1)process[ilIIII(0x25d,'xr^L')](0x0);Object[ilIIII(0x2f0,'7wO^')](Il11l)['forEach'](i1Ii1I=>{const I1li=ilIIII;lill1[I1li(0x499,'Ak[$')](Il11l[i1Ii1I]);});if(process['env'][ilIIII(0x462,'y[P8')]&&process[ilIIII(0x124,'lem*')][ilIIII(0x1a5,'AR$!')]===ilIIII(0x29a,'%eC@'))console[ilIIII(0x48c,'sdNX')]=()=>{};}else lill1=[$[ilIIII(0x475,'%mBk')]('CookieJD'),$['getdata']('CookieJD2'),...$[ilIIII(0x52c,'H*!1')]($[ilIIII(0x577,'^Snt')](ilIIII(0x387,'Cacp'))||'[]')[ilIIII(0xe3,'!n8k')](llIiIl=>llIiIl[ilIIII(0x228,'&HQK')])]['filter'](I1i1i=>!!I1i1i);let iiiIl1=typeof $request!==ilIIII(0x200,'Y75m');iiiIl1&&(GetCookie(),$[ilIIII(0x2e5,'xr^L')]());if(l1iiii){const lIi1II=ilIIII(0xf7,'gvCZ')['split']('|');let iiiIii=0x0;while(!![]){switch(lIi1II[iiiIii++]){case'0':activityType=I1i1l(''+l1iiii,ilIIII(0x104,'ep9k'));continue;case'1':illl1l=I1i1l(''+l1iiii,ilIIII(0x297,'Ak[$'));continue;case'2':templateId=I1i1l(''+l1iiii,'templateId');continue;case'3':if(l1iiii[ilIIII(0x1fa,'O^Fr')](ilIIII(0x225,'Ak[$')))wxActType=ilIIII(0x42c,'FQqv');else l1iiii[ilIIII(0x342,'Ybfc')](ilIIII(0x527,'7wO^'))?wxActType=l1iiii['match'](/\/(prod\/cc\/interact\w*)\//)[0x1]:console[ilIIII(0x22e,'MDnv')]('暂不支持的类型');continue;case'4':$[ilIIII(0x30f,'%eC@')]=l1iiii['match'](/https?:\/\/([^/]+)/)[0x1];continue;}break;}}let I1i1I=ilIIII(0x560,'Cacp')+$[ilIIII(0x3b9,'Cacp')];!(async()=>{const iIllIi=ilIIII,IllI1={'LBeMX':'请勿随意在BoxJs输入框修改内容\x0a建议通过脚本去获取cookie','qaOuv':function(lilll){return lilll();},'ikxiQ':function(l1iilI,lilli){return l1iilI+lilli;},'tLPDv':iIllIi(0x3a3,'sdNX'),'nIJma':function(iiII,Iil11){return iiII+Iil11;},'SwSts':iIllIi(0x2ce,'Y75m'),'lkMvh':iIllIi(0x2da,'pVsd'),'oorrf':function(Ill1iI,i1Ii1l){return Ill1iI!=i1Ii1l;},'HFEsT':function(IIll,i1Ii1i){return IIll(i1Ii1i);},'ybHTd':function(iiiIll){return iiiIll();},'sMpad':function(iilliI,iII1i){return iilliI==iII1i;},'griLi':iIllIi(0x371,'%eC@'),'MJvZD':
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