jdpro/jd_dygetbeans_.js

7 lines
117 KiB
JavaScript
Raw Normal View History

2024-07-18 01:15:17 +00:00
/*
45 0,6 * * * jd_dygetbeans_.js
*/
const $ = new Env('每日抽豆');
2024-07-18 02:29:03 +00:00
const bdy_0x4e51ab=bdy_0x201b;(function(_0x282449,_0x5d4163){const bdy_0x4ec049={_0x2cb625:'0x19f',_0xa88774:']fkw',_0x1d4c4f:'0x275',_0x398ff6:'bQ5%',_0x13674e:'0x4ab',_0x513581:'n6@L',_0x5b535b:'0x35c',_0x261dbf:'pO^8',_0x226607:'0x368',_0x3f64ab:']fkw',_0x3fe2bb:'0x264',_0x3982c1:'PLc^',_0x2bf9d1:'0x2c7',_0x91e499:'MWBn',_0x26eadc:'0x2ba',_0x40e74d:'%](X',_0x6d2905:'0x3d6',_0x24737d:'6oUZ'},_0x25200f=bdy_0x201b,_0x10306a=_0x282449();while(!![]){try{const _0x5d8fb9=parseInt(_0x25200f(bdy_0x4ec049._0x2cb625,bdy_0x4ec049._0xa88774))/(-0x194e+-0x8a*0xe+0x20db)+parseInt(_0x25200f(bdy_0x4ec049._0x1d4c4f,bdy_0x4ec049._0x398ff6))/(-0x41c*0x4+0x19a5+-0x933)+-parseInt(_0x25200f(bdy_0x4ec049._0x13674e,bdy_0x4ec049._0x513581))/(-0x1809+-0x266a+-0x5*-0xc7e)*(parseInt(_0x25200f(bdy_0x4ec049._0x5b535b,bdy_0x4ec049._0x261dbf))/(0x1*-0xf1+0xeab+-0xdb6))+parseInt(_0x25200f(bdy_0x4ec049._0x226607,bdy_0x4ec049._0x3f64ab))/(-0x1*-0x1597+0x199+-0x3*0x7b9)+parseInt(_0x25200f(bdy_0x4ec049._0x3fe2bb,bdy_0x4ec049._0x3982c1))/(0x8d*-0x1+-0x14cb*-0x1+-0x1438)+parseInt(_0x25200f(bdy_0x4ec049._0x2bf9d1,bdy_0x4ec049._0x91e499))/(-0x21c6+-0x317+-0x6*-0x626)+-parseInt(_0x25200f(bdy_0x4ec049._0x26eadc,bdy_0x4ec049._0x40e74d))/(-0x1*0x5f9+0x62*0x1c+-0x4b7)*(parseInt(_0x25200f(bdy_0x4ec049._0x6d2905,bdy_0x4ec049._0x24737d))/(0x8*-0x2d4+0x15*0x136+-0x2c5*0x1));if(_0x5d8fb9===_0x5d4163)break;else _0x10306a['push'](_0x10306a['shift']());}catch(_0x751c64){_0x10306a['push'](_0x10306a['shift']());}}}(bdy_0x17d2,-0x1*0x1936c+0x3a0d0+-0x28f*-0x49));const bdy_0x6a7a8f=(function(){const bdy_0x2ef4d4={_0x3650b5:'0x3b4',_0x2eddfd:']fkw',_0x2df460:'0x30f',_0x16f0c8:'ACS^',_0x368d26:'0x43f',_0x340aaf:'MWBn',_0x56d5d2:'0x1fd',_0xc11a60:'AwKJ',_0x447d1b:'0x2fc',_0x5d368e:'az7^',_0x58e5c2:'0x4b2',_0x8319b5:']fkw',_0x44e6da:'0x197',_0x268611:'*#]W',_0x32c896:'0x1d6',_0x44febf:'Kwr8'},bdy_0x4ed78c={_0x45ab7c:'0x2f5',_0x53918d:'YcHk',_0x3cdf30:'0x1af',_0x17c3a0:'Kwr8',_0x47a6c0:'0x3d4',_0x4b49ee:'0x1ef',_0x494922:'UNpN',_0x3e4226:'0x318',_0x4f931f:'65w3',_0x265a68:'0x310',_0x5e9103:'2fVP',_0x49a326:'0x1b9',_0x227446:'*a!)'},bdy_0x1a4f6f={_0x17175f:'0x3bc',_0x4e3932:'MW2@',_0x3560ed:'0x2c1',_0x333d3d:'z7![',_0x43756f:'0x3d5',_0x47dc35:'g6^r',_0x4b39eb:'0x3f0',_0x4180b3:'$W2F',_0x23e54b:'0x1cd',_0x2fb456:'hK%)',_0x25a89e:'0x454',_0x234c4a:'65w3',_0xccae38:'0x276',_0x4dd031:'9QEB',_0x1746e6:'0x409',_0x3a4c12:'ok4k',_0x49af1d:'0x427',_0x43952b:']fkw'},_0x1da0f6=bdy_0x201b,_0x211f76={};_0x211f76[_0x1da0f6(bdy_0x2ef4d4._0x3650b5,bdy_0x2ef4d4._0x2eddfd)]=function(_0x1efbe2,_0x437bb4){return _0x1efbe2!==_0x437bb4;},_0x211f76[_0x1da0f6(bdy_0x2ef4d4._0x2df460,bdy_0x2ef4d4._0x16f0c8)]=_0x1da0f6(bdy_0x2ef4d4._0x368d26,bdy_0x2ef4d4._0x340aaf),_0x211f76[_0x1da0f6(bdy_0x2ef4d4._0x56d5d2,bdy_0x2ef4d4._0xc11a60)]=_0x1da0f6(bdy_0x2ef4d4._0x447d1b,bdy_0x2ef4d4._0x5d368e),_0x211f76[_0x1da0f6(bdy_0x2ef4d4._0x58e5c2,bdy_0x2ef4d4._0x8319b5)]=function(_0x194894,_0x49cc91){return _0x194894===_0x49cc91;},_0x211f76[_0x1da0f6(bdy_0x2ef4d4._0x44e6da,bdy_0x2ef4d4._0x268611)]=_0x1da0f6(bdy_0x2ef4d4._0x32c896,bdy_0x2ef4d4._0x44febf);const _0x52502f=_0x211f76;let _0x3271f4=!![];return function(_0x4915f9,_0x536943){const bdy_0x174c66={_0x341628:'0x3d3',_0x4b3096:'2fVP'},_0x28354b=bdy_0x201b,_0x33afc2={'yXLfv':function(_0x463a3d,_0x195f04){const _0x5909d3=bdy_0x201b;return _0x52502f[_0x5909d3(bdy_0x174c66._0x341628,bdy_0x174c66._0x4b3096)](_0x463a3d,_0x195f04);},'IoWSr':_0x28354b(bdy_0x4ed78c._0x45ab7c,bdy_0x4ed78c._0x53918d),'vRqCZ':_0x52502f[_0x28354b(bdy_0x4ed78c._0x3cdf30,bdy_0x4ed78c._0x17c3a0)],'fdScB':_0x52502f[_0x28354b(bdy_0x4ed78c._0x47a6c0,bdy_0x4ed78c._0x17c3a0)]};if(_0x52502f[_0x28354b(bdy_0x4ed78c._0x4b49ee,bdy_0x4ed78c._0x494922)](_0x28354b(bdy_0x4ed78c._0x3e4226,bdy_0x4ed78c._0x4f931f),_0x52502f[_0x28354b(bdy_0x4ed78c._0x265a68,bdy_0x4ed78c._0x5e9103)])){if(_0x353263){const _0x3b5919=_0x104506[_0x28354b(bdy_0x4ed78c._0x49a326,bdy_0x4ed78c._0x227446)](_0xa47732,arguments);return _0x236452=null,_0x3b5919;}}else{const _0x3f9a7d=_0x3271f4?function(){const _0x4e4679=bdy_0x201b;if(_0x33afc2[_0x4e
2024-07-18 01:15:17 +00:00
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.d