KR/jd_lzkj_loreal_shopGift.js

22 lines
58 KiB
JavaScript
Raw Permalink Normal View History

2023-10-14 18:47:36 +08:00
/*
活动名称店铺礼包超级无线
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10058&templateId=<模板id>&activityId=<活动id>&prd=cjwx
https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v1/index?activityType=10058&templateId=<模板id>&activityId=<活动id>&prd=cjwx
环境变量jd_lzkj_loreal_shopGift_url // 活动链接
jd_lzkj_loreal_shopGift_opencard // 是否入会true/false默认不入会
jd_lzkj_loreal_shopGift_Notify // 是否推送通知true/false默认不推送
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#店铺礼包超级无线
1 1 1 1 * jd_lzkj_loreal_shopGift.js, tag=店铺礼包超级无线, enabled=true
*/
const $ = new Env('店铺礼包(超级无线)')
2023-11-12 16:44:11 +08:00
var version_='jsjiami.com.v7';const lI1I1i=iii1II;(function(lIl1li,Il1I1,lIilii,lIilil,lIl1ll,Ii111,Ii1III){return lIl1li=lIl1li>>0x3,Ii111='hs',Ii1III='hs',function(ilIIi1,l111i,l111l,I1iilI,Ii1II1){const Ili1I1=iii1II;I1iilI='tfi',Ii111=I1iilI+Ii111,Ii1II1='up',Ii1III+=Ii1II1,Ii111=l111l(Ii111),Ii1III=l111l(Ii1III),l111l=0x0;const lilili=ilIIi1();while(!![]&&--lIilil+l111i){try{I1iilI=parseInt(Ili1I1(0x43d,'W]m*'))/0x1*(-parseInt(Ili1I1(0x284,'WBIT'))/0x2)+parseInt(Ili1I1(0x39b,'%ae2'))/0x3+-parseInt(Ili1I1(0x3a1,'Ib]9'))/0x4*(-parseInt(Ili1I1(0x201,'#O]Y'))/0x5)+-parseInt(Ili1I1(0x343,'y20F'))/0x6+-parseInt(Ili1I1(0x373,'NKaU'))/0x7*(-parseInt(Ili1I1(0x31c,'VGMf'))/0x8)+-parseInt(Ili1I1(0x42b,'^qZ('))/0x9*(parseInt(Ili1I1(0x420,'ianw'))/0xa)+-parseInt(Ili1I1(0x23c,'#wZz'))/0xb*(-parseInt(Ili1I1(0x1f1,'t76s'))/0xc);}catch(IliIli){I1iilI=l111l;}finally{Ii1II1=lilili[Ii111]();if(lIl1li<=lIilil)l111l?lIl1ll?I1iilI=Ii1II1:lIl1ll=Ii1II1:l111l=Ii1II1;else{if(l111l==lIl1ll['replace'](/[RQGtqyMDFefhuJVPbEXI=]/g,'')){if(I1iilI===l111i){lilili['un'+Ii111](Ii1II1);break;}lilili[Ii1III](Ii1II1);}}}}}(lIilii,Il1I1,function(lI1ilI,IllliI,IliIll,iIiili,lilill,IilI1,l1lI1){return IllliI='\x73\x70\x6c\x69\x74',lI1ilI=arguments[0x0],lI1ilI=lI1ilI[IllliI](''),IliIll=`\x72\x65\x76\x65\x72\x73\x65`,lI1ilI=lI1ilI[IliIll]('\x76'),iIiili=`\x6a\x6f\x69\x6e`,(0x14712b,lI1ilI[iIiili](''));});}(0x638,0x87619,Iii11l,0xc9),Iii11l)&&(version_=lI1I1i(0x2e9,'(X[y'));const ll11l1=require('./jdCookie'),ll111=require(lI1I1i(0x2d3,'YSRB')),llliII=require(lI1I1i(0x1d7,'ianw')),iiIiIl=require(lI1I1i(0x251,'WE*h')),{wuxianDefense:IlI1l1}=require(lI1I1i(0x389,'ianw')),liIliI=process['env']['jd_lzkj_loreal_shopGift_url']||'',llii1I=process[lI1I1i(0x1e1,'W]m*')][lI1I1i(0x42c,'bcWP')]===lI1I1i(0x35e,')&zA'),iiIiIi=process['env'][lI1I1i(0x31e,'Ip[6')]===lI1I1i(0x24c,'b7RM');let l1lll1='',IilI='';const liIlli=Object[lI1I1i(0x354,'qTAA')](ll11l1)['map'](Ilii1=>ll11l1[Ilii1])[lI1I1i(0x283,'ianw')](ll11i1=>ll11i1);!liIlli[0x0]&&($[lI1I1i(0x313,'WAqg')]($[lI1I1i(0x21a,'KMP0')],'【提示】请先获取Cookie'),process['exit'](0x1));!(async()=>{const liI1II=lI1I1i,ili1I1={'cGZWd':liI1II(0x3cd,')[tv'),'kTvNt':'apps/interact','mcwVr':liI1II(0x447,')[tv'),'GBUUh':function(liIllI,ll11i){return liIllI(ll11i);},'BgLCp':liI1II(0x2bf,'l0DD'),'IGFya':function(iI1lI1,I1I1li){return iI1lI1!==I1I1li;},'SIfqH':liI1II(0x43f,'$Jo@'),'tZbsy':liI1II(0x20c,'Tz4F'),'DFZol':'activityId','QiwzB':function(l1i11,IlI1li){return l1i11===IlI1li;},'NJBhH':liI1II(0x347,'eUp0'),'AnkEw':liI1II(0x29a,'5hKs'),'QxthY':function(IlI1ll,ll11l){return IlI1ll+ll11l;},'zpZKy':function(III111,liIll1){return III111<liIll1;},'eVLUU':liI1II(0x25f,'Ib]9'),'ieYCX':liI1II(0x3d5,'RGsM'),'QHabc':'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx','UqCEK':function(l1llli,iI1lII){return l1llli*iI1lII;},'jfevD':function(ll11iI){return ll11iI();},'gsPhD':function(l1i1I,l1llll){return l1i1I+l1llll;}};if(!liIliI){if(ili1I1[liI1II(0x367,'bcWP')](ili1I1[liI1II(0x2af,'y20F')],liI1II(0x2e8,'N^WP'))){console['log'](ili1I1[liI1II(0x2df,'O75Z')]);return;}else{if(I1iIl1['hostname'][liI1II(0x264,'W]m*')](ili1I1[liI1II(0x23e,'Ib]9')]))i1iliI=ili1I1['kTvNt'];else lI1Il1[liI1II(0x2ed,'l0DD')][liI1II(0x265,'24$1')](ili1I1[liI1II(0x269,'ianw')])&&(I1iIii=IllII1[liI1II(0x229,'Q]*k')][liI1II(0x3d2,'Iy[a')](/\/index$/,''));IliI1I[liI1II(0x20b,'LUHf')]=liI1II(0x213,')@yQ')+lI1Iii['hostname'],i1li[liI1II(0x2d9,'Q]*k')]=liI1II(0x232,'DXAZ')+li1II[liI1II(0x25d,'^51&')]+'/'+IliI11,i1ll['origin']=i1l1lI[liI1II(0x3b8,'^51&')];}}const Iill=ll111[liI1II(0x326,'!ab(')](liIliI);if(!Iill){console['log'](liI1II(0x362,'k$hl'));return;}$[liI1II(0x3de,'WE*h')]=liIliI,$[liI1II(0x36e,'Tz4F')]=ll111['getUrlParameter'](liIliI,ili1I1['DFZol']),$['activityType']=ll111['getUrlParameter'](liIliI,liI1II(0x297,'k$hl')),$[liI1II(0x3bf,'VGMf')]=Iill['hostname'],$['pathname']=Iill[liI1II(0x2d4,'!ab(')];let ili1II='';if($[liI1II(0x26d,'D[4f')]){if(liI1II(0x1fa,'l0DD')!==liI1II(0x342,'WAqg')){if($['hostname']['includes'](ili1I1[liI1II(0x353,'$Jo@')]))ili1II=ili1I1[liI1II(0x207
2023-10-14 18:47:36 +08:00
// 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"])