KR/jd_lzkj_loreal_lkFollowShop.js

20 lines
97 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
活动名称关注店铺有礼超级无线欧莱雅
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10069&templateId=<模板id>&activityId=<活动id>&nodeId=<nodeid>&prd=cjwx
https://lorealjdcampaign-rc.isvjcloud.com/interact/index?activityType=10069&templateId=<模板id>&activityId=<活动id>&nodeId=<nodeid>&prd=cjwx
支持activityType (10069)
环境变量jd_lzkj_loreal_lkFollowShop_url // 活动链接
2023-07-28 21:29:02 +08:00
请使用本地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_lkFollowShop.js, tag=lzkj_loreal关注有礼, enabled=true
*/
const $ = new Env("关注有礼lzkj_loreal");
2023-07-28 21:29:02 +08:00
var version_='jsjiami.com.v7';const llIi1l=iii1II;(function(IIiIli,lIl1l,iIlIii,iiI111,lIi111,iIlIi1,IIiIll){return IIiIli=IIiIli>>0x4,iIlIi1='hs',IIiIll='hs',function(iIi,iI1i,liIiii,l11Ill,IIlliI){const llIi1i=iii1II;l11Ill='tfi',iIlIi1=l11Ill+iIlIi1,IIlliI='up',IIiIll+=IIlliI,iIlIi1=liIiii(iIlIi1),IIiIll=liIiii(IIiIll),liIiii=0x0;const ilIil1=iIi();while(!![]&&--iiI111+iI1i){try{l11Ill=-parseInt(llIi1i(0x1c8,'W4IQ'))/0x1*(-parseInt(llIi1i(0x21f,'cyG$'))/0x2)+-parseInt(llIi1i(0x43a,'picW'))/0x3+-parseInt(llIi1i(0x45f,'3ej@'))/0x4*(parseInt(llIi1i(0x559,'lgmj'))/0x5)+parseInt(llIi1i(0x2ea,'mChT'))/0x6*(parseInt(llIi1i(0x260,'D]yB'))/0x7)+-parseInt(llIi1i(0x379,'Z4Lr'))/0x8+parseInt(llIi1i(0x2f9,'W)mp'))/0x9+parseInt(llIi1i(0x213,'R56s'))/0xa*(parseInt(llIi1i(0x3e5,'Am4@'))/0xb);}catch(iI1l){l11Ill=liIiii;}finally{IIlliI=ilIil1[iIlIi1]();if(IIiIli<=iiI111)liIiii?lIi111?l11Ill=IIlliI:lIi111=IIlliI:liIiii=IIlliI;else{if(liIiii==lIi111['replace'](/[GnkLKCAQHMRVqTfWJPX=]/g,'')){if(l11Ill===iI1i){ilIil1['un'+iIlIi1](IIlliI);break;}ilIil1[IIiIll](IIlliI);}}}}}(iIlIii,lIl1l,function(lIl1I1,I111I1,iIl,lIIi,l11Ili,iiill,iiI11I){return I111I1='\x73\x70\x6c\x69\x74',lIl1I1=arguments[0x0],lIl1I1=lIl1I1[I111I1](''),iIl='\x72\x65\x76\x65\x72\x73\x65',lIl1I1=lIl1I1[iIl]('\x76'),lIIi='\x6a\x6f\x69\x6e',(0x136a90,lIl1I1[lIIi](''));});}(0xbe0,0xba8e5,Iii11l,0xc0),Iii11l)&&(version_=Iii11l);const I1IlII=$[llIi1l(0x421,'EcGJ')]()?require('./sendNotify'):'',l1III=$[llIi1l(0x555,'kI1C')]()?require(llIi1l(0x4cb,'9R1i')):'',l1I1iI=require(llIi1l(0x251,'uUq1')),III1l1=require('./function/krh5st'),Il111=require(llIi1l(0x293,'V1wu'));let lIiIli={},IiIII=process[llIi1l(0x59b,'de*K')][llIi1l(0x4bd,'de*K')],IiIiii=null,lIiIll='',lIlliI='';$[llIi1l(0x551,'F7zP')]=![];let iIIlI1=null,IiIiil=[],IlIi='',IlIl='',IiII1='';if($[llIi1l(0x580,'R56s')]()){if(process['env'][llIi1l(0x31e,'picW')])IiIII=process[llIi1l(0x4ca,'cyG$')][llIi1l(0x3f8,'Wu1N')];if(JSON[llIi1l(0x3ac,'z89*')](process[llIi1l(0x424,'H@%s')])[llIi1l(0x1a7,'Z4Lr')](llIi1l(0x30b,'mKX@'))>-0x1)process[llIi1l(0x53f,'Wu1N')](0x0);Object[llIi1l(0x492,'2(OZ')](l1III)['forEach'](Il11l=>{const l11i1=llIi1l;IiIiil[l11i1(0x3ef,'Wu1N')](l1III[Il11l]);});if(process[llIi1l(0x427,'bSUo')][llIi1l(0x5a6,'AooL')]&&process['env']['JD_DEBUG']===llIi1l(0x375,'(8fw'))console[llIi1l(0x266,'(8fw')]=()=>{};}else IiIiil=[$[llIi1l(0x57b,'mKX@')]('CookieJD'),$[llIi1l(0x3fa,'F7zP')](llIi1l(0x470,'F7zP')),...$['toObj']($[llIi1l(0x18f,'nAGb')](llIi1l(0x1df,'mKX@'))||'[]')[llIi1l(0x333,'lgmj')](l1iiil=>l1iiil[llIi1l(0x392,'4jVr')])][llIi1l(0x1e2,'kI1C')](l1ilI=>!!l1ilI);let l1IIi=typeof $request!==llIi1l(0x2bc,'nAGb');l1IIi&&(GetCookie(),$[llIi1l(0x282,'Qwel')]());if(IiIII){const IIi1=llIi1l(0x487,'Wu1N')['split']('|');let illl1i=0x0;while(!![]){switch(IIi1[illl1i++]){case'0':if(IiIII[llIi1l(0x268,'3ej@')]('lorealjdcampaign-rc'))wxActType=llIi1l(0x4b4,'4jVr');else IiIII['includes'](llIi1l(0x3f2,'bSUo'))?wxActType=IiIII['match'](/\/(prod\/cc\/interact\w*)\//)[0x1]:console[llIi1l(0x2cf,'$PY(')](llIi1l(0x33c,'lgmj'));continue;case'1':$[llIi1l(0x572,'(8fw')]=IiIII[llIi1l(0x2c2,'x4jq')](/https?:\/\/([^/]+)/)[0x1];continue;case'2':IiIiii=lillI(''+IiIII,llIi1l(0x4fc,'picW'));continue;case'3':activityType=lillI(''+IiIII,llIi1l(0x59a,'cyG$'));continue;case'4':templateId=lillI(''+IiIII,llIi1l(0x3df,'5^BA'));continue;}break;}}function iii1II(_0x4b4f5b,_0x595a9d){const _0x9bcc92=Iii11l();return iii1II=function(_0x53565c,_0x1f4ca0){_0x53565c=_0x53565c-0x18f;let _0x4df8bc=_0x9bcc92[_0x53565c];if(iii1II['NypyaH']===undefined){var _0x3c9b4e=function(_0x326c49){const _0x25fcb0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4d3c90='',_0x5772b1='';for(let _0x52db45=0x0,_0x2b1b55,_0x572019,_0x84e4db=0x0;_0x572019=_0x326c49['charAt'](_0x84e4db++);~_0x572019&&(_0x2b1b55=_0x52db45%0x4?_0x2b1b55*0x40+_0x572019:_0x572019,_0x52db45++%0x4)?_0x4d3c90+=String['fromCharCode'](0xff&_0x2b1b55>>(-0x2*_0x52db45&0x6)):0x0){_0x572019=_0x25fcb0['indexOf'](_0x572019);}for(let _0x42d66a=0x0,_0x36222e=_0x4d3c90['length'];_0x42d66a<_0
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