jdpro/jd_dygetbeans_.js

7 lines
89 KiB
JavaScript
Raw Normal View History

2024-07-18 01:15:17 +00:00
/*
2024-08-31 01:21:50 +00:00
35 0,7 * * * jd_dygetbeans_.js
2024-07-18 01:15:17 +00:00
*/
const $ = new Env('每日抽豆');
2024-09-02 08:20:36 +00:00
const _0x2f74=['mfZcPKOazv8d','CeVcJgJcOa','WO3dVSovW6e','zCoWWRZdPaBdSq','tSkWEdhcPa','z13dGwNcLSkzW6eInLK','W6KkW5vfW78','55QV5lIK5lMf562y5yIo6i+Y5y6e','dbtdSI7cHG','W7lcOCkOWR9EW5O7WPXouG','bY/dOI3cSSoBWPVdVbpcSW','WQRcTa8izmovyd3dV8kF','bNa5bWK2iSkSWP1J','5P6r5A+I6kg9nCkUW63cN8o3lGe','ibxdULFcTSkLW4OQfq','W5JdUCkz','W6RdIX/cKSofW6vMW4a','hCoBW7NcHW','W75LW53cPSocW5xcTMC','W5pdTSkcWPi','ib7dUfVdVmo+WPbtutq','pCopW499bq','rSoyWQJdSqW','WRK0WOykWQ8','c8kLzWy','rNDiWRDq','44cT5O2f56wR44cf6kYF5yw66i+S5y2A5lUz5lUa','W7FdVvJcVmkU','W77dKM7cTG','WQRcTbO','WPBdPZbDW7JcOXm','emkUbSkPfX1iW4FcGa','g3tcJhe','W4JdJq/cKSoy','W6SUW6OqWPpdJCkWW4vtoa','WQlcJ3K5xG','WOtdSSocW7y','W7VdPq3dIbG','W7BcJmkyA1yKfrrkWOS','g8kspSkFfW','W4hdMMNcHvKoW4JcR8ooWPe','D8kjBCk+tCopmmoWz8kd','WRz/bmoxW6xdOG','WRBdH2HNW7tdKColW495AW','nCk5WQFdVt8h','W4NdTINdPJ4AW5b3WOhdHa','WQriW5NdKW','nCkSsfFcNmkmWPWm','cZldJZdcR8oo','WPBdHXinW67cUIPs','amkhlSo3ra','gmouWQpcI0/cPmkUDr7dUa','WRPrW5G','W4mgW4zDWQtcV8kyWPDLrG','quzfWQrmW5FdISoNWRn6','W6GFW7i','W5xdT0ZcUhK','r8omcsddIq','k0ZcQMNcSmofia','WRfLnCoqW6pdUvK4','WQXLca','pCkKW63cPxBcRba3cSkHEx0','W5lcHuJcK1BdOWO','WQpcVWiDACon','W7/cH8kbB8obWQ8','WPr+W5ldV07cVJxdJYr6','W7FdSLJcPgm','WPxcKLddISkHWQ4HWO/dU8o0','44kj5O2J56wb44k6fchdOf3cUmoO','W4pdOrRdUX4RW6aaWPNcTq','k8k4WRhdOdq','WRFcRKmkCCoeFqpcOCoq','WPfJW7tdUG0','WRBdLSo1W7T8','FvHTeCk1WQmunSoj','iLxcPfuEw0icdva','WQVcJw4','W4ZdNgtcNwmDW5dcQq','cHTr','WRFdOCk6sva','WRjiW67dNIxdNH7dOq','WOGOW58wWP3dV8khW7bzaW','W5VdMq7cGq','WRPcWPhcHCofW7lcOw3dLxu','sN7cJK/cRmk2fq','WRZdHSkw','WOHoWOFcKSowW6m','WOxdUSoEWRXMnGRcHIPc','WOtdRSofW75Omu8','bCkNp1nqjIysW6ldGG','W6hcGCkDWPykWPziWOq','WPldSd1jW63cLGfxWRmN','WORdSSovW6jy','gCkwbmkSea','W6JcLmoesIj6ttSBW54','qCoAWRNcLLm','W5ZdSH/dKrK','tw5jWQvfW7ddKmouWPjA','WPaQd8o0W7NdV1K6emka','WPG/WOC7','iCoeW45sk8okkW','ufa3h8oPWOq/k8o1W7m','cIbO','kSk8iCkHf1qrWOxdMmop','W6WdW6y','WR5fW5e','W7JdGWVdHX4TW65cWRJdOG','y8o6WRG','5lIr5lQQ6lsB5yYs','WRdcHN4rqa','W412W7xcTG','WQ9ayW','aCkkoq','mYLhmSkV','W4BdKMlcGG','yunYbmkOW5vsASoFW5a','hCkYaSkSaG','rh/cHMNdKSkPn8kdsW','WRddL8kgF2zXvvbbWOS','gSoiW7tcLHxcNSk4nbFdSG','W5hdGgtcLuGpW47cNSoFWOK','W47dUftcMG','lbZdT0JcQSk7W4OZa3m','W5SmW51qW4dcUG','CtZdLxlcVSo8W5nB','Bmo6WRddUYBdSa','cM/cMINcM8kPAW','emoCW6tdNqZcOCkUpHhcUa','WQPiW5O','W58ZW7urWOS','emoMpfjjkIaqWQldMW','AhZcVglMN6FMRORMIOJOO6dOJ5BLVyS','bxRcKMa','tHnzgIK','A8k9trdcNW','tMbWn8kq','aGzvj8k4CqiOWQmR','W4/cQ8kuWRuBWOLK','W54fW5SVWQpdQCkBW5rXhG','ymoBWQlcPwW','W7dcJmkbACoXWRVdImo0W7jd','hConEdtcQuiRW6aqWOS','qmofWPRcJvn2W7RcJ8ogWRO','W5pdKWBdLmo4W7xdLINdKbu','cJxdTs/cUmkrW4dcGWZdSq','W4zzamoPW7ldJrNcJmoZjW','WRtdGSkCuh8VcG1m','WO15WQS','jXpdUv8','W5ZdLXxcI8oIW6e','W7BLI7JPKPBLKBpLHR/MIONOOzFOHANMN59M','lmkXbmk7fWLsW5BcMCko','dw7dQxHzeX1oEwi','ENdcGHxdHmonkKhcHc0','jSk9jSoYE8opnCoSAmks','t8oWjwhcMLX7WQnxW7W','WPtdTd/cTw85W7JdVCkpWRG','W4JdKgtcGMqy','WO/dVmocW79PpfdcRce','lrFdKdRcMa','W4pcTSkS','W5CeW58','ucvWcGyul8kZWOW','F8oTlSo7vtGuWOdcRSoq','W5FdSSkmWOpcOmkr','qtjVpWKQj8kT','swzfWQffW4pcNq','WO1BWPpcMCoT','WPaIW77dTuVcTq','smoHnYW','W4ZdMglcMfK1W5NcV8kyW4q','j8kHdCoFtSoee8ob','hahdSuJdVSkkW5Kgh2G','WPu+W5C','WPVdGSk0qe0','oCkZWRBdQHmHWRRdMG','W57cOSkEWQq4zKRcLIzGFu8','W450W6/cRG','y3FcUq','WPFcVSkr','WQldSCkuW5DEpvtdLhnE','WPFdUSo0W7GyWOv8W5KpwW','W6NdKGNdMbi','WOO/WPa2','WQfIW6ZdJb8','W5ldP8kkWPNdHmkazSk+','W7BdVMT7W5BcK8oYWPKLqW','WPdcHJdcR0OFW6ZdVSo9WR0','AKTPW7LQWPBdLSkYW6Hp','FmoLWRpdUtS','W6ynW7vLW7O','WR5Tt2jgWPFcT8oN','WOdcJZFdMG8vW4NcQCoxWRC','W5XKW73cQbj3W40','BxtcRu0H','g3RcJxBdNG','nNJcJe7cTmoYkK7cGJu','WQdcVGuuEG','WQLdW5JdNhNdNrtcQmoxWR4','W43dL0/cLSkT','WQFcSmkLs8odWPldSComW6D6','nmkVvLFcI8kiWPC','WPBcOSkr','cYTRbG','WOrzWOWCWRZdP8olW4yZbG','WPNdSCkarLa','W4/cV8k2WRCzWO5+W7Ki','WQNdMfHJW5e','W7RcPCkgtSoE','WOdcOZKrCa','WQPGwLXtWOZcOSoZ','FMVcRu0','W68iW73dH1D2jI/dJeG','kSkncCkNer4','WRpdNxnrW5y','W4LFW4qBWQhcSmkelfZcPa','W6pcV8k0WQNdICkOp8o6W4zI','aKBcH0WD','W6ilWOL5c8o9','pCkxcCkagG','lmkTm8kafcHHW6lcRmkl','yvjNemk+WP0o','WQ3cRw4esW','ymoSbmoAA8kCC8oAn8ou','WOZdVSopW6zfnG','fb1ufSkUzrm','WOeJvfP/WQ3cG8k+CSoW','lmo
2024-08-31 01:21:50 +00:00
function Env(o, t) { 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((r, i) => { s.call(this, t, (t, e, s) => { t ? i(t) : r(e) }) }) } 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.logLevels = { debug: 0, info: 1, warn: 2, error: 3 }, this.logLevelPrefixs = { debug: "[DEBUG] ", info: "[INFO] ", warn: "[WARN] ", error: "[ERROR] " }, this.logLevel = "info", 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.encoding = "utf-8", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null, ...s) { try { return JSON.stringify(t, ...s) } catch { return e } } getjson(t, e) { let s = e; if (this.getdata(t)) 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(r => { this.get({ url: t }, (t, e, s) => r(s)) }) } runScript(a, o) { return new Promise(r => { let t = this.getdata("@chavy_boxjs_userCfgs.httpapi"); t = t && t.replace(/\n/g, "").trim(); var e = (e = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout")) ? +e : 20, [s, i] = (e = o && o.timeout ? o.timeout : e, t.split("@")); this.post({ url: `http://${i}/v1/scripting/evaluate`, body: { script_text: a, mock_type: "cron", timeout: e }, headers: { "X-Key": s, Accept: "*/*" }, timeout: e }, (t, e, s) => r(s)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; this.fs = this.fs || require("fs"), this.path = this.path || require("path"); var t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), r = !s && this.fs.existsSync(e); if (!s && !r) return {}; r = s ? t : e; try { return JSON.parse(this.fs.readFileSync(r)) } catch (t) { return {} } } writedata() { var t, e, s, r, i; this.isNode() && (this.fs = this.fs || require("fs"), this.path = this.path || require("path"), t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), r = !(s = this.fs.existsSync(t)) && this.fs.existsSync(e), i = JSON.stringify(this.data), !s && r ? this.fs.writeFileSync(e, i) : this.fs.writeFileSync(t, i)) } lodash_get(t, e, s) { let r = t; for (const t of e.replace(/\[(\d+)\]/g, ".$1").split(".")) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, r, e) { return Object(t) === t && ((r = Array.isArray(r) ? r : r.toString().match(/[^.[\]]+/g) || []).slice(0, -1).reduce((t, e, s) => Object(t[e]) === t[e] ? t[e] : t[e] = Math.abs(r[s + 1]) >> 0 == +r[s + 1] ? [] : {}, t)[r[r.length - 1]] = e), t } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { var [, s, r] = /^@(.*?)\.(.*?)$/.exec(t); if (s = s ? this.getval(s) : "") try { const t = JSON.parse(s); e = t ? this.lodash_get(t, r, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { var [, r, i] = /^@(.*?)\.(.*?)$/.exec(e), a = this.getval(r), a = r ? "null" === a ? null : a || "{}" : "{}"; tr