jdpro/jd_global_task.js

6 lines
78 KiB
JavaScript
Raw Normal View History

2024-07-13 07:41:46 +00:00
/*
15 1 * * * jd_global_task.js
*/
const $ = new Env('京豆国际频道任务');
2024-07-13 12:47:28 +00:00
var _0xodq='jsjiami.com.v7';const _0xeacc2=_0x5b7d;(function(_0x47444d,_0x464149,_0x1b9435,_0x2d5647,_0x5aa7bd,_0x455bc7,_0x30d61e){return _0x47444d=_0x47444d>>0x1,_0x455bc7='hs',_0x30d61e='hs',function(_0x3ec76f,_0x1e63aa,_0x3f62ec,_0x5808b6,_0x13641f){const _0x429da2=_0x5b7d;_0x5808b6='tfi',_0x455bc7=_0x5808b6+_0x455bc7,_0x13641f='up',_0x30d61e+=_0x13641f,_0x455bc7=_0x3f62ec(_0x455bc7),_0x30d61e=_0x3f62ec(_0x30d61e),_0x3f62ec=0x0;const _0xb0c802=_0x3ec76f();while(!![]&&--_0x2d5647+_0x1e63aa){try{_0x5808b6=parseInt(_0x429da2(0x276,']2zP'))/0x1*(parseInt(_0x429da2(0x36e,'XG9E'))/0x2)+parseInt(_0x429da2(0x394,'2j5t'))/0x3+parseInt(_0x429da2(0x534,'^Fpj'))/0x4*(-parseInt(_0x429da2(0x4dd,'irOO'))/0x5)+-parseInt(_0x429da2(0x3b6,'3z*n'))/0x6+-parseInt(_0x429da2(0x338,'PQvG'))/0x7*(parseInt(_0x429da2(0x438,']SkG'))/0x8)+-parseInt(_0x429da2(0x492,'HEQd'))/0x9+parseInt(_0x429da2(0x3eb,'y%aB'))/0xa;}catch(_0x1db605){_0x5808b6=_0x3f62ec;}finally{_0x13641f=_0xb0c802[_0x455bc7]();if(_0x47444d<=_0x2d5647)_0x3f62ec?_0x5aa7bd?_0x5808b6=_0x13641f:_0x5aa7bd=_0x13641f:_0x3f62ec=_0x13641f;else{if(_0x3f62ec==_0x5aa7bd['replace'](/[BeCKlQkDnpJRIqMLFYfW=]/g,'')){if(_0x5808b6===_0x1e63aa){_0xb0c802['un'+_0x455bc7](_0x13641f);break;}_0xb0c802[_0x30d61e](_0x13641f);}}}}}(_0x1b9435,_0x464149,function(_0x1ca1d9,_0x37fad7,_0x1129a1,_0x116002,_0x447fa9,_0x12e531,_0x194d4d){return _0x37fad7='\x73\x70\x6c\x69\x74',_0x1ca1d9=arguments[0x0],_0x1ca1d9=_0x1ca1d9[_0x37fad7](''),_0x1129a1=`\x72\x65\x76\x65\x72\x73\x65`,_0x1ca1d9=_0x1ca1d9[_0x1129a1]('\x76'),_0x116002=`\x6a\x6f\x69\x6e`,(0x178911,_0x1ca1d9[_0x116002](''));});}(0x196,0x1f446,_0x59cb,0xcd),_0x59cb)&&(_0xodq=0xcd);const _0x1e470c=$[_0xeacc2(0x30e,'Vi0d')]()?require(_0xeacc2(0x318,'q!!*')):'',_0x2d50f6=$[_0xeacc2(0x42a,'6h4m')]()?require(_0xeacc2(0x3f3,'HYiV')):'',_0x4877e9=require(_0xeacc2(0x417,'##(P')),_0x5cb060=require(_0xeacc2(0x55c,'EXi5')),_0x27c7cc=require(_0xeacc2(0x2e0,'##(P')),_0x337c07=require(_0xeacc2(0x515,'GwF]'));let _0x26fbe4=!![],_0x3cb2e1=[],_0x4c5f66='',_0x4e23a2='',_0x27f020={};if(process[_0xeacc2(0x478,'ZV2d')][_0xeacc2(0x45a,'KyFe')]){const _0x4dbacd=process[_0xeacc2(0x4fd,'GVQx')][_0xeacc2(0x368,'gh]S')]?(process[_0xeacc2(0x2b3,'rrNx')][_0xeacc2(0x49e,'hSv!')]+_0xeacc2(0x56c,'gh]S'))[_0xeacc2(0x52f,'P*6E')]('&'):'';if(_0x4dbacd=='')try{require(_0xeacc2(0x431,'!o@e')),_0x27f020=require(_0xeacc2(0x457,'KyFe')),$[_0xeacc2(0x251,'jxZJ')]=_0x27f020[_0xeacc2(0x402,'KpxU')]($[_0xeacc2(0x259,'6h4m')][_0xeacc2(0x480,'GVQx')]($)),$[_0xeacc2(0x2bb,'tqOA')]=_0x27f020[_0xeacc2(0x42d,'RFKn')]($[_0xeacc2(0x212,'KpxU')][_0xeacc2(0x4c4,'tqOA')]($));}catch{$[_0xeacc2(0x465,'gh]S')](_0xeacc2(0x39b,'6h4m')),$[_0xeacc2(0x1f8,'gh]S')]=$[_0xeacc2(0x32b,'GVQx')],$[_0xeacc2(0x3d3,'HEQd')]=$[_0xeacc2(0x4d0,'HEQd')];}else{if(_0x4dbacd[_0xeacc2(0x3fe,'3z*n')](_0xa25036=>process[_0xeacc2(0x2ae,'GwF]')][_0xeacc2(0x49b,'GVQx')][_0xeacc2(0x51a,'ZtBk')](_0xa25036))[_0xeacc2(0x36b,'yN)e')]!=0x0)try{require(_0xeacc2(0x27e,'jxZJ')),_0x27f020=require(_0xeacc2(0x2e9,'JeZ8')),$[_0xeacc2(0x392,'0sMT')]=_0x27f020[_0xeacc2(0x29a,'nVgg')]($[_0xeacc2(0x2c1,'uJhe')][_0xeacc2(0x2aa,'nVgg')]($)),$[_0xeacc2(0x1fe,'ZtBk')]=_0x27f020[_0xeacc2(0x504,'jxZJ')]($[_0xeacc2(0x284,'RFKn')][_0xeacc2(0x382,'P*6E')]($));}catch{$[_0xeacc2(0x4be,'q!!*')](_0xeacc2(0x29e,'HYiV')),$[_0xeacc2(0x301,'^Fpj')]=$[_0xeacc2(0x508,'xIgK')],$[_0xeacc2(0x407,'KpxU')]=$[_0xeacc2(0x4ed,'y%aB')];}else $[_0xeacc2(0x50e,'YqMM')]=$[_0xeacc2(0x3e6,'HYiV')],$[_0xeacc2(0x2ea,'y%aB')]=$[_0xeacc2(0x227,'[EhB')];}}else $[_0xeacc2(0x50e,'YqMM')]=$[_0xeacc2(0x3f5,'6h4m')],$[_0xeacc2(0x3a0,'YqMM')]=$[_0xeacc2(0x555,'P*6E')];if($[_0xeacc2(0x40b,'^Fpj')]()){Object[_0xeacc2(0x294,'WgkP')](_0x2d50f6)[_0xeacc2(0x51f,'iaLU')](_0x5362d1=>{const _0xf5a5e4=_0xeacc2;_0x3cb2e1[_0xf5a5e4(0x31b,'KyFe')](_0x2d50f6[_0x5362d1]);});if(process[_0xeacc2(0x56b,'2j5t')][_0xeacc2(0x3a7,'JeZ8')]&&process[_0xeacc2(0x295,'3z*n')][_0xeacc2(0x413,'FFl#')]===_0xeacc2(0x548,'2j5t'))console[_0xeacc2(0x48c,'WZiF')]=()=>{};}else _0x3cb2e1=[$[_0xeacc2(0x23a,'P*6E')](_0xeacc2(0x214,'t8gR')),$
2024-07-13 07:41:46 +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