jdpro/jd_AutoEval.js

7 lines
118 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/**
带图评价
3 12 3 12 * jd_AutoEval.js
*/
const $ = new Env('带图评价晒单');
2024-10-10 09:49:45 +00:00
function EXk7YH(){}var OHYkyT=Object['defineProperty'],kCsLMt4,z33Flho,HnQPg8,_l6glR6,N00MlL,iVIWho,hM0kxaa,W7D5wk,KAYiIb7,YdGJHr,ck8Xbgw,uOpkPDu,eRiTwb,ctkQXnj,mc0nTD,GNTHQo,U0uy8T,gZm2QG,f4kgYL;function Y7KtY9a(EXk7YH){return kCsLMt4[EXk7YH>0x14d?EXk7YH-0x26:EXk7YH<0x14d?EXk7YH<0x14d?EXk7YH<0x5?EXk7YH+0x25:EXk7YH-0x6:EXk7YH-0x29:EXk7YH+0x4]}kCsLMt4=x1oryT();function Lnedx9Y(EXk7YH,OHYkyT){z33Flho(EXk7YH,Y7KtY9a(0x44),{value:OHYkyT,configurable:!0x0});return EXk7YH}EXk7YH(z33Flho=Object.defineProperty,HnQPg8=RFTv8S5((EXk7YH,OHYkyT)=>{return OHYkyT(EXk7YH())},0x2)(BWiSJCh,OuO6Iu));var PlyP7i=[],AyUQosZ=[EBe9ol(Y7KtY9a(0x2e)),EBe9ol(0x1),EBe9ol(0x2),EBe9ol(Y7KtY9a(0x2d)),EBe9ol(0x4),EBe9ol(0x5),EBe9ol(0x6),EBe9ol(Y7KtY9a(0x3b)),EBe9ol(Y7KtY9a(0x4b)),EBe9ol(0x9),EBe9ol(Y7KtY9a(0x40)),EBe9ol(Y7KtY9a(0x69)),EBe9ol(0xc),'r<4,a5,iA|y*(k',EBe9ol(Y7KtY9a(0x7)),EBe9ol(0xe),EBe9ol(0xf),EBe9ol(0x10),EBe9ol(Y7KtY9a(0x8)),EBe9ol(Y7KtY9a(0x6b)),EBe9ol(Y7KtY9a(0x6)),EBe9ol(0xd),EBe9ol(0xf),EBe9ol(0x10),EBe9ol(Y7KtY9a(0x39)),EBe9ol(0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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