KR/jd_lzkj_loreal_cart.js

24 lines
69 KiB
JavaScript
Raw Normal View History

2023-11-10 10:47:26 +08:00
/*
活动名称加购有礼超级无线
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10024&templateId=<模板id>&activityId=<活动id>&prd=cjwx
https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v1/index?activityType=10024&templateId=<模板id>&activityId=<活动id>&prd=cjwx
环境变量jd_lzkj_loreal_cart_url // 活动链接
jd_lzkj_loreal_cart_opencard // 是否入会true/false默认不入会
jd_lzkj_loreal_cart_Notify // 是否推送通知true/false默认不推送
jd_lzkj_loreal_cart_break // 493后继续执行默认退出运行true/false
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]
2023-11-10 10:47:26 +08:00
#加购有礼超级无线
1 1 1 1 * jd_lzkj_loreal_cart.js, tag=加购有礼超级无线, enabled=true
2023-07-27 16:14:01 +08:00
2023-11-10 10:47:26 +08:00
*/
2023-07-28 23:36:10 +08:00
2023-11-10 10:47:26 +08:00
const $ = new Env('加购有礼(超级无线)')
2023-11-12 16:44:11 +08:00
var version_='jsjiami.com.v7';const llIIIl=iii1II;(function(ili1i,IiIi1,l1Ii1,i1IilI,III1I1,ilI111,I1IllI){return ili1i=ili1i>>0x9,ilI111='hs',I1IllI='hs',function(IIlI11,iIIll1,llIIII,ilI11I,ili1I){const IiIiIi=iii1II;ilI11I='tfi',ilI111=ilI11I+ilI111,ili1I='up',I1IllI+=ili1I,ilI111=llIIII(ilI111),I1IllI=llIIII(I1IllI),llIIII=0x0;const iilIIl=IIlI11();while(!![]&&--i1IilI+iIIll1){try{ilI11I=-parseInt(IiIiIi(0x2be,'st[*'))/0x1+parseInt(IiIiIi(0x3a3,'2Wsi'))/0x2+-parseInt(IiIiIi(0x205,'i57R'))/0x3+parseInt(IiIiIi(0x1a8,'iKgm'))/0x4+parseInt(IiIiIi(0x269,'(4Ro'))/0x5+parseInt(IiIiIi(0x420,'[)gv'))/0x6+-parseInt(IiIiIi(0x1a9,'hSDH'))/0x7;}catch(i1Iili){ilI11I=llIIII;}finally{ili1I=iilIIl[ilI111]();if(ili1i<=i1IilI)llIIII?III1I1?ilI11I=ili1I:III1I1=ili1I:llIIII=ili1I;else{if(llIIII==III1I1['replace'](/[exrUSXVqNKFbOWDEyPh=]/g,'')){if(ilI11I===iIIll1){iilIIl['un'+ilI111](ili1I);break;}iilIIl[I1IllI](ili1I);}}}}}(l1Ii1,IiIi1,function(i1Iill,l1IiI,l1lill,i1li1,iIIllI,I1Ill1,ili11){return l1IiI='\x73\x70\x6c\x69\x74',i1Iill=arguments[0x0],i1Iill=i1Iill[l1IiI](''),l1lill=`\x72\x65\x76\x65\x72\x73\x65`,i1Iill=i1Iill[l1lill]('\x76'),i1li1=`\x6a\x6f\x69\x6e`,(0x14711f,i1Iill[i1li1](''));});}(0x19600,0x55884,Iii11l,0xcd),Iii11l)&&(version_=llIIIl(0x172,'FEg#'));const llliIl=require(llIIIl(0x2e5,'QCeR')),iliIli=require(llIIIl(0x18f,'OU!#')),illliI=require(llIIIl(0x3e1,'WDU5')),ii1III=require(llIIIl(0x3f8,'DP*E')),{loreal_savePrize:i11iIl}=require(llIIIl(0x1b3,'[)gv')),{wuxianDefense:ll11ll}=require('./function/jdCrypto'),l11iIl=process[llIIIl(0x14b,'(%ed')]['jd_lzkj_loreal_cart_url']||'',i11iIi=process[llIIIl(0x137,'tTJE')][llIIIl(0x1ad,'v(lH')]==='true',IIIIll=process[llIIIl(0x2ad,'Y]Bj')]['jd_lzkj_loreal_cart_Notify']===llIIIl(0x1a2,'^23H'),liiiii=process['env'][llIIIl(0x198,'qtK8')]===llIIIl(0x42e,'FEg#');let II1I='',lI1111='';const Ilil1=Object[llIIIl(0x2f2,'$ib[')](llliIl)[llIIIl(0x237,'shJn')](llIii=>llliIl[llIii])['filter'](IIiiI1=>IIiiI1);!Ilil1[0x0]&&($[llIIIl(0x3be,'^sK2')]($['name'],'【提示】请先获取Cookie'),process['exit'](0x1));!(async()=>{const IIlI1I=llIIIl,IIIIi1={'IAeyq':IIlI1I(0x3c6,'iKgm'),'lhCRQ':'不存在','YlRIo':IIlI1I(0x23d,'DP*E'),'uhoYi':IIlI1I(0x17b,'hXzo'),'cGikn':IIlI1I(0x191,'v(lH'),'STbMT':'lorealjdcampaign-rc','DEtlb':function(I1ll1l,I1ll1i){return I1ll1l!==I1ll1i;},'WyGgE':IIlI1I(0x1e4,'2@ZB'),'loclb':IIlI1I(0x275,'^39b'),'KJcXO':IIlI1I(0x429,'iKgm'),'GVuoJ':function(i11iII,lI1Ii1){return i11iII+lI1Ii1;},'nqjfQ':function(i1I11,I1I1i1){return i1I11<I1I1i1;},'fpTwU':function(i1I1l,i1I1i){return i1I1l+i1I1i;},'Dexhy':function(IIiiII,llIiI){return IIiiII(llIiI);},'jvwrg':'pt_pin','NMJKW':IIlI1I(0x2a8,'$ib['),'PWltQ':function(Ilill,Ilili){return Ilill*Ilili;},'Tnnxe':function(I1ll1I){return I1ll1I();}};if(!l11iIl){if(IIIIi1['uhoYi']===IIlI1I(0x383,'shJn')){IiilI1[IIlI1I(0x27c,'OU!#')](IIIIi1[IIlI1I(0x39c,'$ib[')]);return;}else{console[IIlI1I(0x1da,'TA^o')]('⚠\x20请先定义必要的环境变量后再运行脚本');return;}}const ii1IIl=iliIli['parseUrl'](l11iIl);if(!ii1IIl){console[IIlI1I(0x2ef,'DP*E')](IIIIi1[IIlI1I(0x1d1,'QCeR')]);return;}$[IIlI1I(0x2d8,'wgkE')]=l11iIl,$[IIlI1I(0x2c2,'mtB$')]=iliIli[IIlI1I(0x3a4,'TA^o')](l11iIl,'activityId'),$[IIlI1I(0x22a,'WDU5')]=iliIli[IIlI1I(0x449,'$ib[')](l11iIl,IIlI1I(0x2b7,'[)gv')),$[IIlI1I(0x218,'PSMY')]=ii1IIl['hostname'],$[IIlI1I(0x36b,'3u4M')]=ii1IIl[IIlI1I(0x39b,'(4Ro')];let ii1IIi='';if($[IIlI1I(0x13a,'^39b')]){if($[IIlI1I(0x218,'PSMY')][IIlI1I(0x458,'QCeR')](IIIIi1[IIlI1I(0x414,'1qu%')]))IIIIi1[IIlI1I(0x1bc,'OU!#')](IIIIi1[IIlI1I(0x13b,'njml')],IIIIi1[IIlI1I(0x443,'PIm%')])?([IIlI1I(0x446,'PSMY'),'结束',IIIIi1['lhCRQ'],'不在'][IIlI1I(0x160,'@f*%')](Iii1II=>iil1ii['resp_msg']['includes'](Iii1II))&&(IlIlli[IIlI1I(0x230,'pU77')]=!![]),[IIIIi1[IIlI1I(0x3df,'OU!#')]]['some'](llIlI=>il1i1i[IIlI1I(0x423,'[)gv')][IIlI1I(0x20d,'2@ZB')](llIlI))&&(lil111['skipRun']=!![]),iI11I1[IIlI1I(0x15c,'w#&D')](il1i1l[IIlI1I(0x37b,'7$M[')]),IlIlll[IIlI1I(0x2a9,'mtB$')]['fix'](IIIl1I[IIlI1I(0x3ae,'TA^o')])):ii1IIi=IIlI1I(0x417,'7$M[');else $[IIlI1I(0x2fe,'K)0z')][I
2023-07-27 16:14:01 +08:00
// prettier-ignore
2023-11-10 10:47:26 +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.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"])