jdpro/jd_wyw_help.js

7 lines
138 KiB
JavaScript
Raw Normal View History

2024-07-19 09:37:29 +00:00
/*
1 6 29 2 * jd_wyw_help.js
*/
const $ = new Env('玩一玩_指定助力');
2024-09-06 13:16:22 +00:00
const _0x3b8c=['W6VcHwjuW5m','FSoaWO0tWRlcUa','W5X/WR7cKeS','ASodWOWRW4a','WP/cG8op','B8ocWO8','hhSdBmkYcCoK','WRtcKmoCtSoY','W7JdHtdcQeK','iSkmWOXDW6ayWRFdJrCJ','uqmkWO7dP8kEW5jfb2a','uCoFWOuMW4G','WPBdKfTVrCoC','W6KKFmkmW6y','yKeNsCof','W6DveSosE8ouWQm','W7tcHH8cyG','CqXEomkUW6xcNW','z8omWPWV','ymoJWQiRb8kSlW','AgfzcY7dImkWimojW78','t8kzuCol','Cgib','WO8kW7Czf1ft','WP9epSk/ySkR','hr/dK8k7qa','W6JcHx1cWPSkW4Depa','W5OjsmkuW5BcKq','W4NdRXlcIfe','WQCvW6pcGSoT','W4NdImkLW4bT','AmocoM0','uSkJnSkMzG','W7Gsw8kwW4y','sXL6lSkf','WOldMNitWQm','WPXvoCkR','cmkbW607W6W','A8k9fSkjEa','DtLfjmkHW6FdGHOeaW','WPaMW5tcNmoYBG','jHVdR8kPW6e','W4z6hIm','WOHsECkwWQW','fxOa','WOr0smk2WRCYWQTa','DtyRW5NdKq','Fmo+WO96WPxdVG','eCkmamkQaG','z29ufsVdICk/eComW6a','WQzNtSkyWOS','W4f+fahdSW','W4xcG0P0WQ4wdg/cLYi','W53cH8oBvCoUEg0','WR3cLh5k','WOxdSfOGWOe','WOnGwmk+WP4OWQS','W7lcKhvkW78D','W6TcpZhdLq','WRZdIuHJAG','x8oLWRHYWPW','W5FcG0X/WRSXvwVcJtq','bGdcLW4BW58','WO/cHCoZDSol','nXGoWPhdLCkfaCorWRGN','W5LPW6VcQq7cJCkxWOfcjq','WOVcRLRcJ8kaWQtdJmoTWOK','E3eTW68qb2/dRsBcHa','weueW6ms','W47cG1jHW5O','WPCTW6xcUmo1jNxdMSkXza','W6pcTe5PWRK','6k6t5yQA6zI+5OwD5zYHW6DixSoZuq','WP7cKKvEaq','Ahe3W7C','FGbdl8kyW6VcJL5Jxq','WPu1W4FcOCkTksFcJ8oIjG','EqDB','vGCAW4JdLCkcW5zd','uSonWOGDWRJcQq','W5fZWQlcVv8','WPRcISouWQ4gqHXPDCkpW5/cNCod','yCkmpSkynq','ACoqi3hdRcFcNa','oZKttN0','aUwKSowlMmknWQ/dLq','W5CCwCky','5y6y5lUJ7769576P5yce5AAu6lsc77YN5ys05O6h','Dcb5dCkH','WOKgW6Kjffa','qhOhCCoyiCkr','5yAE5l+86iYC5B6YWR0','W7jebmkk','mCkaW7ulW7i','h8oBWQdcVSoI','exalESkxda','v1CHW68','WO5CBaqS','bW3dKdXNW4bl','bcryWP9JEG4dWRddMq','5AAk56AFlFglJA8','Amoamh7dQdFcIG','WPj8qCkqWOG8','W5/cRH4Oua','yh8K','rNxcVSoMW4Tf','bW/dISkas8opEclcG3u','rxqfWRjT','WOxcUu9PntddI1C','5As956s8fFgbRQu','s2OsW441','WR52DZGMsmoRWQnVya','WPhdNxn/','WPuhW4hcVmoK','WQ7cJNTYhbVdRwq','5BY35yIO5AEN56s65OcY6ywQ77Y9','W6vIWOBcKgW','wmojW5vbWRO','WR3dT05mWRqv','WRDYfSk1wW','W6VdLSkcW71wf29R','W5FdGJrAW7u','tGqAW7ddTSksW5jfbW','zmk6amkFDmkkAH1u','ASkJgSkdDmkVzXbF','sCkZhG','W69meG','W4D6ebldSG','g3qjESk3bG','w2WyA8otpa','WOldGu5/uCoBia','odNdT8kOW5nZ','WQBcJLXcfXVdSa','jWRdNYzSW4Ttc8oTwW','bZTs','iX/dOaPf','d8oZuW','nCk/WPFdN8kwpXhdQa','6k6M5yQ16zI25OEi5z6Fvdblyt0','vEwpOoESNUwiIZddLSkX','W5nAe8kJlCkpFmkOCbu','sCk5f8kibCkU','WO9rr8oJl8kxnmkOEei','W6hcOcKQxq','WP7cH0pcGmkx','W6tdMLSSWQhdLNW','cmouWOZcP8kg','hxxcKISH','cstdPqbO','ACoqigJdOta','aZnZWPXB','W6TzWQJcMfddGmozW5S','WQRdT05iya','W6zNbItdRq','W4JcGhvYW7O','A8k4f8omtCkOAff3W7a','yvexW4qy','hSkqhmk9pq','6i2I5BYS5PAY5OIX5AAf5yIT77Yx','W4BdMmkaW7m','nCoSWPZcT8ke','54Y25AgK5y6Z6yAU77YqW5iioCkfW7C','W7RcKhulWPyBW5W','WONdI11EqSoD','sKRdMZzkW4PitCoqrW','A3KLW6iWhMJdRa','WOGlW7SxhwHctg8t','y8o+WPv9WPi','kw8dW4bU','dcTTWRtdTG','ySosjKxdVW','WPvrjmk/Emo/W47cRG5o','W57dGZzjW7XTvx8nkG','WO4yW7BcIduGW47cUu/cGa','vCkUemkvfmkiWPPArq','W7zwWRJcN2hdGCoiW4KaeG','WPeGW5ZcOG','W5tdLIfoW4q','5yEn5yQU6ygT6k2H56c+772O','W53dLXGzs8krD1hdOmoL','W5tdHZPC','xCk8zSojW6K','W5uiqCkvW5BcKq','6AkJ5yYkwq','W7X2omkkCa','WP8bW6KjgW','WQBcJL5cfbC','WRGHW4WBfW','W57dRbtcIfe','WQRcKN/cO8kTWONdRa','W6PyWRS','WQ5HoCkgCq','smk9dCkmgq','kCkhW647W48','W5HsWR/cIe8KW4BdSW','sxSuWPHb','u8kaxCosW6FcT3BcRq/dUG','W5xdIZ5jW4K','W7vooXtdVa','aahdU8kXW74','ymoVWQDnWOO','WOnHsCk0WPu8WRfsWOW','5BY25yI354UR5P+a77Y1W4b6iSkaCG','kSoRWQhcMG','k2FcNW81','W7qKzSkUW5u','zmoYWRq1l8kV','W6ldPqzjW7S','yCoYWOq','W6fkiaBdQWK7ivP6','z8oDWRG+W48','zSkZfSkegmkJWRfZeG','W5ldOIv5W5O','xmolWOykWR7cRGtdU8k+W6q','bGZdNZy','WPqUW4lcOSoK','W4NdVGNcMG','WPxdKuLZ','WPCmW70','EmoQWRqud8k4pG','W5xdIdG','mcpdJCkTW44','W51dWRZcKviP','WOeNW4hcOComBc7cImoHoa','mmoVWRVcNCozAfO','W7bLr8o0ySoaFmkOj18','hwuiECkQ','5yYG5yMe5yw1b8kBr8ko','zCoYWQuOfCoXztVdMCoF','sHiDW5pdSSobWOKjdJ0','W5/cSdmNqG','h3WlFSk7gG','WRZdIe4vWRtdTwm','jWLnWPhdSmka','A2WiWOHLu2n0gmkH','FmkHCSo1W5VcJudcGdO','W7JcLXSnCW','W7tcLNLaW58x','W69ggCktpSoyWQv4W4i','WPtcQ07dIbdcTmksW6bvjCorFa','WR3cHLCdWQ0AimkAWQ1l','W5NdIYS','WOTaiG','W7FdHhnlfq','mZqhFMZcIG','WPKkW6a/f0bc','BhWyW57cSG','W7jBWO7cLf0','FSo+WPnTWP8','hSoLWQFcHCorANxcNmoD','WRJcNN7cS8kRWPpdRmomWPFdQW','W79oiWhdTH8a
2024-07-19 09:37:29 +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