jdpro/jd_wanyiwan.js

7 lines
140 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
23 5,10 * * * jd_wanyiwan.js
*/
const $ = new Env('玩一玩_任务');
const bdy_0x67597b=bdy_0x2ce5;(function(_0x354e76,_0x15fbc9){const bdy_0x1d4e68={_0x52a94a:'0x17f',_0x313f14:'bIN$',_0x5b5d19:'0x1d1',_0x11a94e:'^Q9s',_0x36fa6a:'0x343',_0x4ebac5:'uL2v',_0x5624e8:'0x311',_0x1f159d:'4[EF',_0x1b7543:'0x171',_0x540f3a:'AEl0',_0x5c8fd0:'0x353',_0x1658a4:'0x147',_0x13a5c3:'3PUz',_0xcead98:'0x211',_0x47c185:'aepu',_0x4f9c24:'0x425',_0x3891f4:')tA9',_0x229131:'0x1f0',_0x259136:'Gn8W',_0x130655:'0x36b',_0x2fb0ef:'3PUz',_0x41eaf2:'0x187',_0x476fe9:'&tsX'},_0x43f0ca=bdy_0x2ce5,_0x4b90e9=_0x354e76();while(!![]){try{const _0x546c75=parseInt(_0x43f0ca(bdy_0x1d4e68._0x52a94a,bdy_0x1d4e68._0x313f14))/(-0x1a75+-0xb37+-0x1*-0x25ad)+parseInt(_0x43f0ca(bdy_0x1d4e68._0x5b5d19,bdy_0x1d4e68._0x11a94e))/(-0x3*-0x34c+0x21ca+0x5*-0x8bc)+-parseInt(_0x43f0ca(bdy_0x1d4e68._0x36fa6a,bdy_0x1d4e68._0x4ebac5))/(0x1a*0x32+-0x1ebd+0x19ac)*(-parseInt(_0x43f0ca(bdy_0x1d4e68._0x5624e8,bdy_0x1d4e68._0x1f159d))/(-0x3*-0x3fb+0x20cc*-0x1+0x14df))+-parseInt(_0x43f0ca(bdy_0x1d4e68._0x1b7543,bdy_0x1d4e68._0x540f3a))/(-0x14cf+-0x513+-0x19e7*-0x1)*(parseInt(_0x43f0ca(bdy_0x1d4e68._0x5c8fd0,bdy_0x1d4e68._0x540f3a))/(-0x210a+-0xa*0x77+-0x12db*-0x2))+-parseInt(_0x43f0ca(bdy_0x1d4e68._0x1658a4,bdy_0x1d4e68._0x13a5c3))/(-0x736+0x1968+-0x122b)*(-parseInt(_0x43f0ca(bdy_0x1d4e68._0xcead98,bdy_0x1d4e68._0x47c185))/(0xb72+-0x20b*0x3+-0xb*0x7b))+parseInt(_0x43f0ca(bdy_0x1d4e68._0x4f9c24,bdy_0x1d4e68._0x3891f4))/(-0x1*-0xecd+0x122e+-0x2*0x1079)*(-parseInt(_0x43f0ca(bdy_0x1d4e68._0x229131,bdy_0x1d4e68._0x259136))/(-0x198c+0x1*0x91d+-0x1079*-0x1))+parseInt(_0x43f0ca(bdy_0x1d4e68._0x130655,bdy_0x1d4e68._0x2fb0ef))/(0x17b3+0x1*-0x24d4+0x464*0x3)*(parseInt(_0x43f0ca(bdy_0x1d4e68._0x41eaf2,bdy_0x1d4e68._0x476fe9))/(0x269b+-0x849+-0x1e46));if(_0x546c75===_0x15fbc9)break;else _0x4b90e9['push'](_0x4b90e9['shift']());}catch(_0x46ddb7){_0x4b90e9['push'](_0x4b90e9['shift']());}}}(bdy_0x22c6,-0x1*-0xce2d0+-0x7e476+0x1*0x38c93));const bdy_0x10c26d=$[bdy_0x67597b('0x19c','AEl0')]()?require(bdy_0x67597b('0x20a','MGXb')):'',bdy_0x2536f9=$[bdy_0x67597b('0x43a','WA5L')]()?require(bdy_0x67597b('0x3a6','AvWM')):'',bdy_0x34194d=require(bdy_0x67597b('0x31d','MGXb')),bdy_0x3123d0=require(bdy_0x67597b('0x41a','w3lr')),bdy_0x37b5e7=process[bdy_0x67597b('0x33d','4[EF')][bdy_0x67597b('0x320','8DWk')]?process[bdy_0x67597b('0x161','#F[z')][bdy_0x67597b('0x483','3PUz')]:bdy_0x67597b('0x2a4','OHHe'),bdy_0x44d4c2=process[bdy_0x67597b('0x220',')tA9')][bdy_0x67597b('0x194','sYwY')]?process[bdy_0x67597b('0x4ac','SL[&')][bdy_0x67597b('0x22e','Q^gu')]:'1';let bdy_0x35c73c=bdy_0x67597b('0x32e',')tA9'),bdy_0x4883dd='',bdy_0x2636e2={};if(process[bdy_0x67597b('0x220',')tA9')][bdy_0x67597b('0x368','*3Ac')])try{require(bdy_0x67597b('0x19a','uL2v')),bdy_0x2636e2=require(bdy_0x67597b('0x441','8DWk')),$[bdy_0x67597b('0x339','PA^2')]=bdy_0x2636e2[bdy_0x67597b('0x448','HTkQ')]($[bdy_0x67597b('0x431','Q^gu')][bdy_0x67597b('0x183','9RBO')]($)),$[bdy_0x67597b('0x2e3','4[EF')]=bdy_0x2636e2[bdy_0x67597b('0x499','^Q9s')]($[bdy_0x67597b('0x30e','cTsZ')][bdy_0x67597b('0x170','8IMK')]($));}catch{$[bdy_0x67597b('0x3b8','AEl0')](bdy_0x67597b('0x15a','AEl0')),$[bdy_0x67597b('0x453','8x[a')]=$[bdy_0x67597b('0x45c','^Q9s')],$[bdy_0x67597b('0x342','MGXb')]=$[bdy_0x67597b('0x384','ypiB')];}else $[bdy_0x67597b('0x2a6','WA5L')]=$[bdy_0x67597b('0x2f8','N)2W')],$[bdy_0x67597b('0x3b0','Gn8W')]=$[bdy_0x67597b('0x2f9','AEl0')];let bdy_0x5b1bc7=[],bdy_0x56650d='',bdy_0x2d74de=-0x1ad6+-0x3ad*0xa+0x3f98;if($[bdy_0x67597b('0x262','^Q9s')]()){var bdy_0x2dc113=new Buffer[(bdy_0x67597b('0x4f2','8IMK'))](bdy_0x67597b('0x34f','sYwY'),bdy_0x67597b('0x2d2','BrqH'))[bdy_0x67597b('0x1bb','h^1X')](bdy_0x67597b('0x2f5','OHHe'));Object[bdy_0x67597b('0x37a','N)2W')](bdy_0x10c26d)[bdy_0x67597b('0x268','v4kN')](_0x56f7b7=>{const bdy_0xf4aaff={_0x3e728c:'0x363',_0x2a302b:'8DWk'},_0x301fe8=bdy_0x67597b;bdy_0x5b1bc7[_0x301fe8(bdy_0xf4aaff._0x3e728c,bdy_0xf4aaff._0x2a302b)](bdy_0x10c26d[_0x56f7b7]);});if(process[bdy_0x67597b('0x350','MGXb')][bdy_0x67597b('0x328','OHHe')]&&process[bdy_0x67597b('0x15b','E3sX')][bdy_0x67597b('0x3d8','PA^2'
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