faker3/jd_lzkj_loreal_invite.js

24 lines
93 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称邀请入会有礼超级无线
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=<10006/10070>&templateId=<模板id>&activityId=<活动id>&prd=cjwx
环境变量jd_lzkj_loreal_invite_url // 活动链接
jd_lzkj_loreal_address // 用户登记收货地址,按照顺序依次填写 收件人@手机号@省份@城市@区县@详细地址,多个用管道符分开
jd_lzkj_loreal_invite_myhelpnum // 自定义邀请人数
7 7 7 7 *
脚本已挂 懒得修 不建议使用
*/
const $ = new Env('邀请入会有礼(超级无线)')
const notify = $.isNode() ? require('./sendNotify') : ''
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
const getH5st = require('./function/getH5st3_0')
const getToken = require('./function/getToken')
var version_='jsjiami.com.v7';const lIliiIii=iil1l1i1;(function(lI1l1I,iIIi11i1,illliIIi,lliIiI1l,l1iIliIi,iii1I11I,lIIlllli){return lI1l1I=lI1l1I>>0x7,iii1I11I='hs',lIIlllli='hs',function(lll1lIll,Ii1I1I1I,lIIil,I1II1llI,i1lil1il){const l1I1iIiI=iil1l1i1;I1II1llI='tfi',iii1I11I=I1II1llI+iii1I11I,i1lil1il='up',lIIlllli+=i1lil1il,iii1I11I=lIIil(iii1I11I),lIIlllli=lIIil(lIIlllli),lIIil=0x0;const ilI1111l=lll1lIll();while(!![]&&--lliIiI1l+Ii1I1I1I){try{I1II1llI=-parseInt(l1I1iIiI(0x610,'b&0T'))/0x1*(-parseInt(l1I1iIiI(0x601,'&AH1'))/0x2)+parseInt(l1I1iIiI(0x3fa,']4E1'))/0x3*(-parseInt(l1I1iIiI(0x337,'bIpi'))/0x4)+-parseInt(l1I1iIiI(0x23b,'!qZk'))/0x5+-parseInt(l1I1iIiI(0x490,'e)qY'))/0x6*(parseInt(l1I1iIiI(0x344,'5yM1'))/0x7)+parseInt(l1I1iIiI(0x281,'&u&1'))/0x8+-parseInt(l1I1iIiI(0x5a0,'w9v9'))/0x9*(parseInt(l1I1iIiI(0x4aa,']c7B'))/0xa)+parseInt(l1I1iIiI(0x683,'e)qY'))/0xb*(parseInt(l1I1iIiI(0x39c,'w9v9'))/0xc);}catch(I1i1liI){I1II1llI=lIIil;}finally{i1lil1il=ilI1111l[iii1I11I]();if(lI1l1I<=lliIiI1l)lIIil?l1iIliIi?I1II1llI=i1lil1il:l1iIliIi=i1lil1il:lIIil=i1lil1il;else{if(lIIil==l1iIliIi['replace'](/[ebPIYHKXThwARQtJfWn=]/g,'')){if(I1II1llI===Ii1I1I1I){ilI1111l['un'+iii1I11I](i1lil1il);break;}ilI1111l[lIIlllli](i1lil1il);}}}}}(illliIIi,iIIi11i1,function(llIiiil1,lilIi1i,II11ii1l,illiili,lIii1i1i,iI1IIlii,iIIi1Iii){return lilIi1i='\x73\x70\x6c\x69\x74',llIiiil1=arguments[0x0],llIiiil1=llIiiil1[lilIi1i](''),II11ii1l=`\x72\x65\x76\x65\x72\x73\x65`,llIiiil1=llIiiil1[II11ii1l]('\x76'),illiili=`\x6a\x6f\x69\x6e`,(0x13d047,llIiiil1[illiili](''));});}(0x5f80,0x27a56,ii11ll,0xc1),ii11ll)&&(version_=ii11ll);let lz_cookie={},activityUrl=process[lIliiIii(0x203,'e)qY')][lIliiIii(0x5fb,'!6Y@')],activityCookie='',inviterNick='';$[lIliiIii(0x534,'vKqs')]=![];let myCode=null,myhelpnum=process[lIliiIii(0x39a,'L48P')][lIliiIii(0x4d4,'JaS1')]||null,cookiesArr=[],cookie='',message='',messageTitle='';if($[lIliiIii(0x298,'!qZk')]()){if(process[lIliiIii(0x293,']4E1')][lIliiIii(0x25b,'&AH1')])activityUrl=process[lIliiIii(0x20f,'[m1W')][lIliiIii(0x25d,'9VEi')];if(JSON[lIliiIii(0x263,'$gg7')](process[lIliiIii(0x260,'&AH1')])[lIliiIii(0x21e,'ZAl5')](lIliiIii(0x4bb,'9VEi'))>-0x1)process[lIliiIii(0x600,'ZlJl')](0x0);Object[lIliiIii(0x4f6,'ah46')](jdCookieNode)[lIliiIii(0x527,'!qZk')](lI1l11li=>{const illi=lIliiIii;cookiesArr[illi(0x2f8,'hHK^')](jdCookieNode[lI1l11li]);});if(process[lIliiIii(0x2d8,'5yM1')][lIliiIii(0x27b,'^^oN')]&&process[lIliiIii(0x551,'Y538')][lIliiIii(0x2b5,'UR)v')]===lIliiIii(0x365,'&u&1'))console[lIliiIii(0x585,'w9v9')]=()=>{};}else cookiesArr=[$[lIliiIii(0x3f0,'1wIC')](lIliiIii(0x4e6,'9VEi')),$[lIliiIii(0x327,'L48P')](lIliiIii(0x55b,'5yM1')),...$[lIliiIii(0x1d1,'ah46')]($[lIliiIii(0x299,'Y538')](lIliiIii(0x666,'Mh@F'))||'[]')[lIliiIii(0x273,'uKWA')](I1i1iIlI=>I1i1iIlI[lIliiIii(0x2fb,'g[]6')])][lIliiIii(0x646,'0oV$')](lIIi111=>!!lIIi111);let isGetCookie=typeof $request!==lIliiIii(0x1dd,'9VEi');isGetCookie&&(GetCookie(),$[lIliiIii(0x206,'bHUG')]());if(activityUrl){const mFhbxp=lIliiIii(0x209,'JaS1')[lIliiIii(0x352,'^^oN')]('|');let rOUeVh=0x0;while(!![]){switch(mFhbxp[rOUeVh++]){case'0':if(activityUrl[lIliiIii(0x66f,'1wIC')](lIliiIii(0x2de,'ZAl5')))wxActType=lIliiIii(0x4a6,'aFXX');else{if(activityUrl[lIliiIii(0x2c5,'M4Z6')](lIliiIii(0x529,'5yM1')))wxActType=activityUrl[lIliiIii(0x63e,'&u&1')](/\/(prod\/cc\/interact\w*)\//)[0x1];else{console[lIliiIii(0x59e,'Y538')](lIliiIii(0x23a,']4E1'));return;}}continue;case'1':activityId=getQueryString(''+activityUrl,lIliiIii(0x492,'M4Z6'));continue;case'2':$[lIliiIii(0x2bb,'^^oN')]=activityUrl[lIliiIii(0x5ee,'vCgn')](/https?:\/\/([^/]+)/)[0x1];continue;case'3':activityType=getQueryString(''+activityUrl,lIliiIii(0x447,'M4Z6'));continue;case'4':templateId=getQueryString(''+activityUrl,lIliiIii(0x2c0,'9VEi'));continue;}break;}}let domains=lIliiIii(0x588,'L$s!')+$[lIliiIii(0x2bb,'^^oN')];!(async()=>{const liiI1l1i=lIliiIii,l1iIllIi={'uAdgs':liiI1l1i(0x4a8,'!qZk'),'yyXNi':function(i1IIIii,Iil1iIlI){return i1IIIii!=Iil1iIlI;},'pPyMC':liiI1l1i(0x5d4,'WYb]'),'ErjOl':function(Iilllii,ii11lI11){return Ii
// 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"])