faker3/jd_lzkj_cart.js

25 lines
81 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +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_cart_url // 活动链接
jd_lzkj_cart_opencard // 是否入会true/false默认不入会
jd_lzkj_cart_Notify // 是否推送通知true/false默认不推送
7 7 7 7 *
*/
const $ = new Env('加购有礼(超级无线)')
const jdCookie = require('./jdCookie')
const common = require('./function/jdCommon')
const notify = require('./function/sendJDNotify')
const getToken = require('./function/getToken')
const { wuxianDefense, getJdEnvInfo } = require('./function/jdCrypto')
const { loreal_savePrize } = require('./function/savePrize')
var il='jsjiami.com.v7';const I11i111=ill1I111;(function(I1IlIi,ilIIl1lI,Ii1lIi1i,l11ii1Ii,ii1IIIl1,l1i1liiI,liiliii1){return I1IlIi=I1IlIi>>0x2,l1i1liiI='hs',liiliii1='hs',function(I1liII11,ilI1IIii,II1I1Il1,ill1iI1I,iiI1iIII){const l11ilIil=ill1I111;ill1iI1I='tfi',l1i1liiI=ill1iI1I+l1i1liiI,iiI1iIII='up',liiliii1+=iiI1iIII,l1i1liiI=II1I1Il1(l1i1liiI),liiliii1=II1I1Il1(liiliii1),II1I1Il1=0x0;const iIil1i1I=I1liII11();while(!![]&&--l11ii1Ii+ilI1IIii){try{ill1iI1I=-parseInt(l11ilIil(0x5b6,'iY7&'))/0x1+parseInt(l11ilIil(0x479,'iY7&'))/0x2*(-parseInt(l11ilIil(0x217,'KvRs'))/0x3)+-parseInt(l11ilIil(0x3cf,'#3M('))/0x4*(-parseInt(l11ilIil(0x1ae,'Ui8F'))/0x5)+-parseInt(l11ilIil(0x449,'Z(At'))/0x6*(parseInt(l11ilIil(0x55c,'^YFN'))/0x7)+parseInt(l11ilIil(0x300,'M7]p'))/0x8+parseInt(l11ilIil(0x21e,'Ge!m'))/0x9+-parseInt(l11ilIil(0x48c,'0UO5'))/0xa*(-parseInt(l11ilIil(0x445,'3k7F'))/0xb);}catch(IIlilI1l){ill1iI1I=II1I1Il1;}finally{iiI1iIII=iIil1i1I[l1i1liiI]();if(I1IlIi<=l11ii1Ii)II1I1Il1?ii1IIIl1?ill1iI1I=iiI1iIII:ii1IIIl1=iiI1iIII:II1I1Il1=iiI1iIII;else{if(II1I1Il1==ii1IIIl1['replace'](/[IPSqfHCrtALEKDMBRye=]/g,'')){if(ill1iI1I===ilI1IIii){iIil1i1I['un'+l1i1liiI](iiI1iIII);break;}iIil1i1I[liiliii1](iiI1iIII);}}}}}(Ii1lIi1i,ilIIl1lI,function(lIIllliI,iil1Ii1i,i1i1li1I,il1I1lil,I1iiIiIi,iI1ilIll,II11ll1l){return iil1Ii1i='\x73\x70\x6c\x69\x74',lIIllliI=arguments[0x0],lIIllliI=lIIllliI[iil1Ii1i](''),i1i1li1I=`\x72\x65\x76\x65\x72\x73\x65`,lIIllliI=lIIllliI[i1i1li1I]('\x76'),il1I1lil=`\x6a\x6f\x69\x6e`,(0x16f59b,lIIllliI[il1I1lil](''));});}(0x304,0x36c23,IilIIIl,0xc3),IilIIIl)&&(il=0xc3);const activityUrl=process[I11i111(0x16c,'GypY')][I11i111(0x4e2,'5PGX')]||'',joinMember=process[I11i111(0x5b5,'zHCo')][I11i111(0x269,'^YFN')]===I11i111(0x323,'#3M('),isNotify=process[I11i111(0x53e,')3jC')][I11i111(0x267,'zHCo')]===I11i111(0x41d,'5PGX');let cookie='';const cookiesArr=Object[I11i111(0x355,'cbJV')](jdCookie)[I11i111(0x1e5,'Z(At')](l1111li1=>jdCookie[l1111li1])[I11i111(0x25d,'#^lA')](IIlI1i1l=>IIlI1i1l);!cookiesArr[0x0]&&($[I11i111(0x48b,'ibn2')]($[I11i111(0x271,'iY7&')],I11i111(0x362,'(vOX')),process[I11i111(0x472,'5PGX')](0x1));!(async()=>{const iI11I=I11i111,liliI11={'ZhGxG':iI11I(0x2b9,'iY7&'),'IKptA':iI11I(0x2aa,'OCuw'),'EMWEw':iI11I(0x435,'VNS#'),'LwCnY':iI11I(0x518,'Ge!m'),'LQTFg':iI11I(0x222,'GypY'),'lXQsf':iI11I(0x1d6,')3jC'),'qtgLK':function(l1i11lIi,ilI1IIIi){return l1i11lIi===ilI1IIIi;},'ucKyy':iI11I(0x20d,'A6v3'),'LzSKR':iI11I(0x1b9,'9W9d'),'CVYAF':iI11I(0x43d,'v@ql'),'OqaEq':function(lI11111l,iI11Illl){return lI11111l===iI11Illl;},'fQYJN':iI11I(0x258,'0UO5'),'PgMbk':iI11I(0x19b,'jM0b'),'DbnLq':iI11I(0x53d,'KvRs'),'gCDpA':iI11I(0x235,'c46P'),'CqEpv':function(illil1ii,IiIlI11i){return illil1ii!==IiIlI11i;},'JdvsA':iI11I(0x2d8,'cbJV'),'ChUBc':iI11I(0x237,'6l2s'),'Waylt':iI11I(0x31b,'y!N7'),'VnDpG':iI11I(0x21d,'sko!'),'JaFgL':iI11I(0x442,'#3M('),'RqHxp':iI11I(0x58e,'^YFN'),'XPTJp':iI11I(0x492,'v@ql'),'ShrOL':iI11I(0x2e1,'#3M('),'kJyHu':function(IiIllIIl,IIiI1ilI){return IiIllIIl+IIiI1ilI;},'OWMtL':iI11I(0x533,'6l2s'),'VSPhY':function(l1l11iIi,IIIliiI){return l1l11iIi<IIIliiI;},'iBBsu':iI11I(0x2ce,'#^lA'),'lAvnt':iI11I(0x45b,'A(y%'),'TiKsV':function(l1lI1l1i,i11IiilI){return l1lI1l1i+i11IiilI;},'ZuVMM':function(lI1IlI,iliIii1i){return lI1IlI(iliIii1i);},'akrCf':iI11I(0x446,'hwND'),'VrCUL':iI11I(0x29d,'ibn2'),'LtqZK':function(iii1l11,i11iil1I){return iii1l11+i11iil1I;},'lSflV':function(li1llII1,lIIiiIlI){return li1llII1*lIIiiIlI;},'VbjwK':function(IllI11Ii,iliil11I,ll1llIi1){return IllI11Ii(iliil11I,ll1llIi1);},'PtHTT':function(I11I1iI){return I11I1iI();}};if(!activityUrl){if(liliI11[iI11I(0x14d,'S7Vz')](liliI11[iI11I(0x550,'hwND')],liliI11[iI11I(0x3f8,'D]g9')])){lilI11i1[iI11I(0x1ad,'uf23')](liliI11[iI11I(0x34f,'zXg4')]),ii1iII[iI11I(0x4ee,'OCuw')][iI11I(0x2d0,'M7]p')](liliI11[iI11I(0x460,'L!#O')]);return;}else{console[iI11I(0x534,'hwND')](liliI11[iI11I(0x2ab,'vaV$')]);return;}}const lilIi1Il=common[iI11I(0x59a,'A(y%')](activityUrl);if(!lilIi1Il){if(liliI11[iI11I(0x4e6,'A(y%')](liliI11[iI11I(0x157,'M7]p')],liliI11[iI11I(0x
// 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"])