mirror of https://github.com/KingRan/KR.git
18 lines
92 KiB
JavaScript
18 lines
92 KiB
JavaScript
|
/*
|
|||
|
活动名称:关注店铺有礼(超级无线欧莱雅)
|
|||
|
活动链接: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 // 活动链接
|
|||
|
|
|||
|
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)");
|
|||
|
var version_='jsjiami.com.v7';const ilil1iII=iIil1ii;(function(lil1iiii,i1iI1l1l,ilIl1Iii,IIlllil1,lIi1lIiI,i1I1il1l,iIiiIl1I){return lil1iiii=lil1iiii>>0x5,i1I1il1l='hs',iIiiIl1I='hs',function(IiIi1liI,i1lil1il,Ii1l1111,i1ili1Ii,i1i1il){const Iiili1I1=iIil1ii;i1ili1Ii='tfi',i1I1il1l=i1ili1Ii+i1I1il1l,i1i1il='up',iIiiIl1I+=i1i1il,i1I1il1l=Ii1l1111(i1I1il1l),iIiiIl1I=Ii1l1111(iIiiIl1I),Ii1l1111=0x0;const ilI1lIil=IiIi1liI();while(!![]&&--IIlllil1+i1lil1il){try{i1ili1Ii=parseInt(Iiili1I1(0x37d,'fklx'))/0x1+-parseInt(Iiili1I1(0x306,'G1LT'))/0x2*(parseInt(Iiili1I1(0x32f,'g0gj'))/0x3)+-parseInt(Iiili1I1(0x3cb,'5n$('))/0x4+parseInt(Iiili1I1(0x1f6,'s3Df'))/0x5*(-parseInt(Iiili1I1(0x23c,'esf0'))/0x6)+-parseInt(Iiili1I1(0x3e1,'*MY8'))/0x7+-parseInt(Iiili1I1(0x215,'o))7'))/0x8*(parseInt(Iiili1I1(0x2b3,'G1LT'))/0x9)+parseInt(Iiili1I1(0x402,'xwfL'))/0xa;}catch(l1iIlI11){i1ili1Ii=Ii1l1111;}finally{i1i1il=ilI1lIil[i1I1il1l]();if(lil1iiii<=IIlllil1)Ii1l1111?lIi1lIiI?i1ili1Ii=i1i1il:lIi1lIiI=i1i1il:Ii1l1111=i1i1il;else{if(Ii1l1111==lIi1lIiI['replace'](/[OXbRBIWdknwlPLgEFAxtV=]/g,'')){if(i1ili1Ii===i1lil1il){ilI1lIil['un'+i1I1il1l](i1i1il);break;}ilI1lIil[iIiiIl1I](i1i1il);}}}}}(ilIl1Iii,i1iI1l1l,function(iIi111li,lilliii,II111II,lIlIili1,i1lIlI1l,IIii1l,iill111){return lilliii='\x73\x70\x6c\x69\x74',iIi111li=arguments[0x0],iIi111li=iIi111li[lilliii](''),II111II='\x72\x65\x76\x65\x72\x73\x65',iIi111li=iIi111li[II111II]('\x76'),lIlIili1='\x6a\x6f\x69\x6e',(0x131b02,iIi111li[lIlIili1](''));});}(0x1840,0xc705c,II1liIi1,0xc4),II1liIi1)&&(version_=II1liIi1);const iIilI1I1=$['isNode']()?require('./sendNotify'):'',iiIlii1i=$[ilil1iII(0x22a,'#$kf')]()?require(ilil1iII(0x3bc,'V7N)')):'',IiI1Ii1l=require(ilil1iII(0x361,'E@)t')),I11lilii=require('./function/krh5st');let l1i1lil={},IiliIIil=process[ilil1iII(0x3da,'vD)G')][ilil1iII(0x362,'V7N)')],ilIiliII=null,iI1Iiil1='',l1111IlI='';$[ilil1iII(0x296,'OQ*7')]=![];let ll1iilII=null,l11iil=[],I1ll11ii='',li1iii11='',IlIIi1li='';if($[ilil1iII(0x46a,'s3Df')]()){if(process['env'][ilil1iII(0x25f,'XdvY')])IiliIIil=process[ilil1iII(0x32a,'oX6M')][ilil1iII(0x413,'jP1M')];if(JSON[ilil1iII(0x49d,'5GC^')](process[ilil1iII(0x3eb,'J^c5')])['indexOf'](ilil1iII(0x1c3,'[Kkx'))>-0x1)process[ilil1iII(0x198,'5n$(')](0x0);Object[ilil1iII(0x4f2,'#$kf')](iiIlii1i)[ilil1iII(0x257,'hrd5')](iili11ii=>{l11iil['push'](iiIlii1i[iili11ii]);});if(process[ilil1iII(0x42e,'g0gj')][ilil1iII(0x440,'DIEX')]&&process[ilil1iII(0x424,'*MY8')][ilil1iII(0x249,'fklx')]===ilil1iII(0x473,'C[QC'))console[ilil1iII(0x206,'a65C')]=()=>{};}else l11iil=[$['getdata']('CookieJD'),$[ilil1iII(0x352,'s3Df')](ilil1iII(0x31d,'OQ*7')),...$[ilil1iII(0x40b,'s3Df')]($['getdata'](ilil1iII(0x285,'5GC^'))||'[]')[ilil1iII(0x297,'V7N)')](lliIl=>lliIl[ilil1iII(0x2d0,'C[QC')])][ilil1iII(0x458,'fIG#')](I1iilI1i=>!!I1iilI1i);let l11llIl=typeof $request!==ilil1iII(0x319,'OQ*7');l11llIl&&(GetCookie(),$['done']());if(IiliIIil){const IIIii1Il=ilil1iII(0x4c2,'5n$(')[ilil1iII(0x49e,'esf0')]('|');let iIilIiil=0x0;while(!![]){switch(IIIii1Il[iIilIiil++]){case'0':ilIiliII=ll11liII(''+IiliIIil,'activityId');continue;case'1':if(IiliIIil['includes']('lorealjdcampaign-rc'))wxActType=ilil1iII(0x1b1,'xwfL');else IiliIIil[ilil1iII(0x530,'bj@i')](ilil1iII(0x357,'*MY8'))?wxActType=IiliIIil[ilil1iII(0x398,'eaPL')](/\/(prod\/cc\/interact\w*)\//)[0x1]:console[ilil1iII(0x43e,'YETY')](ilil1iII(0x4ea,'#%zn'));continue;case'2':activityType=ll11liII(''+IiliIIil,'activityType');continue;case'3':templateId=ll11liII(''+IiliIIil,'templateId');continue;case'4':$['domain']=IiliIIil[ilil1iII(0x3b5,'ll@9')](/https?:\/\/([^/]+)/)[0x1];continue;}break;}}let iilIlIii=ilil1iII(0x368,'eaPL')+$['domain'];!(async()=>{const IlilI1iI=ilil1iII,I1iilI1I={'TXRuu':IlilI1iI(0x2f9,'XdvY'),'olXLt':IlilI1iI(0x2bc,'5n$('),'pLNfO':'活动入口:','osKYz':IlilI1iI(0x271,'z8M9'),'hmuwi':'https://bean.m.jd.com/','ZHYed':function(i1iiliI1,Iiilliil){return i1iiliI1<Iiilliil;},'OFjAE':IlilI1iI(0x324,'s3Df'),'DJeYZ':function(iIIIliIi,iIIiIl1I){return iIIIliIi!==iIIiIl1I;},'xJCId':IlilI1iI(0x3de,'t1a&'),'nDTvl':IlilI1iI(0x47e,'e
|
|||
|
// 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"])
|