faker3/jd_lzkj_followGoods.js

25 lines
80 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +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
环境变量jd_lzkj_followGoods_url // 活动链接
jd_lzkj_followGoods_opencard // 是否入会true/false默认不入会
jd_lzkj_followGoods_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 I11iiIiI=l1l1iIi1;(function(IiIiIIi,l1II11il,lilIlIIi,I1il111l,IlI1llIl,Ilii1i1i,IllIiIil){return IiIiIIi=IiIiIIi>>0x5,Ilii1i1i='hs',IllIiIil='hs',function(I11i1I11,lI1lIl1,iiII11Il,iliI11ll,lli1iiI){const liIiIili=l1l1iIi1;iliI11ll='tfi',Ilii1i1i=iliI11ll+Ilii1i1i,lli1iiI='up',IllIiIil+=lli1iiI,Ilii1i1i=iiII11Il(Ilii1i1i),IllIiIil=iiII11Il(IllIiIil),iiII11Il=0x0;const llI1lIll=I11i1I11();while(!![]&&--I1il111l+lI1lIl1){try{iliI11ll=-parseInt(liIiIili(0x5fd,'FdHh'))/0x1*(-parseInt(liIiIili(0x42c,'P*Sg'))/0x2)+-parseInt(liIiIili(0x3f9,'IF4E'))/0x3*(-parseInt(liIiIili(0x591,'GSRk'))/0x4)+-parseInt(liIiIili(0x4a9,'M!Mg'))/0x5+parseInt(liIiIili(0x2de,'&VvY'))/0x6+-parseInt(liIiIili(0x32e,'4d23'))/0x7*(-parseInt(liIiIili(0x3ce,'d*%p'))/0x8)+parseInt(liIiIili(0x201,'KEra'))/0x9+-parseInt(liIiIili(0x59e,'c0HN'))/0xa;}catch(llIliiil){iliI11ll=iiII11Il;}finally{lli1iiI=llI1lIll[Ilii1i1i]();if(IiIiIIi<=I1il111l)iiII11Il?IlI1llIl?iliI11ll=lli1iiI:IlI1llIl=lli1iiI:iiII11Il=lli1iiI;else{if(iiII11Il==IlI1llIl['replace'](/[qgnVUOTBlYGNQfPCWh=]/g,'')){if(iliI11ll===lI1lIl1){llI1lIll['un'+Ilii1i1i](lli1iiI);break;}llI1lIll[IllIiIil](lli1iiI);}}}}}(lilIlIIi,l1II11il,function(IliiiiIi,illI1iii,iliIIili,l1il1lIi,iIIlIiI1,II1l1I1I,lI1lIl1l){return illI1iii='\x73\x70\x6c\x69\x74',IliiiiIi=arguments[0x0],IliiiiIi=IliiiiIi[illI1iii](''),iliIIili=`\x72\x65\x76\x65\x72\x73\x65`,IliiiiIi=IliiiiIi[iliIIili]('\x76'),l1il1lIi=`\x6a\x6f\x69\x6e`,(0x16f5a0,IliiiiIi[l1il1lIi](''));});}(0x1780,0xbde09,lIIli11,0xbe),lIIli11)&&(il=I11iiIiI(0x63a,'lSd1'));function l1l1iIi1(_0x4b2777,_0x14c5a3){const _0x54ba1b=lIIli11();return l1l1iIi1=function(_0x315d56,_0x50d66a){_0x315d56=_0x315d56-0x1c5;let _0x41bff9=_0x54ba1b[_0x315d56];if(l1l1iIi1['GEEnpN']===undefined){var _0x39e6ee=function(_0xd180d9){const _0x1f28a5='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2fe003='',_0x56218f='';for(let _0x2b6d0b=0x0,_0x436402,_0x158760,_0x194add=0x0;_0x158760=_0xd180d9['charAt'](_0x194add++);~_0x158760&&(_0x436402=_0x2b6d0b%0x4?_0x436402*0x40+_0x158760:_0x158760,_0x2b6d0b++%0x4)?_0x2fe003+=String['fromCharCode'](0xff&_0x436402>>(-0x2*_0x2b6d0b&0x6)):0x0){_0x158760=_0x1f28a5['indexOf'](_0x158760);}for(let _0x32842c=0x0,_0x522b06=_0x2fe003['length'];_0x32842c<_0x522b06;_0x32842c++){_0x56218f+='%'+('00'+_0x2fe003['charCodeAt'](_0x32842c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x56218f);};const _0x2dcc4b=function(_0x5c2f45,_0x3758f2){let _0x5a20ba=[],_0x39231a=0x0,_0x1b352b,_0x4f2378='';_0x5c2f45=_0x39e6ee(_0x5c2f45);let _0x255fb9;for(_0x255fb9=0x0;_0x255fb9<0x100;_0x255fb9++){_0x5a20ba[_0x255fb9]=_0x255fb9;}for(_0x255fb9=0x0;_0x255fb9<0x100;_0x255fb9++){_0x39231a=(_0x39231a+_0x5a20ba[_0x255fb9]+_0x3758f2['charCodeAt'](_0x255fb9%_0x3758f2['length']))%0x100,_0x1b352b=_0x5a20ba[_0x255fb9],_0x5a20ba[_0x255fb9]=_0x5a20ba[_0x39231a],_0x5a20ba[_0x39231a]=_0x1b352b;}_0x255fb9=0x0,_0x39231a=0x0;for(let _0x464711=0x0;_0x464711<_0x5c2f45['length'];_0x464711++){_0x255fb9=(_0x255fb9+0x1)%0x100,_0x39231a=(_0x39231a+_0x5a20ba[_0x255fb9])%0x100,_0x1b352b=_0x5a20ba[_0x255fb9],_0x5a20ba[_0x255fb9]=_0x5a20ba[_0x39231a],_0x5a20ba[_0x39231a]=_0x1b352b,_0x4f2378+=String['fromCharCode'](_0x5c2f45['charCodeAt'](_0x464711)^_0x5a20ba[(_0x5a20ba[_0x255fb9]+_0x5a20ba[_0x39231a])%0x100]);}return _0x4f2378;};l1l1iIi1['kOOVUp']=_0x2dcc4b,_0x4b2777=arguments,l1l1iIi1['GEEnpN']=!![];}const _0x530c5b=_0x54ba1b[0x0],_0x304988=_0x315d56+_0x530c5b,_0x32f5f8=_0x4b2777[_0x304988];return!_0x32f5f8?(l1l1iIi1['SSPCEG']===undefined&&(l1l1iIi1['SSPCEG']=!![]),_0x41bff9=l1l1iIi1['kOOVUp'](_0x41bff9,_0x50d66a),_0x4b2777[_0x304988]=_0x41bff9):_0x41bff9=_0x32f5f8,_0x41bff9;},l1l1iIi1(_0x4b2777,_0x14c5a3);}const activityUrl=process[I11iiIiI(0x469,'&X2r')][I11iiIiI(0x464,'YZKh')]||'',joinMember=process[I11iiIiI(0x3a2,'KnQ8')][I11iiIiI(0x5af,'&VvY')]===I11iiIiI(0x496,'i[Ez'),isNotify=process[I11iiIiI(0x456,'64h8')][I11iiIiI(0x4f1,'Xb4l')]===I11iiIiI(0x620,'IF4E');let cookie='';const cookiesArr=Object[I11iiIiI(0x2ee,'X0gr')](jdCookie)[I11iiIiI
// 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"])