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('加购有礼(超级无线)')
var version_='jsjiami.com.v7';const l1IIl1=iii1II;(function(iIIliI,IiIil,IiIii,iill1l,IiIiII,iill1i,l1Il1){return iIIliI=iIIliI>>0x7,iill1i='hs',l1Il1='hs',function(iill11,I1IliI,III1II,l1I1II,iIIlil){const III1=iii1II;l1I1II='tfi',iill1i=l1I1II+iill1i,iIIlil='up',l1Il1+=iIIlil,iill1i=III1II(iill1i),l1Il1=III1II(l1Il1),III1II=0x0;const IiIiI1=iill11();while(!![]&&--iill1l+I1IliI){try{l1I1II=parseInt(III1(0x405,'j@vM'))/0x1+-parseInt(III1(0x21a,'SuBU'))/0x2*(parseInt(III1(0x2a8,'Z^Rb'))/0x3)+-parseInt(III1(0x20a,'KLVQ'))/0x4*(-parseInt(III1(0x1d6,'m^3Q'))/0x5)+parseInt(III1(0x20e,'4*MH'))/0x6*(-parseInt(III1(0x1ab,'xNQa'))/0x7)+-parseInt(III1(0x200,'96nv'))/0x8*(parseInt(III1(0x1dd,'Lg@i'))/0x9)+parseInt(III1(0x376,'74wf'))/0xa*(-parseInt(III1(0x319,'4*MH'))/0xb)+parseInt(III1(0x377,'jwTX'))/0xc;}catch(iIIlii){l1I1II=III1II;}finally{iIIlil=IiIiI1[iill1i]();if(iIIliI<=iill1l)III1II?IiIiII?l1I1II=iIIlil:IiIiII=iIIlil:III1II=iIIlil;else{if(III1II==IiIiII['replace'](/[ObPthfSTMwJrlInYBKAG=]/g,'')){if(l1I1II===I1IliI){IiIiI1['un'+iill1i](iIIlil);break;}IiIiI1[l1Il1](iIIlil);}}}}}(IiIii,IiIil,function(llIII1,IiIiI,iill1I,Illi1,l1iiIl,lIIi1i,liI11I){return IiIiI='\x73\x70\x6c\x69\x74',llIII1=arguments[0x0],llIII1=llIII1[IiIiI](''),iill1I=`\x72\x65\x76\x65\x72\x73\x65`,llIII1=llIII1[iill1I]('\x76'),Illi1=`\x6a\x6f\x69\x6e`,(0x146d12,llIII1[Illi1](''));});}(0x6400,0xdfb7b,Iii11l,0xca),Iii11l)&&(version_=l1IIl1(0x41c,'Hz)t'));const I1ll1l=require(l1IIl1(0x2dd,'2!bl')),I1ll1i=require(l1IIl1(0x432,'GXzu')),i11iII=require('./function/sendJDNotify'),lI1Ii1=require(l1IIl1(0x1f5,'5rP%')),{loreal_savePrize:i1I11}=require(l1IIl1(0x1f3,'KskN')),{wuxianDefense:I1I1i1}=require(l1IIl1(0x344,'iH[O')),i1I1l=process['env'][l1IIl1(0x39c,'96nv')]||'',i1I1i=process[l1IIl1(0x3ac,'jwTX')][l1IIl1(0x2ee,'vN]&')]==='true',IIiiII=process[l1IIl1(0x27f,'zb&5')]['jd_lzkj_loreal_cart_Notify']===l1IIl1(0x225,'db[X'),llIiI=process['env'][l1IIl1(0x1da,'xNQa')]==='true';let Ilill='',Ilili='';function iii1II(_0x234f9e,_0x22dc88){const _0x214dea=Iii11l();return iii1II=function(_0x3eee72,_0x3cb82c){_0x3eee72=_0x3eee72-0xfe;let _0x3ae292=_0x214dea[_0x3eee72];if(iii1II['VyfBvN']===undefined){var _0x34215d=function(_0x547185){const _0x5a1b1e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5eac3a='',_0x2464c5='';for(let _0x5b48f5=0x0,_0x116e8a,_0x26b32c,_0x17f60b=0x0;_0x26b32c=_0x547185['charAt'](_0x17f60b++);~_0x26b32c&&(_0x116e8a=_0x5b48f5%0x4?_0x116e8a*0x40+_0x26b32c:_0x26b32c,_0x5b48f5++%0x4)?_0x5eac3a+=String['fromCharCode'](0xff&_0x116e8a>>(-0x2*_0x5b48f5&0x6)):0x0){_0x26b32c=_0x5a1b1e['indexOf'](_0x26b32c);}for(let _0x42bf23=0x0,_0x45d2b9=_0x5eac3a['length'];_0x42bf23<_0x45d2b9;_0x42bf23++){_0x2464c5+='%'+('00'+_0x5eac3a['charCodeAt'](_0x42bf23)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2464c5);};const _0x3c0258=function(_0x38bf93,_0x354530){let _0xa86f02=[],_0x2d9f69=0x0,_0x380bb7,_0xa433c3='';_0x38bf93=_0x34215d(_0x38bf93);let _0x267b31;for(_0x267b31=0x0;_0x267b31<0x100;_0x267b31++){_0xa86f02[_0x267b31]=_0x267b31;}for(_0x267b31=0x0;_0x267b31<0x100;_0x267b31++){_0x2d9f69=(_0x2d9f69+_0xa86f02[_0x267b31]+_0x354530['charCodeAt'](_0x267b31%_0x354530['length']))%0x100,_0x380bb7=_0xa86f02[_0x267b31],_0xa86f02[_0x267b31]=_0xa86f02[_0x2d9f69],_0xa86f02[_0x2d9f69]=_0x380bb7;}_0x267b31=0x0,_0x2d9f69=0x0;for(let _0x575947=0x0;_0x575947<_0x38bf93['length'];_0x575947++){_0x267b31=(_0x267b31+0x1)%0x100,_0x2d9f69=(_0x2d9f69+_0xa86f02[_0x267b31])%0x100,_0x380bb7=_0xa86f02[_0x267b31],_0xa86f02[_0x267b31]=_0xa86f02[_0x2d9f69],_0xa86f02[_0x2d9f69]=_0x380bb7,_0xa433c3+=String['fromCharCode'](_0x38bf93['charCodeAt'](_0x575947)^_0xa86f02[(_0xa86f02[_0x267b31]+_0xa86f02[_0x2d9f69])%0x100]);}return _0xa433c3;};iii1II['ZjCRZs']=_0x3c0258,_0x234f9e=arguments,iii1II['VyfBvN']=!![];}const _0x2b85f3=_0x214dea[0x0],_0x36800e=_0x3eee72+_0x2b85f3,_0x1e20ee=_0x234f9e[_0x36800e];return!_0x1e20ee?(iii1II['SvasdV']===undefined&&(iii1II['SvasdV']=!![]),_0x3ae292=iii1II['ZjCRZs'](_0x3ae292,_0x3cb82c),_0x234f9e[_0x36800e]=_0x3ae292):_0x3ae292=_0x1e20e
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"])