jdpro/jd_AutoEval.js

7 lines
155 KiB
JavaScript
Raw Normal View History

2024-01-02 12:59:48 +00:00
/**
带图评价
3 12 3 12 * jd_AutoEval.js
*/
const $ = new Env('带图评价晒单');
var _0xodk='jsjiami.com.v7';const _0x153cdc=_0x42f8;(function(_0x261090,_0x2d4c3e,_0xc868eb,_0x5b372c,_0x1b0476,_0x2a4b66,_0x5af0fe){return _0x261090=_0x261090>>0x4,_0x2a4b66='hs',_0x5af0fe='hs',function(_0x16fd3c,_0x1ba307,_0x233d5b,_0x2e0777,_0x379d55){const _0x435d34=_0x42f8;_0x2e0777='tfi',_0x2a4b66=_0x2e0777+_0x2a4b66,_0x379d55='up',_0x5af0fe+=_0x379d55,_0x2a4b66=_0x233d5b(_0x2a4b66),_0x5af0fe=_0x233d5b(_0x5af0fe),_0x233d5b=0x0;const _0x380ee9=_0x16fd3c();while(!![]&&--_0x5b372c+_0x1ba307){try{_0x2e0777=-parseInt(_0x435d34(0x72d,'2kvz'))/0x1*(parseInt(_0x435d34(0x7ca,'$Ll7'))/0x2)+-parseInt(_0x435d34(0x6e1,'j@!8'))/0x3*(parseInt(_0x435d34(0x54f,'#8VC'))/0x4)+-parseInt(_0x435d34(0x545,'NpuI'))/0x5*(parseInt(_0x435d34(0x41b,'fJ^1'))/0x6)+parseInt(_0x435d34(0x177,'2kvz'))/0x7*(-parseInt(_0x435d34(0x480,'tc9Y'))/0x8)+-parseInt(_0x435d34(0x807,'qmB&'))/0x9+parseInt(_0x435d34(0x4cf,'og[W'))/0xa+parseInt(_0x435d34(0x29e,'1l@H'))/0xb;}catch(_0x1259ba){_0x2e0777=_0x233d5b;}finally{_0x379d55=_0x380ee9[_0x2a4b66]();if(_0x261090<=_0x5b372c)_0x233d5b?_0x1b0476?_0x2e0777=_0x379d55:_0x1b0476=_0x379d55:_0x233d5b=_0x379d55;else{if(_0x233d5b==_0x1b0476['replace'](/[wgFdbDehOCJtylQVKAI=]/g,'')){if(_0x2e0777===_0x1ba307){_0x380ee9['un'+_0x2a4b66](_0x379d55);break;}_0x380ee9[_0x5af0fe](_0x379d55);}}}}}(_0xc868eb,_0x2d4c3e,function(_0x5eefc5,_0x654ca1,_0x4cefd4,_0x28d581,_0x996f95,_0x5f2d57,_0x51fe38){return _0x654ca1='\x73\x70\x6c\x69\x74',_0x5eefc5=arguments[0x0],_0x5eefc5=_0x5eefc5[_0x654ca1](''),_0x4cefd4=`\x72\x65\x76\x65\x72\x73\x65`,_0x5eefc5=_0x5eefc5[_0x4cefd4]('\x76'),_0x28d581=`\x6a\x6f\x69\x6e`,(0x14b612,_0x5eefc5[_0x28d581](''));});}(0xc20,0x806f0,_0x556a,0xc4),_0x556a)&&(_0xodk=`\x2c1`);(function(_0x2df71a,_0x36858d){const _0x1edc1d=_0x42f8,_0x5aa20a={'BbRqf':function(_0x53610f,_0x367c43){return _0x53610f!==_0x367c43;},'MsFxq':_0x1edc1d(0x120,'H5ay'),'AovmH':_0x1edc1d(0x6a1,'PN]P'),'mDaoT':_0x1edc1d(0x526,'@b7A'),'rKffz':function(_0x22b63f,_0xd66d7){return _0x22b63f+_0xd66d7;},'kmhEi':function(_0x3c55fb,_0x54fcc3){return _0x3c55fb*_0x54fcc3;},'DEukD':function(_0x578b51,_0x55b628){return _0x578b51(_0x55b628);},'pAgdT':_0x1edc1d(0x433,'&6ig'),'Cwvyr':_0x1edc1d(0x24d,'$Ll7'),'moZWK':_0x1edc1d(0x377,'8tFr'),'Mmchx':_0x1edc1d(0x61b,'pUAb'),'btKlt':function(_0x5141d6,_0x63a6e3){return _0x5141d6+_0x63a6e3;},'sIFhE':function(_0x19e0c3,_0x2baa2e){return _0x19e0c3+_0x2baa2e;},'dGbiY':function(_0x186040,_0x4f409c){return _0x186040*_0x4f409c;},'AuHPm':function(_0x32266f){return _0x32266f();},'CeIQE':function(_0x4583a7,_0x579b19){return _0x4583a7+_0x579b19;},'WhJJu':function(_0x35ac2d,_0x4a8cea){return _0x35ac2d+_0x4a8cea;},'syRYi':function(_0x21cb23,_0x461d14){return _0x21cb23/_0x461d14;},'CAOlO':function(_0xa0c373,_0x42e4a1){return _0xa0c373(_0x42e4a1);},'JkWfW':_0x1edc1d(0x42b,'&!8A'),'sUCeR':function(_0x4d403c,_0x401267){return _0x4d403c+_0x401267;},'RDvdl':function(_0x1676ba,_0x5cf87a){return _0x1676ba*_0x5cf87a;},'jFnem':function(_0x235b50,_0x524235){return _0x235b50/_0x524235;},'stetr':function(_0x402596,_0x25a0ae){return _0x402596(_0x25a0ae);},'POMhz':_0x1edc1d(0x3e6,'tm3#'),'HYTSM':function(_0x2f68a2,_0x55a8f4){return _0x2f68a2*_0x55a8f4;},'kdGYG':function(_0x3f5c06,_0x1fe717){return _0x3f5c06/_0x1fe717;},'jRjag':function(_0xe63d34,_0x59b659){return _0xe63d34(_0x59b659);},'aVwVu':function(_0x537a60,_0x35bb6){return _0x537a60(_0x35bb6);},'YCVpY':_0x1edc1d(0x2fc,'50NG'),'rOOXk':function(_0x39efff,_0x2fac2b){return _0x39efff+_0x2fac2b;},'SINjA':function(_0x3c45f3,_0x440670){return _0x3c45f3*_0x440670;},'JDavD':function(_0x2917aa,_0x4ba91e){return _0x2917aa/_0x4ba91e;},'DLWsj':function(_0xb2d50c,_0x162b49){return _0xb2d50c(_0x162b49);},'nVauL':function(_0xba3d39,_0x46ec9a){return _0xba3d39(_0x46ec9a);},'nyEOd':_0x1edc1d(0x31f,'Qnp1'),'EXWzV':function(_0x3225e0,_0x1bf6fa){return _0x3225e0*_0x1bf6fa;},'xuzoU':function(_0x2e4ba0,_0xb1b026){return _0x2e4ba0/_0xb1b026;},'xhLkT':function(_0xeae0ee,_0x228f83){return _0xeae0ee(_0x228f83);},'QVREx':_0x1edc1d(0x1d8,'@b7A'),'TSrAY':function(_0xa5c6e1,_0x1af645){return _0xa5c6e1+_0x1af645;},'
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