jdpro/jd_global_task_.js

6 lines
103 KiB
JavaScript
Raw Normal View History

2024-08-06 15:46:44 +00:00
/*
2024-10-09 13:54:20 +00:00
33 0,16 * * * jd_global_task_.js
2024-08-06 15:46:44 +00:00
*/
const $ = new Env('京豆国际频道任务');
2024-10-09 13:54:20 +00:00
function M45G3R(){}var wDor9Os=Object['defineProperty'],tllJ7c6,axgXoc,QMFtLTo,keGHBF,nEazVFI,PCPmi4,gMPGo2x,B2LyOy3,vwop8TG,e5k07c,oMAqC46,U6jMgrO,Os197w,DYKmszZ,WojtL9R,wBaa3hL,hFHYvKD,w1kbdy,tUpLVN;function ky0tLR(M45G3R){return tllJ7c6[M45G3R>0xd1?M45G3R+0x4a:M45G3R>-0x44?M45G3R<-0x44?M45G3R+0x2c:M45G3R+0x43:M45G3R+0x4c]}tllJ7c6=QJ5uk3();function BmxEaC(M45G3R,wDor9Os){return axgXoc(M45G3R,ky0tLR(-0x43),{value:wDor9Os,configurable:!0x0})}M45G3R(axgXoc=Object.defineProperty,QMFtLTo=BmxEaC(ubV_eq((...wDor9Os)=>{var axgXoc=ubV_eq(wDor9Os=>{return tllJ7c6[wDor9Os>0xb3?wDor9Os+0x25:wDor9Os<-0x62?wDor9Os-0x1a:wDor9Os+0x61]},0x1);M45G3R(wDor9Os[axgXoc(-0x61)]=axgXoc(-0x34),wDor9Os[axgXoc(-0x60)]=-ky0tLR(-0x41));if(wDor9Os[ky0tLR(-0x42)]>wDor9Os[0x81]+axgXoc(-0x3b)){var QMFtLTo=ubV_eq(wDor9Os=>{return tllJ7c6[wDor9Os>-0x15?wDor9Os<-0x15?wDor9Os-0xe:wDor9Os>0x100?wDor9Os-0x5c:wDor9Os+0x14:wDor9Os-0x3c]},0x1);return wDor9Os[wDor9Os[QMFtLTo(-0x13)]+0xf7]}else{var keGHBF=ubV_eq(wDor9Os=>{return tllJ7c6[wDor9Os<-0x46?wDor9Os+0x36:wDor9Os<-0x46?wDor9Os+0x7:wDor9Os+0x45]},0x1);return wDor9Os[wDor9Os[0x81]+(wDor9Os[wDor9Os[0x81]+0x85]-(wDor9Os[keGHBF(-0x44)]-0x5))](wDor9Os[wDor9Os[keGHBF(-0x44)]+axgXoc(-0x5f)]())}}),0x2)(ywe47t,f_Gcm8));var Go3s1i=[],SElDjx=[qLHNzE(ky0tLR(-0x15)),qLHNzE(ky0tLR(-0x17)),qLHNzE(0x2),qLHNzE(0x3),qLHNzE(0x4),qLHNzE(ky0tLR(-0x12)),qLHNzE(ky0tLR(-0xa)),qLHNzE(0x7),qLHNzE(ky0tLR(-0x40)),qLHNzE(ky0tLR(0x1c)),'[`,dWtgB7,QnD|7',qLHNzE(ky0tLR(0x13)),qLHNzE(ky0tLR(0x14)),qLHNzE(0xc),qLHNzE(ky0tLR(-0x6)),qLHNzE(ky0tLR(-0x7)),qLHNzE(ky0tLR(-0x10)),qLHNzE(0x10),qLHNzE(0x11),qLHNzE(ky0tLR(0x19)),qLHNzE(0x13),qLHNzE(0x14),qLHNzE(0x15),qLHNzE(0x16),qLHNzE(0x17),';!+s~Q(nIG#&WKpojs]dec%/r/Ow?^Vl9mcuTsb)NCyd|12!a|Xy>Cd;5HzZ)VmK`L',qLHNzE(0x11),qLHNzE(0x18),qLHNzE(0x19),qLHNzE(0x1a),qLHNzE(ky0tLR(-0x3c)),qLHNzE(ky0tLR(0x21)),qLHNzE(0x1d),qLHNzE(0x1e),'o/P[`C||Nw',qLHNzE(ky0tLR(-0x40)),qLHNzE(0x1f),qLHNzE(ky0tLR(-0x3f)),qLHNzE(0x12),qLHNzE(ky0tLR(-0x3d)),qLHNzE(0x21),qLHNzE(0x22),qLHNzE(0x23),qLHNzE(ky0tLR(0x30)),qLHNzE(0x25),'sq.F*!#r7,e]d|"e6"b2H',qLHNzE(ky0tLR(0x6d)),qLHNzE(ky0tLR(0x5c)),qLHNzE(0x28),qLHNzE(0x29),qLHNzE(ky0tLR(0x2d)),qLHNzE(0x2b),qLHNzE(ky0tLR(-0x3f)),qLHNzE(ky0tLR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0tLR(-0x38)),qLHNzE(ky0tLR(-0x2c)),qLHNzE(ky0tLR(0x4d)),qLHNzE(0x3d),qLHNzE(0x5f),qLHNzE(0x60),qLHNzE(0x61),qLHNzE(0x62),qLHNzE(0x63),qLHNzE(ky0tLR(-0x3b)),qLHNzE(ky0tLR(0x16)),qLHNzE(ky0tLR(0x50)),qLHNzE(0x53),qLHNzE(ky0tLR(-0x3b)),qLHNzE(0x65),qLHNzE(0x66),qLHNzE(0x17),qLHNzE(ky0tLR(-0x1a)),qLHNzE(0x67),qLHNzE(0x68),qLHNzE(0x69),'hd?GSS|L',qLHNzE(0x6a),qLHNzE(0x6b),qLHNzE(0x6c),qLHNzE(0x6d),qLHNzE(0x6e),qLHNzE(0x6f),qLHNzE(ky0tLR(0x54)),qLHNzE(0x71),'V:b2Q^Zv#f5R6|7',qLHNzE(0x72),qLHNzE(ky0tLR(0x5e)),qLHNzE(0x15),qLHNzE(0x17),qLHNzE(ky0tLR(-0x21)),qLHNzE(0x75),qLHNzE(0x76),qLHNzE(0x77),qLHNzE(0x78),qLHNzE(ky0tLR(-0x3a)),qLHNzE(ky0tLR(-0x34)),'(6|F',qLHNzE(0x7a),qLHNzE(0x7b),qLHNzE(0x7c),qLHNzE(ky0tLR(0x60)),qLHNzE(0x7e),qLHNzE(ky0tLR(-
2024-08-06 15:46: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