faker3/jd_beanday.js

15 lines
77 KiB
JavaScript
Raw Normal View History

2024-11-12 11:17:55 +08:00
/*
活动名称天天领豆
环境变量jd_beanday_interval // 自定义运行间隔时长整数单位毫秒默认1500
jd_beanday_notify // 是否推送通知true/false默认不推送
jd_beanday_pinFilter // 账号pin过滤多个用@进行分割
cron:15 1,14 * * *
*/
const $ = new Env('天天领豆')
2024-11-21 17:02:13 +08:00
function pVLrhZ(){}var abPTcT=Object['defineProperty'],z329UUt,slioZZS,IpPhmz2,lFIQNX,k7zgJv,JWSsHO8,JGbtLn,Nsa_7E,aQhaosC,vvt30CF,XpDcBo,mxnLvrV,DBSmZp,z3wf1d,GrObu0d,GMhvuCy,W3Pru0B,VuKHKP,QvNJDYD;function _CtLs1(pVLrhZ){return z329UUt[pVLrhZ>0x35?pVLrhZ-0x36:pVLrhZ-0x1a]}z329UUt=fr3moc7();function bfEY75i(pVLrhZ,abPTcT){slioZZS(pVLrhZ,_CtLs1(0x3d),{value:abPTcT,configurable:!0x0});return pVLrhZ}pVLrhZ(slioZZS=Object.defineProperty,IpPhmz2=G7QlTs((pVLrhZ,abPTcT)=>{return abPTcT(pVLrhZ())},0x2)(LjHonnf,inrXYPo));var DoWFPCR=[],aj0ryMA=[eg_jXVo(0x0),eg_jXVo(_CtLs1(0x42)),eg_jXVo(_CtLs1(0x57)),eg_jXVo(0x3),eg_jXVo(0x4),eg_jXVo(_CtLs1(0x44)),eg_jXVo(0x6),eg_jXVo(_CtLs1(0x4c)),eg_jXVo(0x8),eg_jXVo(_CtLs1(0x65)),eg_jXVo(0xa),eg_jXVo(_CtLs1(0x6d)),eg_jXVo(_CtLs1(0x49)),eg_jXVo(_CtLs1(0x53)),eg_jXVo(_CtLs1(0x5d)),eg_jXVo(_CtLs1(0x48)),eg_jXVo(0x10),eg_jXVo(0x11),eg_jXVo(0x12),eg_jXVo(0x13),eg_jXVo(_CtLs1(0x70)),eg_jXVo(0x15),'<3|WI','V6z^Y>|R',eg_jXVo(0x16),eg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1(0x9f)),eg_jXVo(_CtLs1(0xa0)),eg_jXVo(0x62),eg_jXVo(0x63),eg_jXVo(_CtLs1(0xa1)),eg_jXVo(0x65),eg_jXVo(0x66),eg_jXVo(0x67),eg_jXVo(_CtLs1(0xa8)),eg_jXVo(0x69),'XXN9^rBC_/hLW|6_Kp>:.','$y@nL$,%0R_|%r#a',eg_jXVo(0x6a),eg_jXVo(0x6b),eg_jXVo(_CtLs1(0x93)),eg_jXVo(0x6d),eg_jXVo(0x6e),'|lf1u`gjlmL',eg_jXVo(0x6f),eg_jXVo(_CtLs1(0x3b)),eg_jXVo(0x70),eg_jXVo(_CtLs1(0x3c)),'\x58\x58\x4e\x39\x5e\x72\x42\x43\x5f\x2f\x68\x4c\x57\x7c\x36\x5f\x70\x42\x45\x3e\x58\x30\x36\x6a\x24\x66\x62\x54\x28\x6f\x75\x67\x3e\x49',eg_jXVo(0x71),eg_jXVo(_CtLs1(0xaf)),eg_jXVo(0x73),eg_jXVo(_CtLs1(0x55)),eg_jXVo(0x75),eg_jXVo(0x76),eg_jXVo(_CtLs1(0x36)),eg_jXVo(0x77),eg_jXVo(_CtLs1(0xb3)),eg_jXVo(0x79),eg_jXVo(0x7a),eg_jXVo(0x7b),eg_jXVo(0x7c),'\u004d\u003a\u007c\u0057\u003c\u0048\u0075',eg_jXVo(_CtLs1(0xb7)),eg_jXVo(_CtLs1(0xb8)),eg_jXVo(_CtLs1(0xb9)),eg_jXVo(0x80),eg_jXVo(0x81),eg_jXVo(0x82),'c:
2024-11-12 11:17:55 +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"])