KR/jd_lzkj_loreal_sign.js

18 lines
108 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/**
活动名称签到抽奖超级无线欧莱雅
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=<10001/10002/10003/10004>&templateId=<模板id>&activityId=<活动id>&nodeId=<nodeid>&prd=cjwx
支持activityType (10001/10002/10003/10004)
环境变量jd_lzkj_loreal_sign_url // 活动链接
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#lzkj_loreal签到抽奖
1 1 1 1 * jd_lzkj_loreal_sign.js, tag=lzkj_loreal签到抽奖, enabled=true
*/
const $ = new Env("签到抽奖lzkj_loreal");
var version_='jsjiami.com.v7';const iilI11=i1lIii1l;(function(Ii1i1i1,I1iIIlI1,i1ii1llI,liiIlIlI,l1I11ii,lil11lII,li1IIl1I){return Ii1i1i1=Ii1i1i1>>0x8,lil11lII='hs',li1IIl1I='hs',function(iI11ii,li1ii1I,ilIlil1,IllIliil,iiIl1Ili){const I1lI111l=i1lIii1l;IllIliil='tfi',lil11lII=IllIliil+lil11lII,iiIl1Ili='up',li1IIl1I+=iiIl1Ili,lil11lII=ilIlil1(lil11lII),li1IIl1I=ilIlil1(li1IIl1I),ilIlil1=0x0;const ll1Ii1il=iI11ii();while(!![]&&--liiIlIlI+li1ii1I){try{IllIliil=-parseInt(I1lI111l(0x4ce,'Fnbe'))/0x1*(parseInt(I1lI111l(0x41f,'V]7%'))/0x2)+parseInt(I1lI111l(0x4e0,'hku8'))/0x3*(parseInt(I1lI111l(0x3a1,'9&1d'))/0x4)+parseInt(I1lI111l(0x1fa,'lMvg'))/0x5*(-parseInt(I1lI111l(0x41d,'$K&h'))/0x6)+-parseInt(I1lI111l(0x4c8,'PDy&'))/0x7+-parseInt(I1lI111l(0x4e6,'3gUe'))/0x8+parseInt(I1lI111l(0x1ae,'8)rH'))/0x9*(-parseInt(I1lI111l(0x376,'dizH'))/0xa)+-parseInt(I1lI111l(0x120,'9&1d'))/0xb*(-parseInt(I1lI111l(0x273,'PDy&'))/0xc);}catch(lli1i1lI){IllIliil=ilIlil1;}finally{iiIl1Ili=ll1Ii1il[lil11lII]();if(Ii1i1i1<=liiIlIlI)ilIlil1?l1I11ii?IllIliil=iiIl1Ili:l1I11ii=iiIl1Ili:ilIlil1=iiIl1Ili;else{if(ilIlil1==l1I11ii['replace'](/[newVWgYJPMHluXkUFKQRdL=]/g,'')){if(IllIliil===li1ii1I){ll1Ii1il['un'+lil11lII](iiIl1Ili);break;}ll1Ii1il[li1IIl1I](iiIl1Ili);}}}}}(i1ii1llI,I1iIIlI1,function(lIII111l,il1ll1,I1I1l11i,IIiiIiil,IIli1il,lI1iilll,l1II1Iil){return il1ll1='\x73\x70\x6c\x69\x74',lIII111l=arguments[0x0],lIII111l=lIII111l[il1ll1](''),I1I1l11i='\x72\x65\x76\x65\x72\x73\x65',lIII111l=lIII111l[I1I1l11i]('\x76'),IIiiIiil='\x6a\x6f\x69\x6e',(0x131a43,lIII111l[IIiiIiil](''));});}(0xbd00,0xe0ce4,Ii1II1l,0xbf),Ii1II1l)&&(version_=Ii1II1l);const li1ll1ll=$[iilI11(0x13b,'nsi&')]()?require(iilI11(0x2fa,'#LZT')):'',lIi1I1ii=$[iilI11(0x3dd,'I[]t')]()?require('./jdCookie.js'):'',lil1Iiii=require(iilI11(0x2b2,'VkY1')),lIllI1i1=require(iilI11(0x528,'lMvg'));let Iil1iIiI={},l1li1l=process[iilI11(0x1c8,'W%vR')]['jd_lzkj_loreal_sign_url'],liIIII=null,I1lIII='',iilIlI1I='';$[iilI11(0x4a1,'$K&h')]=![];let iliiliil=null,i1iiiil=[],illliIII='',ll11lIi1='',Illi1ili='';if($[iilI11(0x1c5,'V8Fv')]()){if(process[iilI11(0x1ff,'f[1l')][iilI11(0x288,'#LZT')])l1li1l=process[iilI11(0x433,'hhZE')][iilI11(0x194,'&R@g')];if(JSON[iilI11(0x259,'hP[C')](process[iilI11(0x10c,'PN%y')])[iilI11(0x44a,'V8Fv')](iilI11(0x4a4,'CSu&'))>-0x1)process[iilI11(0x414,'fol9')](0x0);Object[iilI11(0x21f,'&R@g')](lIi1I1ii)['forEach'](llI1li1=>{const IiiI11ii=iilI11;i1iiiil[IiiI11ii(0x332,'$xwn')](lIi1I1ii[llI1li1]);});if(process[iilI11(0x1bd,'hP[C')]['JD_DEBUG']&&process[iilI11(0x419,'dOxV')][iilI11(0x22d,'nsi&')]==='false')console[iilI11(0x107,'pbt]')]=()=>{};}else i1iiiil=[$['getdata']('CookieJD'),$[iilI11(0x3bf,'2gph')](iilI11(0x4f9,'WJc[')),...$[iilI11(0x28a,'hv8Y')]($[iilI11(0x4f0,'nsi&')](iilI11(0x36a,'PDy&'))||'[]')[iilI11(0x180,'lMvg')](iliiIIlI=>iliiIIlI[iilI11(0x2c5,'$K&h')])]['filter'](i1l1IIli=>!!i1l1IIli);let li1IIll1=typeof $request!==iilI11(0x2c8,'PDy&');li1IIll1&&(GetCookie(),$[iilI11(0x53e,'0kg(')]());if(l1li1l){const illIIiII=iilI11(0x4ea,'V]7%')['split']('|');let IilIlIl1=0x0;while(!![]){switch(illIIiII[IilIlIl1++]){case'0':if(l1li1l[iilI11(0x1a1,'Gb5T')]('lorealjdcampaign-rc'))wxActType='apps/interact';else l1li1l[iilI11(0x32c,'W%vR')]('lzkj')?wxActType=l1li1l['match'](/\/(prod\/cc\/interact\w*)\//)[0x1]:console[iilI11(0x439,'Fnbe')](iilI11(0x48c,'%cVv'));continue;case'1':activityType=Ii11Ili1(''+l1li1l,iilI11(0x508,'hP[C'));continue;case'2':$[iilI11(0x124,'Xz8$')]=l1li1l['match'](/https?:\/\/([^/]+)/)[0x1];continue;case'3':templateId=Ii11Ili1(''+l1li1l,iilI11(0x202,'pbt]'));continue;case'4':liIIII=Ii11Ili1(''+l1li1l,iilI11(0x4ee,'CSu&'));continue;}break;}}let ll1IIlIl=iilI11(0x20c,'vgzy')+$[iilI11(0x49b,'pbt]')];!(async()=>{const IlI1l1li=iilI11,l1iiilI={'lNESR':function(llliIIIi,llll1II){return llliIIIi+llll1II;},'lKCUN':function(IIiIll1i,iiiliiI1){return IIiIll1i+iiiliiI1;},'kHcTF':'【京东账号','uHSqx':'】\x20未能获取活动信息','gmJmg':function(l1Ii1lll,ili11Ili){return l1Ii1lll==ili11Ili;},'CjSlq':'活动入口:','PIsLb':function(liI1Il1I,II1lIiiI){return liI1Il
// 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.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])