jdpro/jd_dygetbeans.js

7 lines
64 KiB
JavaScript
Raw Normal View History

2024-06-28 07:47:44 +00:00
/*
23 1 * * * jd_dygetbeans.js
*/
const $ = new Env('每日抽豆');
2024-07-09 02:18:43 +00:00
var _0xod3='jsjiami.com.v7';const _0x1a1151=_0x5c54;(function(_0x468043,_0xc23d00,_0x5b13ed,_0x2a2613,_0x1ff060,_0x29b59d,_0x21d9db){return _0x468043=_0x468043>>0x5,_0x29b59d='hs',_0x21d9db='hs',function(_0xd16f92,_0x4fd6c8,_0x36db31,_0x3d3b03,_0x4057a7){const _0x18627a=_0x5c54;_0x3d3b03='tfi',_0x29b59d=_0x3d3b03+_0x29b59d,_0x4057a7='up',_0x21d9db+=_0x4057a7,_0x29b59d=_0x36db31(_0x29b59d),_0x21d9db=_0x36db31(_0x21d9db),_0x36db31=0x0;const _0x3f4404=_0xd16f92();while(!![]&&--_0x2a2613+_0x4fd6c8){try{_0x3d3b03=parseInt(_0x18627a(0x2e1,'dL9^'))/0x1*(-parseInt(_0x18627a(0x213,'$Xth'))/0x2)+parseInt(_0x18627a(0x301,'zGeM'))/0x3*(parseInt(_0x18627a(0x25f,'nquv'))/0x4)+-parseInt(_0x18627a(0xcb,'ArQp'))/0x5*(parseInt(_0x18627a(0x2de,'$Xth'))/0x6)+-parseInt(_0x18627a(0x174,'n2W1'))/0x7+-parseInt(_0x18627a(0x99,'*7Uo'))/0x8+-parseInt(_0x18627a(0x304,'ArQp'))/0x9*(-parseInt(_0x18627a(0xc2,'ymhy'))/0xa)+parseInt(_0x18627a(0x2b3,'OiCd'))/0xb;}catch(_0x212a6e){_0x3d3b03=_0x36db31;}finally{_0x4057a7=_0x3f4404[_0x29b59d]();if(_0x468043<=_0x2a2613)_0x36db31?_0x1ff060?_0x3d3b03=_0x4057a7:_0x1ff060=_0x4057a7:_0x36db31=_0x4057a7;else{if(_0x36db31==_0x1ff060['replace'](/[XFrpHCgGkhNwBeEtIUf=]/g,'')){if(_0x3d3b03===_0x4fd6c8){_0x3f4404['un'+_0x29b59d](_0x4057a7);break;}_0x3f4404[_0x21d9db](_0x4057a7);}}}}}(_0x5b13ed,_0xc23d00,function(_0x3f0183,_0x56b34e,_0x47ffaa,_0x263e08,_0x50455e,_0x328b03,_0x4e6167){return _0x56b34e='\x73\x70\x6c\x69\x74',_0x3f0183=arguments[0x0],_0x3f0183=_0x3f0183[_0x56b34e](''),_0x47ffaa=`\x72\x65\x76\x65\x72\x73\x65`,_0x3f0183=_0x3f0183[_0x47ffaa]('\x76'),_0x263e08=`\x6a\x6f\x69\x6e`,(0x1779d1,_0x3f0183[_0x263e08](''));});}(0x1800,0x4dafc,_0x4374,0xc2),_0x4374)&&(_0xod3=`\x20b`);const _0x13043e=(function(){const _0x5575aa=_0x5c54,_0x313e71={'QuNPW':function(_0x407e34,_0x2db4ce){return _0x407e34(_0x2db4ce);},'iFJKj':_0x5575aa(0x291,'(OI$'),'oqyTk':_0x5575aa(0x2c7,'[d1l'),'EDKmD':_0x5575aa(0x205,'ymhy'),'KLakW':function(_0x102779,_0x282166){return _0x102779!==_0x282166;},'JCQec':_0x5575aa(0x165,']ooa'),'TsqyO':_0x5575aa(0x2e0,'n2W1')};let _0x568e70=!![];return function(_0x279cc3,_0x23064d){const _0x1b8212=_0x5575aa,_0xcd1e84={'BeqOX':function(_0x2f5e23,_0x2e8a8a){const _0x4406e3=_0x5c54;return _0x313e71[_0x4406e3(0x1d4,'E0Fq')](_0x2f5e23,_0x2e8a8a);},'qRifl':_0x313e71[_0x1b8212(0x222,'[d1l')],'broQf':_0x313e71[_0x1b8212(0x1be,'ymhy')],'XnThi':_0x313e71[_0x1b8212(0xe7,'[d1l')],'SasRQ':function(_0x25a347,_0xf21ccc){const _0x232ab0=_0x1b8212;return _0x313e71[_0x232ab0(0xe8,'2dgu')](_0x25a347,_0xf21ccc);},'MeGOV':_0x313e71[_0x1b8212(0x2bb,'LQ77')],'DDSsH':_0x313e71[_0x1b8212(0x97,'$MH%')]},_0x3d6ecf=_0x568e70?function(){const _0x53eb2f=_0x1b8212;if(_0xcd1e84[_0x53eb2f(0xe5,'Wv8c')](_0xcd1e84[_0x53eb2f(0xd9,'SFkc')],_0xcd1e84[_0x53eb2f(0x260,'E0Fq')])){if(_0x23064d){const _0x435194=_0x23064d[_0x53eb2f(0x33e,'n2W1')](_0x279cc3,arguments);return _0x23064d=null,_0x435194;}}else try{_0xcd1e84[_0x53eb2f(0xb7,'sLmS')](_0x59da22,_0xcd1e84[_0x53eb2f(0xf7,'[d1l')]),_0x2f59ba=_0xcd1e84[_0x53eb2f(0xa5,'w01f')](_0x533269,_0xcd1e84[_0x53eb2f(0x10e,'p^7Y')]),_0x279dfd[_0x53eb2f(0x139,'VDfI')]=_0x2fdada[_0x53eb2f(0x189,']b(P')](_0x414299[_0x53eb2f(0x24b,'#b1B')][_0x53eb2f(0x196,'IkUB')](_0x451b1b)),_0x463657[_0x53eb2f(0xcd,'O6%L')]=_0x353604[_0x53eb2f(0x1ce,'!ag^')](_0x435183[_0x53eb2f(0x31d,']s[^')][_0x53eb2f(0x11b,'Atuk')](_0x24d59f));}catch{_0x494f2d[_0x53eb2f(0x2d3,'6(FF')](_0xcd1e84[_0x53eb2f(0x214,'[IP]')]),_0x5bdecb[_0x53eb2f(0xe0,'E0Fq')]=_0x39d098[_0x53eb2f(0x22c,'n2W1')],_0x430215[_0x53eb2f(0x2b5,'[IP]')]=_0x9e5d22[_0x53eb2f(0xbc,'0y03')];}}:function(){};return _0x568e70=![],_0x3d6ecf;};}()),_0x5e2ebe=_0x13043e(this,function(){const _0x4826f2=_0x5c54,_0x3cf8d2={'KWGdy':_0x4826f2(0x280,'(OI$')};return _0x5e2ebe[_0x4826f2(0x23d,']s[^')]()[_0x4826f2(0x27c,'wgm(')](_0x3cf8d2[_0x4826f2(0x1aa,'!8h$')])[_0x4826f2(0x335,'E0Fq')]()[_0x4826f2(0x242,'6(FF')](_0x5e2ebe)[_0x4826f2(0x10a,'6(FF')](_0x3cf8d2[_0x4826f2(0x1ed,'VDfI')]);});_0x5e2ebe();const _0x543d48=$[_0x1a1151(0xae,'SFkc')]()?require(_0x1a1151(0xc4,'!ag^')):'',_0x55b956=$[_0x1a
2024-06-28 07:47: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