faker3/jd_superbrandhall.js

15 lines
27 KiB
JavaScript
Raw Normal View History

2024-07-09 23:02:32 +08:00
/*
活动名称超级品牌殿堂
环境变量jd_superbrandhall_interval // 自定义运行间隔时长整数单位毫秒默认1000
jd_superbrandhall_notify // 是否推送通知true/false默认不推送
jd_superbrandhall_pinFilter // 账号pin过滤多个用@进行分割
cron:18 8,18 * * *
*/
const $ = new Env('超级品牌殿堂')
2024-07-29 12:18:53 +08:00
const _0x41627a=_0x3008;function _0x3008(_0x69374,_0x15419d){const _0x232f83=_0x232f();return _0x3008=function(_0x3008bb,_0x4d1e63){_0x3008bb=_0x3008bb-0xa6;let _0x4337ff=_0x232f83[_0x3008bb];if(_0x3008['SfGhvz']===undefined){var _0x239c20=function(_0x5a040f){const _0xe8c81f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1840f0='',_0x3d1859='';for(let _0x28b2a0=0x0,_0x3e6d29,_0x5e8aaf,_0x198ec8=0x0;_0x5e8aaf=_0x5a040f['charAt'](_0x198ec8++);~_0x5e8aaf&&(_0x3e6d29=_0x28b2a0%0x4?_0x3e6d29*0x40+_0x5e8aaf:_0x5e8aaf,_0x28b2a0++%0x4)?_0x1840f0+=String['fromCharCode'](0xff&_0x3e6d29>>(-0x2*_0x28b2a0&0x6)):0x0){_0x5e8aaf=_0xe8c81f['indexOf'](_0x5e8aaf);}for(let _0x59d942=0x0,_0x510fd8=_0x1840f0['length'];_0x59d942<_0x510fd8;_0x59d942++){_0x3d1859+='%'+('00'+_0x1840f0['charCodeAt'](_0x59d942)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3d1859);};const _0x55b905=function(_0x44a9ae,_0x2bc05b){let _0x129359=[],_0x3b8328=0x0,_0x40b4a5,_0x293f98='';_0x44a9ae=_0x239c20(_0x44a9ae);let _0x22c8bc;for(_0x22c8bc=0x0;_0x22c8bc<0x100;_0x22c8bc++){_0x129359[_0x22c8bc]=_0x22c8bc;}for(_0x22c8bc=0x0;_0x22c8bc<0x100;_0x22c8bc++){_0x3b8328=(_0x3b8328+_0x129359[_0x22c8bc]+_0x2bc05b['charCodeAt'](_0x22c8bc%_0x2bc05b['length']))%0x100,_0x40b4a5=_0x129359[_0x22c8bc],_0x129359[_0x22c8bc]=_0x129359[_0x3b8328],_0x129359[_0x3b8328]=_0x40b4a5;}_0x22c8bc=0x0,_0x3b8328=0x0;for(let _0x16c628=0x0;_0x16c628<_0x44a9ae['length'];_0x16c628++){_0x22c8bc=(_0x22c8bc+0x1)%0x100,_0x3b8328=(_0x3b8328+_0x129359[_0x22c8bc])%0x100,_0x40b4a5=_0x129359[_0x22c8bc],_0x129359[_0x22c8bc]=_0x129359[_0x3b8328],_0x129359[_0x3b8328]=_0x40b4a5,_0x293f98+=String['fromCharCode'](_0x44a9ae['charCodeAt'](_0x16c628)^_0x129359[(_0x129359[_0x22c8bc]+_0x129359[_0x3b8328])%0x100]);}return _0x293f98;};_0x3008['jZNFZS']=_0x55b905,_0x69374=arguments,_0x3008['SfGhvz']=!![];}const _0x323195=_0x232f83[0x0],_0x4ef6d6=_0x3008bb+_0x323195,_0x1dbc39=_0x69374[_0x4ef6d6];return!_0x1dbc39?(_0x3008['hvBMaS']===undefined&&(_0x3008['hvBMaS']=!![]),_0x4337ff=_0x3008['jZNFZS'](_0x4337ff,_0x4d1e63),_0x69374[_0x4ef6d6]=_0x4337ff):_0x4337ff=_0x1dbc39,_0x4337ff;},_0x3008(_0x69374,_0x15419d);}(function(_0x50bbdb,_0x49be94){const _0xb0a65=_0x3008,_0x1f96a0=_0x50bbdb();while(!![]){try{const _0x403a9c=parseInt(_0xb0a65(0x15c,'S^rR'))/0x1*(parseInt(_0xb0a65(0x12e,'PkS)'))/0x2)+-parseInt(_0xb0a65(0x12f,'IWa@'))/0x3*(-parseInt(_0xb0a65(0xf1,'S(V3'))/0x4)+-parseInt(_0xb0a65(0xb8,')6#J'))/0x5+-parseInt(_0xb0a65(0x17f,'l7FK'))/0x6+-parseInt(_0xb0a65(0x14d,'6LN%'))/0x7*(-parseInt(_0xb0a65(0x16f,'j(5t'))/0x8)+-parseInt(_0xb0a65(0x109,'5A#1'))/0x9*(-parseInt(_0xb0a65(0x16c,'aUYl'))/0xa)+parseInt(_0xb0a65(0x114,'e*X['))/0xb*(-parseInt(_0xb0a65(0xfd,'Aiou'))/0xc);if(_0x403a9c===_0x49be94)break;else _0x1f96a0['push'](_0x1f96a0['shift']());}catch(_0xc10183){_0x1f96a0['push'](_0x1f96a0['shift']());}}}(_0x232f,0x981c4));const jdCookie=require('./jdCookie'),notify=require(_0x41627a(0xf6,'e*X[')),common=require(_0x41627a(0xc5,'e*X['));function _0x232f(){const _0x42d9aa=['dSojgMy','nCkoW65IWRz0','D1JcV3xdHCod','sSoUWQJcOv7dPCoRk8ozrCkOWRldJSk9WPaCW4/cNNpcIxK','WPNVVkVPOAlMJOi','ESofpG','W6zHWPVcPa','W7HVWO4','e8odeMDHlMVdICkzfbfvASoFW5yslqq7W5ZcIq','WOWhtW','e8oYWPlcPx/cQSk2','uCoUWQ7cUepcUmkTySob','WP/dVCo8z2WkCeq+','WOuunW','WPFKUyNLIPZLTQpLRABMI6G','fSoddNa','k2HRWOqcaHFdQmktW7hcKWldVmoj','W7pdKSoajq','5Rsd5yM25l+t5Ogl','WQlcMCoy','WPiFnSo1W6BcJK4','wmoQW4xdKCkOWOWO','WQetd8kv','sSoUWQJcOv7dPCoRk8oir8kUW7JdHSoLW5qvW4/cL3JdIJvCmSk1WO/cMCo7d8kFh8kuW7HaFmoIW5VdGfK7AXhdNSoPWP3cQCoNk27dH8orWO1dWOKLumklWOSYvI7cJ3ZdOw7cMCkkWQ1brbtdMWOaWRm','BmoEog5eWQtdVM8aW5ZdOXpcPSouWO7dV3tdMCoyWO/dQCoUWPNcSGpdJgLVrG','6lAM5y2M5PAg5PwJ','6AEC6AgU5AsP6lEipG','W5fCg8ofWPldVgTYbmk3W7/dPa','wmoQW4tdImkSWPW5','C1ZcOKldG8ocfNxdS8kwDCkyqXldHq','W6lOROVMSkNLP4hOT6tcUEkCKSox5PsF5zcz5BIm5PA05O66','W6ddKSoDma','rSoGW5i','WQ7dPIrHWRKt','E8okpgO','W7bdWPNcHq','ibVcObi','W4xdMx1BWPRdSH8','l3vU','jNr/','W5VcQCkL','D1lcTG','WQRcNmoCjsFdOmkNW6JdUComs3RcKCkzWR3dLSkgWQjiWPnYrv1QdGuv','rthcRCoiWQ1wlSkKWRFdLq','WOGonCoKW6FdKbj7
2024-07-09 23:02:32 +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"])