jdpro/jd_dygetbeans.js

7 lines
92 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
23 1 * * * jd_dygetbeans.js
*/
const $ = new Env('每日抽豆');
2024-07-12 15:47:57 +00:00
const bdy_0x62bd80=bdy_0x5051;(function(_0x423dc8,_0x8b34b1){const bdy_0x54dcdc={_0x213719:'0x17e',_0x55b0fd:'u32p',_0x12e48a:'0x170',_0x525917:'^XLM',_0x232787:'0x2fb',_0x5616bd:'C@i]',_0x4a51f5:'0x1da',_0x3eb455:')zG(',_0x43cb70:'0x1dc',_0x1e47ba:'9mS1',_0x1e238e:'0x2b0',_0xf3595b:'3lqA',_0x253287:'0x284',_0x399cc3:'&jN(',_0x1a652e:'0x3d2',_0x4b73c5:'Bzb!',_0x43632c:'0x224',_0x4a33d1:'i^ui'},_0x59d91d=bdy_0x5051,_0x115839=_0x423dc8();while(!![]){try{const _0x37ba61=-parseInt(_0x59d91d(bdy_0x54dcdc._0x213719,bdy_0x54dcdc._0x55b0fd))/(0x62*0x4f+-0x2*0x745+-0xfb3)+parseInt(_0x59d91d(bdy_0x54dcdc._0x12e48a,bdy_0x54dcdc._0x525917))/(0x2232+0xb54+-0xb61*0x4)+-parseInt(_0x59d91d(bdy_0x54dcdc._0x232787,bdy_0x54dcdc._0x5616bd))/(0x50c+-0xcce+0x7c5)*(-parseInt(_0x59d91d(bdy_0x54dcdc._0x4a51f5,bdy_0x54dcdc._0x3eb455))/(-0x15*-0xc2+-0x1*-0x1b1b+-0x65*0x6d))+-parseInt(_0x59d91d(bdy_0x54dcdc._0x43cb70,bdy_0x54dcdc._0x1e47ba))/(0x78d*0x1+0x5e1+-0xd69)+-parseInt(_0x59d91d(bdy_0x54dcdc._0x1e238e,bdy_0x54dcdc._0xf3595b))/(-0x4*0x5ca+0x86b*-0x2+0x2804)+-parseInt(_0x59d91d(bdy_0x54dcdc._0x253287,bdy_0x54dcdc._0x399cc3))/(0xc*-0x34+0x7ae*-0x3+0x1*0x1981)*(-parseInt(_0x59d91d(bdy_0x54dcdc._0x1a652e,bdy_0x54dcdc._0x4b73c5))/(0x76f+-0x32e*0x8+0x9*0x201))+parseInt(_0x59d91d(bdy_0x54dcdc._0x43632c,bdy_0x54dcdc._0x4a33d1))/(-0x14fe*-0x1+0x2596+-0x3a8b);if(_0x37ba61===_0x8b34b1)break;else _0x115839['push'](_0x115839['shift']());}catch(_0x2579d7){_0x115839['push'](_0x115839['shift']());}}}(bdy_0x35e6,-0xc4da2+0xf6768+0x8b91b));const bdy_0x11b9c2=(function(){const bdy_0x27eac5={_0x4661fa:'0x1a6',_0x35e1c9:'NkP8'};let _0xfbef20=!![];return function(_0x24b231,_0x52ea77){const _0x22274e=_0xfbef20?function(){const _0x4cc68c=bdy_0x5051;if(_0x52ea77){const _0x203752=_0x52ea77[_0x4cc68c(bdy_0x27eac5._0x4661fa,bdy_0x27eac5._0x35e1c9)](_0x24b231,arguments);return _0x52ea77=null,_0x203752;}}:function(){};return _0xfbef20=![],_0x22274e;};}()),bdy_0x78c1a1=bdy_0x11b9c2(this,function(){const bdy_0x22269f={_0x1a06c6:'0x285',_0x10cdfb:'M]dr',_0x3efea3:'0x3c1',_0x4cf45f:'izfB',_0x167681:'0x233',_0x5216b0:'M]dr',_0x2766fc:'0x2f6',_0x116a9c:'iQ)r',_0x3d920c:'0x380',_0x26e91e:'3w6#',_0x3c00d5:'0x34e',_0x265c27:'sYR%',_0x2a45aa:'0x311',_0x1209dd:'Swri',_0xace611:'0x27e',_0x439cda:')arY',_0x11c34d:'0x2b4',_0x444828:')zG('},_0x4ae6ba=bdy_0x5051,_0x3bbe0a={};_0x3bbe0a[_0x4ae6ba(bdy_0x22269f._0x1a06c6,bdy_0x22269f._0x10cdfb)]=_0x4ae6ba(bdy_0x22269f._0x3efea3,bdy_0x22269f._0x4cf45f);const _0x3efd4e=_0x3bbe0a;return bdy_0x78c1a1[_0x4ae6ba(bdy_0x22269f._0x167681,bdy_0x22269f._0x5216b0)]()[_0x4ae6ba(bdy_0x22269f._0x2766fc,bdy_0x22269f._0x116a9c)](_0x3efd4e[_0x4ae6ba(bdy_0x22269f._0x3d920c,bdy_0x22269f._0x26e91e)])[_0x4ae6ba(bdy_0x22269f._0x3c00d5,bdy_0x22269f._0x265c27)]()[_0x4ae6ba(bdy_0x22269f._0x2a45aa,bdy_0x22269f._0x1209dd)](bdy_0x78c1a1)[_0x4ae6ba(bdy_0x22269f._0xace611,bdy_0x22269f._0x439cda)](_0x3efd4e[_0x4ae6ba(bdy_0x22269f._0x11c34d,bdy_0x22269f._0x444828)]);});bdy_0x78c1a1();const bdy_0x11e1bd=(function(){const bdy_0x7a9ea3={_0x5f5925:'0x23d',_0x1693ae:'inTr',_0xc7b76f:'0x271',_0x14d16e:'NZa$',_0x48538f:'0x364',_0x138901:'^XLM'},bdy_0x8920e0={_0x454e32:'0x29c',_0x5c3862:'9mS1',_0x18d67b:'0x345',_0xd65a1d:')XXI',_0xcacf25:'0x39a',_0x5a71c5:'FlTi',_0x11a7e9:'0x36c',_0x25a422:'sYR%',_0x21defd:'0x3b9',_0x4d7986:'YEYZ'},bdy_0x3b8112={_0x429a51:'0x25a',_0x4a1628:'!Iiy',_0x576104:'0x37e',_0x1cf6cd:'M]dr',_0x2ec20d:'0x30c',_0x5d34ae:'6I5m',_0x5ce807:'0x269',_0x37e6b0:'Swri',_0x53046e:'0x3c3',_0x190d76:'cYce',_0x5a9286:'0x2f9',_0x1ea546:'fJcT',_0x11ad3a:'0x274',_0x45ba07:'5XNU',_0x24a785:'0x394',_0x2a20db:')zG('},_0x3811c3=bdy_0x5051,_0x1b42af={};_0x1b42af[_0x3811c3(bdy_0x7a9ea3._0x5f5925,bdy_0x7a9ea3._0x1693ae)]=function(_0x1c7cff,_0x58abaf){return _0x1c7cff!==_0x58abaf;},_0x1b42af[_0x3811c3(bdy_0x7a9ea3._0xc7b76f,bdy_0x7a9ea3._0x14d16e)]=_0x3811c3(bdy_0x7a9ea3._0x48538f,bdy_0x7a9ea3._0x138901);const _0x912d48=_0x1b42af;let _0x379987=!![];return function(_0x3b8c63,_0x34d1ec){const _0x109401=bdy_0x5051;if(_0x109401(bdy_0x8920e0._0x454e32,bdy_0x8920e0._0x5c3862)!==_0x912d48
2024-06-28 07:47:44 +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