KR/jd_lzkj_loreal_lkFollowShop.js

16 lines
67 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
2023-10-06 11:59:10 +08:00
活动名称关注店铺有礼超级无线
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10069&templateId=<模板id>&activityId=<活动id>&prd=cjwx
https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v1/index?activityType=10069&templateId=<模板id>&activityId=<活动id>&prd=cjwx
https://lorealjdcampaign-rc.isvjcloud.com/interact/index?activityType=10069&templateId=<模板id>&activityId=<活动id>&prd=cjwx
2023-07-27 16:14:01 +08:00
环境变量jd_lzkj_loreal_lkFollowShop_url // 活动链接
2023-10-06 11:59:10 +08:00
jd_lzkj_loreal_lkFollowShop_opencard // 是否入会true/false默认不入会
jd_lzkj_loreal_lkFollowShop_Notify // 是否推送通知true/false默认不推送
jd_lzkj_loreal_lkFollowShop_break // 493后继续执行默认退出运行true/false
2023-07-27 16:14:01 +08:00
*/
2023-10-06 11:59:10 +08:00
const $ = new Env('关注店铺有礼(超级无线)')
2023-10-21 11:11:51 +08:00
var version_='jsjiami.com.v7';const iiI1IIIi=lIllI1ll;(function(I1Iill1l,l1IIll,Iil1ii1,lI11ll,lli1lI1I,iiIIIilI,il1iiii1){return I1Iill1l=I1Iill1l>>0x5,iiIIIilI='hs',il1iiii1='hs',function(IlIilIl1,l1iIIll,iIlIi1ii,liIllil1,IiliIiii){const ll11il1i=lIllI1ll;liIllil1='tfi',iiIIIilI=liIllil1+iiIIIilI,IiliIiii='up',il1iiii1+=IiliIiii,iiIIIilI=iIlIi1ii(iiIIIilI),il1iiii1=iIlIi1ii(il1iiii1),iIlIi1ii=0x0;const lIlliiiI=IlIilIl1();while(!![]&&--lI11ll+l1iIIll){try{liIllil1=-parseInt(ll11il1i(0x2c7,'$OWF'))/0x1+-parseInt(ll11il1i(0x3f8,'fu]A'))/0x2*(-parseInt(ll11il1i(0x25c,'tmLH'))/0x3)+parseInt(ll11il1i(0x245,'lNM0'))/0x4*(parseInt(ll11il1i(0x3f9,'JT)4'))/0x5)+-parseInt(ll11il1i(0x28f,'kSf0'))/0x6+parseInt(ll11il1i(0x238,'6$@L'))/0x7*(-parseInt(ll11il1i(0x161,'Yfzh'))/0x8)+-parseInt(ll11il1i(0x137,'Hc(A'))/0x9*(parseInt(ll11il1i(0x1a7,'j$oR'))/0xa)+parseInt(ll11il1i(0x132,'csnQ'))/0xb*(parseInt(ll11il1i(0x387,'JT)4'))/0xc);}catch(ll1IIII1){liIllil1=iIlIi1ii;}finally{IiliIiii=lIlliiiI[iiIIIilI]();if(I1Iill1l<=lI11ll)iIlIi1ii?lli1lI1I?liIllil1=IiliIiii:lli1lI1I=IiliIiii:iIlIi1ii=IiliIiii;else{if(iIlIi1ii==lli1lI1I['replace'](/[CKlxFGtwLDOfVhkXIUEH=]/g,'')){if(liIllil1===l1iIIll){lIlliiiI['un'+iiIIIilI](IiliIiii);break;}lIlliiiI[il1iiii1](IiliIiii);}}}}}(Iil1ii1,l1IIll,function(il1ll1il,I111IliI,li1i1i11,lliIilIl,IIiiIl1I,II1iI11l,liIi111l){return I111IliI='\x73\x70\x6c\x69\x74',il1ll1il=arguments[0x0],il1ll1il=il1ll1il[I111IliI](''),li1i1i11=`\x72\x65\x76\x65\x72\x73\x65`,il1ll1il=il1ll1il[li1i1i11]('\x76'),lliIilIl=`\x6a\x6f\x69\x6e`,(0x143add,il1ll1il[lliIilIl](''));});}(0x1920,0x6e1ad,li1IIiIi,0xcb),li1IIiIi)&&(version_=li1IIiIi);const iII1IIil=require('./jdCookie'),llIlIiI=require(iiI1IIIi(0x353,'QinN')),l1ii1iI=require(iiI1IIIi(0x3b4,'dyVz')),IlI1lIil=require(iiI1IIIi(0x275,'yZbq')),{loreal_savePrize:iil1Ill1}=require(iiI1IIIi(0x1e1,']Pnn')),liIli1il=process[iiI1IIIi(0x337,'CrZa')][iiI1IIIi(0x3bc,'s%*p')]||'',ll1Ii1Il=process['env'][iiI1IIIi(0x175,'cD*!')]===iiI1IIIi(0x12c,'6$@L'),I1iII11l=process['env'][iiI1IIIi(0x1ce,'DiEp')]==='true',lI11I1ii=process[iiI1IIIi(0x2b7,'k9zG')][iiI1IIIi(0x3a6,'JT)4')]===iiI1IIIi(0x3be,'kyDU');let iIilllll='',ili1lil1='';const i1IIil1l=Object[iiI1IIIi(0x33d,'k9zG')](iII1IIil)['map'](ii1llilI=>iII1IIil[ii1llilI])[iiI1IIIi(0x3fe,'H9S$')](iIIIlli=>iIIIlli);function lIllI1ll(_0x29d275,_0x3ceb24){const _0x338adc=li1IIiIi();return lIllI1ll=function(_0x34f10a,_0x11401b){_0x34f10a=_0x34f10a-0x11e;let _0x4dc76f=_0x338adc[_0x34f10a];if(lIllI1ll['JhCtoR']===undefined){var _0x8b49b2=function(_0x29b47e){const _0x3452b6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3ddacc='',_0x15c6fd='';for(let _0x3c3c17=0x0,_0x3782b7,_0x50b113,_0x4bd738=0x0;_0x50b113=_0x29b47e['charAt'](_0x4bd738++);~_0x50b113&&(_0x3782b7=_0x3c3c17%0x4?_0x3782b7*0x40+_0x50b113:_0x50b113,_0x3c3c17++%0x4)?_0x3ddacc+=String['fromCharCode'](0xff&_0x3782b7>>(-0x2*_0x3c3c17&0x6)):0x0){_0x50b113=_0x3452b6['indexOf'](_0x50b113);}for(let _0x47f925=0x0,_0x252fbe=_0x3ddacc['length'];_0x47f925<_0x252fbe;_0x47f925++){_0x15c6fd+='%'+('00'+_0x3ddacc['charCodeAt'](_0x47f925)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x15c6fd);};const _0x34e060=function(_0x181fd1,_0x5d306c){let _0x6d9cc8=[],_0xbe7891=0x0,_0x2f324f,_0x3bd90d='';_0x181fd1=_0x8b49b2(_0x181fd1);let _0x10df13;for(_0x10df13=0x0;_0x10df13<0x100;_0x10df13++){_0x6d9cc8[_0x10df13]=_0x10df13;}for(_0x10df13=0x0;_0x10df13<0x100;_0x10df13++){_0xbe7891=(_0xbe7891+_0x6d9cc8[_0x10df13]+_0x5d306c['charCodeAt'](_0x10df13%_0x5d306c['length']))%0x100,_0x2f324f=_0x6d9cc8[_0x10df13],_0x6d9cc8[_0x10df13]=_0x6d9cc8[_0xbe7891],_0x6d9cc8[_0xbe7891]=_0x2f324f;}_0x10df13=0x0,_0xbe7891=0x0;for(let _0x28b5c6=0x0;_0x28b5c6<_0x181fd1['length'];_0x28b5c6++){_0x10df13=(_0x10df13+0x1)%0x100,_0xbe7891=(_0xbe7891+_0x6d9cc8[_0x10df13])%0x100,_0x2f324f=_0x6d9cc8[_0x10df13],_0x6d9cc8[_0x10df13]=_0x6d9cc8[_0xbe7891],_0x6d9cc8[_0xbe7891]=_0x2f324f,_0x3bd90d+=String['fromCharCode'](_0x181fd1['charCodeAt'](_0x28b5c6)^_0x6d9cc8[(_0x6d9cc8[_0x10df13]+_0x6d9cc8[_0xbe7891])%0x100]);}re
2023-10-06 11:59:10 +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"])