KR/jd_lzkj_loreal_followGoods.js

22 lines
64 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/**
2023-11-10 11:28:39 +08:00
活动名称关注商品有礼超级无线
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10053&templateId=<模板id>&activityId=<活动id>&prd=cjwx
https://lzkj-isv.isvjcloud.com/prod/cc/interaction/v1/index?activityType=10053&templateId=<模板id>&activityId=<活动id>&prd=cjwx
2023-07-27 16:14:01 +08:00
环境变量jd_lzkj_loreal_followGoods_url // 活动链接
2023-11-10 11:28:39 +08:00
jd_lzkj_loreal_followGoods_opencard // 是否入会true/false默认不入会
jd_lzkj_loreal_followGoods_Notify // 是否推送通知true/false默认不推送
jd_lzkj_loreal_followGoods_break // 493后继续执行默认退出运行true/false
2023-07-27 16:14:01 +08:00
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
2023-11-10 11:28:39 +08:00
#关注商品有礼超级无线
1 1 1 1 * jd_lzkj_loreal_followGoods.js, tag=关注商品有礼超级无线, enabled=true
2023-07-27 16:14:01 +08:00
*/
2023-11-10 11:28:39 +08:00
const $ = new Env("关注商品有礼(超级无线)");
var version_='jsjiami.com.v7';const i1li1=iii1II;(function(liI1Il,I1iIi,iiiI1I,lilI11,Ili1II,ili1i,IiIi1){return liI1Il=liI1Il>>0x4,ili1i='hs',IiIi1='hs',function(l1Ii1,i1IilI,III1I1,ilI111,I1IllI){const l1lill=iii1II;ilI111='tfi',ili1i=ilI111+ili1i,I1IllI='up',IiIi1+=I1IllI,ili1i=III1I1(ili1i),IiIi1=III1I1(IiIi1),III1I1=0x0;const IIlI11=l1Ii1();while(!![]&&--lilI11+i1IilI){try{ilI111=parseInt(l1lill(0x2dd,'DeNP'))/0x1*(parseInt(l1lill(0x30b,'n4Fj'))/0x2)+-parseInt(l1lill(0x446,'SO#x'))/0x3*(-parseInt(l1lill(0x495,'RD#c'))/0x4)+-parseInt(l1lill(0x47b,'gy)@'))/0x5+-parseInt(l1lill(0x3ed,'62ce'))/0x6*(-parseInt(l1lill(0x2fa,'l]jM'))/0x7)+parseInt(l1lill(0x464,'n4Fj'))/0x8+-parseInt(l1lill(0x42c,'l]jM'))/0x9+-parseInt(l1lill(0x4aa,'!HMj'))/0xa;}catch(iIIll1){ilI111=III1I1;}finally{I1IllI=IIlI11[ili1i]();if(liI1Il<=lilI11)III1I1?Ili1II?ilI111=I1IllI:Ili1II=I1IllI:III1I1=I1IllI;else{if(III1I1==Ili1II['replace'](/[fFVgrtRHpUkPyWTlMnJDS=]/g,'')){if(ilI111===i1IilI){IIlI11['un'+ili1i](I1IllI);break;}IIlI11[IiIi1](I1IllI);}}}}}(iiiI1I,I1iIi,function(llIIII,ilI11I,ili1I,iilIIl,i1Iili,i1Iill,l1IiI){return ilI11I='\x73\x70\x6c\x69\x74',llIIII=arguments[0x0],llIIII=llIIII[ilI11I](''),ili1I=`\x72\x65\x76\x65\x72\x73\x65`,llIIII=llIIII[ili1I]('\x76'),iilIIl=`\x6a\x6f\x69\x6e`,(0x146d3a,llIIII[iilIIl](''));});}(0xc30,0x9455b,Iii11l,0xc5),Iii11l)&&(version_=i1li1(0x364,'ATs9'));const llIi1=require('./jdCookie'),IliIII=require(i1li1(0x2c6,'NM8T')),II1l=require(i1li1(0x3d1,'62ce')),liiiiI=require(i1li1(0x3e7,'A&^i')),{wuxianDefense:II1i}=require('./function/jdCrypto'),{loreal_savePrize:illli1}=require('./function/krsavePrize'),I1lII1=process[i1li1(0x237,'E[!3')][i1li1(0x2b7,'4Nm&')]||'',Ill111=process[i1li1(0x4ad,'!vK5')]['jd_lzkj_loreal_followGoods_opencard']===i1li1(0x2df,'Y#qp'),I1iI11=process['env']['jd_lzkj_loreal_followGoods_Notify']===i1li1(0x3d8,'62ce'),II11=process['env']['jd_lzkj_loreal_followGoods_break']===i1li1(0x2b8,'0raX');let l1ilII='',ii1II1='';const iliIll=Object[i1li1(0x3a3,'Kd9C')](llIi1)['map'](i11iIl=>llIi1[i11iIl])[i1li1(0x489,'a7EV')](ll11ll=>ll11ll);!iliIll[0x0]&&($[i1li1(0x2aa,'@$UQ')]($[i1li1(0x45a,'XETy')],i1li1(0x4af,'wtYx')),process[i1li1(0x404,'R)N7')](0x1));function iii1II(_0x5c7a35,_0xea7b98){const _0x349ca2=Iii11l();return iii1II=function(_0x5a93cf,_0x4d471d){_0x5a93cf=_0x5a93cf-0x1a6;let _0x3082de=_0x349ca2[_0x5a93cf];if(iii1II['WmhBqP']===undefined){var _0x507b8f=function(_0x9be51){const _0x4fc7e8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x252c74='',_0x4d97d6='';for(let _0x3c969d=0x0,_0x3822cd,_0x2e3cb7,_0x53fbb1=0x0;_0x2e3cb7=_0x9be51['charAt'](_0x53fbb1++);~_0x2e3cb7&&(_0x3822cd=_0x3c969d%0x4?_0x3822cd*0x40+_0x2e3cb7:_0x2e3cb7,_0x3c969d++%0x4)?_0x252c74+=String['fromCharCode'](0xff&_0x3822cd>>(-0x2*_0x3c969d&0x6)):0x0){_0x2e3cb7=_0x4fc7e8['indexOf'](_0x2e3cb7);}for(let _0x5d8462=0x0,_0x411d53=_0x252c74['length'];_0x5d8462<_0x411d53;_0x5d8462++){_0x4d97d6+='%'+('00'+_0x252c74['charCodeAt'](_0x5d8462)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4d97d6);};const _0x361e17=function(_0x2a4e58,_0x144e5e){let _0x54f3f8=[],_0x25c286=0x0,_0xebef3d,_0x320dd5='';_0x2a4e58=_0x507b8f(_0x2a4e58);let _0x23dd75;for(_0x23dd75=0x0;_0x23dd75<0x100;_0x23dd75++){_0x54f3f8[_0x23dd75]=_0x23dd75;}for(_0x23dd75=0x0;_0x23dd75<0x100;_0x23dd75++){_0x25c286=(_0x25c286+_0x54f3f8[_0x23dd75]+_0x144e5e['charCodeAt'](_0x23dd75%_0x144e5e['length']))%0x100,_0xebef3d=_0x54f3f8[_0x23dd75],_0x54f3f8[_0x23dd75]=_0x54f3f8[_0x25c286],_0x54f3f8[_0x25c286]=_0xebef3d;}_0x23dd75=0x0,_0x25c286=0x0;for(let _0x342f27=0x0;_0x342f27<_0x2a4e58['length'];_0x342f27++){_0x23dd75=(_0x23dd75+0x1)%0x100,_0x25c286=(_0x25c286+_0x54f3f8[_0x23dd75])%0x100,_0xebef3d=_0x54f3f8[_0x23dd75],_0x54f3f8[_0x23dd75]=_0x54f3f8[_0x25c286],_0x54f3f8[_0x25c286]=_0xebef3d,_0x320dd5+=String['fromCharCode'](_0x2a4e58['charCodeAt'](_0x342f27)^_0x54f3f8[(_0x54f3f8[_0x23dd75]+_0x54f3f8[_0x25c286])%0x100]);}return _0x320dd5;};iii1II['epGGxV']=_0x361e17,_0x5c7a35=arguments,iii1II['WmhBqP']=!![];}const _0x4c9d2=_0x349ca2[0x0],_0x5cbde
2023-07-27 16:14:01 +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"])