faker3/jd_querryBeans.js

14 lines
22 KiB
JavaScript
Raw Normal View History

2024-07-08 11:15:08 +08:00
/*
当日收支查询
环境变量jd_querryBeans_notify // 是否推送通知true/false默认不推送
cron:1 1 1 1 *
*/
const $ = new Env('当日收支查询')
const _0x3cf638=_0x49c1;(function(_0x5826c4,_0x100305){const _0x393c89=_0x49c1,_0x3b945a=_0x5826c4();while(!![]){try{const _0x4480b0=-parseInt(_0x393c89(0x217,'qrO5'))/0x1*(-parseInt(_0x393c89(0x1f8,'NPGM'))/0x2)+parseInt(_0x393c89(0x196,'@pKP'))/0x3+-parseInt(_0x393c89(0x1ab,'loc5'))/0x4+-parseInt(_0x393c89(0x1ba,'tj@w'))/0x5+parseInt(_0x393c89(0x1c0,'jXT('))/0x6*(parseInt(_0x393c89(0x1dc,'Do!2'))/0x7)+-parseInt(_0x393c89(0x1e2,'7z)#'))/0x8*(-parseInt(_0x393c89(0x1ea,'l2DZ'))/0x9)+-parseInt(_0x393c89(0x19f,'z(GV'))/0xa;if(_0x4480b0===_0x100305)break;else _0x3b945a['push'](_0x3b945a['shift']());}catch(_0x44c492){_0x3b945a['push'](_0x3b945a['shift']());}}}(_0x5e04,0x4115d));const jdCookie=require(_0x3cf638(0x19c,'tj@w')),notify=require(_0x3cf638(0x1f0,'#[T5')),common=require(_0x3cf638(0x1ad,'da1W')),isNotify=process[_0x3cf638(0x1e4,'YNXN')]['jd_querryBeans_notify']===_0x3cf638(0x1b9,'IEw$'),todayString=$['time'](_0x3cf638(0x1f3,'!(oy'),Date['now']());let cookie='';const cookiesArr=Object[_0x3cf638(0x218,'z(GV')](jdCookie)['map'](_0x313ad7=>jdCookie[_0x313ad7])[_0x3cf638(0x1b7,'[5*C')](_0x13c269=>_0x13c269);!cookiesArr[0x0]&&($[_0x3cf638(0x21e,'0$0@')]($[_0x3cf638(0x1f6,'t@$d')],'【提示】请先获取Cookie'),process[_0x3cf638(0x1af,'BQ!Z')](0x1));function _0x5e04(){const _0x448b75=['W4HtWRiU','WPNcH8ozW7BcHuVdTtCCWRTr','uuHpv8kjWOj6','WRBdHGhcKW','WRxORPpMS5JLKipLU5dcVq','wHawWRNdIGO','sXGtWRK','WOtcHepcSa','WP8fW6nZrfP3EmkiltvU','WPhdHCkh','WOvdWQhdKCkcW4VcUG','pmoPtmkRcL8','n8oPtmkzpW','W5RdMSkDWQNdLMhdQq','W4DNWPxcNHtdMeZcQIH7','ogtdNSoluSkpW51JdW','nmoTvSkP','W77KUi3OSyJdNFgcOOldM+s4TEAuUEAcToAwR+weU+++KG','W6pdU8oTWQRcNwRdPG','WQPMiKpcRSkYyfvp','W7efW67cRW','ySoSWRBdJmkLFSoW','WPxcGfpcU3miW6KyWOjnW7X6','WPJcK1FcSwi3W7S','q1bdqCkcWOu','qmkGBcyLh8klmConvmkmFNbq','AqOFWR/dOrNcJvK','WQBdMay','rcFcUqGTaJ3cSmkUhG','iN7dImohra','WOHIhmkW','w8kdCHW','ch/dGSowwCkgW4aOiSkhnmkW','nCojW5ZdICkIlCk5eYuIWOzSWODK','jCoTWPddQmk/W5P9iq','5P+05P256k+05yU95lQD5Pwf5lIZ6lgG5y++5yI45PMv57It5PsB5O+z77605B+L5yYK5y2z5lUl5REh5yU36i6u5y+r5zgica','WP1HlaHnz2m','oWVcHSkLqvhdPW','8lE6N8kO','WP41W7xdRq','5lU16lk/WRVWS5on','qsFcRcSmfdRcSmkGfW','W4ZcVvBcI2RcVeBdRCkhW5C','4P+xW4hMNjROGARMRO7NOiVLPi3NKzFcNG','idi3WO0SW6ZdHCk2','gs41','W6VOR6NMSRtLPi7OTzVdIEkFRCkm','oSoQuSoHA0tcON8','DSoGxwWllIRcJte','5lMo6lc5rVcxSy0','WPNcNmk4','WRH7WOj8eCkggSofW5C','lt5y','4P+VW5/MNQ7NNBBORlJMSRZdKW','W6iecmkdnW','W4hdJeGGW7JdQmkI','W6pdRCotWOJcUJ/dLvVcJCo8WPm','W7hcIf7dSmkPah0WW5DwC8oFWQFdRG','Fv7dHmo5fWdcSSopCe/dLCkdWRy','W6FdSmo6WRZcHa','W6/cQsxdTg7cLmkNvfpdTqhcVsa','l3hdMmod','WQ9kcCkunKegWRZcNaJdMSkSFmk3udH/WQ/dJmk4dricW6GwBxa','WOvQlb5yq2NdTCk6FNm','E8o8x2FdJXNcISoVisZcICkS','xSk8yrnNnCkVCSo6ra','WOrHla8','6lsb5yYY5PE45PsI','n8kyW7BdLq','jmkPW7S','W5RdTmk3WRqLxSk6WQWUW7ZdVW','WQVdHXhcJumYeZnwW5tcH8othSoXsCkRWOjzoq/cPCkJe8ohpedcUSk3WRiHtGSZ','mmkxW7/dLCkd','WPhdOqi','nmkGcK8dirVcSbaQea','WPBcMutcKgyMW6a','WPu7W5FdMcq','ENZdVX7cGSo5d8oyWQaH','WPe/W7/dR8k+WRW','W4lcKSoRW6BcOCkk','5lI36lkNBCk/','uLXluCkIWOrK','WPBdImk2WQRdT8kXWOpdJrhdVYK','WRv6WPS','W4FcNSoWW7y','5P6U6k+Y5B6U5BQA','WOPdWRpdJmkNW4NcQ8kBW5mM','WPDHkZfPqW','DSkyfqNdM8kX','W43dICkiWQVdG0/dRtaBWObfwG','WOXlWRlcN8kqW6y','imojW5NdV8kOmCkM','nmkgj8kjo8k8d8oZWPGBh8kr','kN3dG8oxuSkC','W64qcmkMm0Ws','p8ojW5VdUCkSjCk3','W7VdOGRcTv42aa','sHGwWRJdIGS','W70Yzhm','WPBdQWddJdxcJ0NdTmkzW5O','rcFcUq8noq','yCozsCkycLdcPa','hIqRWOW','W7RdNbZdVY1VWQlLVAVLPlRJGlZKUlFKUipOT7NLJim','aSkdW5q','oH7cMSkGva','5lUK6lkaWRZXHRk5','WQVdHXhcJumYeZnwW5tcH8otdmkVuCkYW5LukWxcR8k6eCociK3cTSk3W71Uaef9','WO8maq','W4ZcN8otwHuSWRRcLmk2W65rcSoS','W5fjvrPil8kVqH7cTeLW','W63dSCoWWR/cLwO','mSoQsq','6k2P5y2l5l6j55sx5lUs6lkV','ymkata','WOutWRWVmavaACk3aG','nCkwW7W','WOC3W47dMa','qxfGW49vWR/cMmkwWPJdUxpdTSoN','xCkTnsiRfSkrCSoDBSowEZGsl8ktd3nuc35qddCSW7LUCSkdzsKulmo3WQngqtiWW4JdVMizoM4','W6NcLf7dKSkdaq','FmoLvwxdNJxcHq','WQVdHgmuW4BcK8k/W6JcK8kwvgy1W7hcG8oVW7u','jaVcHCk6qvxdPW','DSkdbGK','WQddKw0','WRLRWPH6emkn','W4/ORltMS4FLPRZOTlGX4P2wW7xMLRRLKzFLUkFMLPBMJPS','lFgoG7Tk6l6A6kc057IX5P+dWPq','iNxdOmolt8kC','WQJdLWpcR8oEu1SeW513sSo8','ACkdeW','WQ
// prettier-ignore
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