mirror of https://github.com/KingRan/KR.git
11 lines
23 KiB
JavaScript
11 lines
23 KiB
JavaScript
|
/*
|
|||
|
10豆
|
|||
|
|
|||
|
一次性脚本
|
|||
|
2 15 * * * jd_10.js, tag=10豆, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
|
|||
|
|
|||
|
*/
|
|||
|
const $ = new Env('10豆');
|
|||
|
var iil='jsjiami.com.v7';const Iiili=iii1II;(function(l1iIIl,iiilll,lI11Il,lIII1i,l11i11,IilIl1,lIII1l){return l1iIIl=l1iIIl>>0x6,IilIl1='hs',lIII1l='hs',function(l1iIIi,lilIi,l1l11I,lilIl,IilIlI){const l1il1I=iii1II;lilIl='tfi',IilIl1=lilIl+IilIl1,IilIlI='up',lIII1l+=IilIlI,IilIl1=l1l11I(IilIl1),lIII1l=l1l11I(lIII1l),l1l11I=0x0;const iIli11=l1iIIi();while(!![]&&--lIII1i+lilIi){try{lilIl=parseInt(l1il1I(0xcb,'jg4q'))/0x1*(-parseInt(l1il1I(0xa1,'iXiH'))/0x2)+parseInt(l1il1I(0xa4,'gHN6'))/0x3+-parseInt(l1il1I(0x9c,'4Q#h'))/0x4+parseInt(l1il1I(0xc7,'H@iZ'))/0x5*(-parseInt(l1il1I(0xbe,'8of['))/0x6)+-parseInt(l1il1I(0x81,'l6)p'))/0x7*(-parseInt(l1il1I(0xd8,'kPUR'))/0x8)+-parseInt(l1il1I(0xa5,'@j6^'))/0x9*(parseInt(l1il1I(0x7e,'cNQ8'))/0xa)+parseInt(l1il1I(0xa2,'jg4q'))/0xb*(parseInt(l1il1I(0x83,'bNIo'))/0xc);}catch(Iiiil){lilIl=l1l11I;}finally{IilIlI=iIli11[IilIl1]();if(l1iIIl<=lIII1i)l1l11I?l11i11?lilIl=IilIlI:l11i11=IilIlI:l1l11I=IilIlI;else{if(l1l11I==l11i11['replace'](/[IGMypgVdnLqCXJUePOWTA=]/g,'')){if(lilIl===lilIi){iIli11['un'+IilIl1](IilIlI);break;}iIli11[lIII1l](IilIlI);}}}}}(lI11Il,iiilll,function(Iiiii,l11i1I,IiII,llIIli,lIII1I,illIlI,liIiI){return l11i1I='\x73\x70\x6c\x69\x74',Iiiii=arguments[0x0],Iiiii=Iiiii[l11i1I](''),IiII=`\x72\x65\x76\x65\x72\x73\x65`,Iiiii=Iiiii[IiII]('\x76'),llIIli=`\x6a\x6f\x69\x6e`,(0x149589,Iiiii[llIIli](''));});}(0x3280,0x82992,Iii11l,0xcc),Iii11l)&&(iil=0xcc);function Iii11l(){const l11i1i=(function(){return[...[iil,'IIjpqsUVOjIiACaXgmdi.WPTcJeopmg.vn7GMUyL==','kHJcLY7dN1y','l2VcISkqhW','WRKXWQuCW7y','WPxcKshcSbDRkNGjW70Zux4','WOlcR8oqaa','aa1oW6ZcIq','WRVdO8o3gCk7','lWtcVG','6k6H5yUq6zQd5OEl5zYlsCowWRJcLttOVOBLHPhMOOBKV7/MLklLHyZLR6BdHEw7SEISOoMcIEI9SoIgJUADIUwmGEIpQ+wpPbBcKCkFW7JcISkp','W6JcINFcRSkL','oSocWONcOG','CwnXW5PcWPtdHLG','sCknW47cImky','yuWfpSoC','WQPAWQOkWP4','vaVcMGf+W6xdVCoknq','pW5AxSkWWPVcOow9I+wMH+odTUs7Uos4IUI2TEwoTW','bSoVW5NdQ8k/rSkPW5TuW7W','W71YW7tcSw7cIwxcQSkIWQWzmW','k8o2W51mWOuVyNXiusP1ChVcJmogW4VdTM4VWR5MlcKFW609xmo5W7atihhcLKyoWORdJSktFIRdQcBcUWhcRXBdH0beW4/cKxnyW7JdH1tdRCk1W7BdSSoJWP3dKCotWRtdLuJdJ8olbd/dKmoCi24jWProWRahWOXkW4vOqSoilfPsWPXosCoBWRmHW43dJCoVWRbqWP/dOaKPeCkcWOueW6/dLCkTBmkpWPdcUN/cUCoBWQzQASkgrSoOFCk4WQ/cJadcJt5BWQhdRhJdGhhcQCkFFCowWQvXWQWhA0FcM8o0W5dcN8oAWPldQHFdTYiWcCoAg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5jDWRbxWRy6nfRdUCoHW7XVWPlcKCo5iSkCrCollZKlWQ9rW6HJWOzfzwFcTwFdICouWRz1mmovbqqkWQW/WOStcCoZb3DSAmoiW67dH8ksiSk0uwGaWPJdOhqiDmolW4ZcL8k+WOdcPqVcGvZcRHZcK8kuD0pcV8kFoIVcG2XeqfpdNqDCWOTJW7qyC8k8W6X1W78fkYCTW6xcHfjfW47dUcewW5GVW4vPW6VcPCkNWPJdHmkOWPRdQCkVcmkrimkjESorW7hcQWbTWPP8WRPUWRjzW6nltCkfW6KYpZ/dHdOIWRNdOZrxW7nHWOZcQhBdRWaunCkrW69SWR1hCqZdTvzcWRXLDSkVwehcT1L6WP89WPdcRSobgq9xWOPaAW7cLmkDoCkMWPD1WP3cG8oPW5DuA8oDtSkMgwVdVSoAdXKKgv4hW4pcRCkNAtlcJq4NW73cKXtdI2pdLbTCe8o1fcLTqSo0cLJdIc/cPSk2W4xcSmoSAe/cVeCvoSkcW4ldKmkye8kKWPdcTSkeW4NcJmkpWPlcSZToWRBdPCkbWRxcUfdcVmoiWPFdQbuaW6PGywJcRhFdTCorWPrPDWnQmYVdUIu7eCo0W5mxtrC/eSkir8osEq7cKeHMW6hcIhemW5GGt8kwW6pdVeFdHNldO8keWR8XWQyoW5BdHSolW7tcSfxdJSoOfNO5fKL9WP7cJCkHW794jCkBW5VdV8oOWOyH
|
|||
|
// 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
|