jdpro/jd_task_piao.js

7 lines
103 KiB
JavaScript
Raw Permalink Normal View History

2024-10-26 08:07:31 +00:00
/*
1 6,17 * * * jd_task_piao.js
*/
const $ = new Env('做任务赚奖票');
function FocrX7x(){}var m60tmG=Object['defineProperty'],yuPflV,hpTm3rj,yIKbuAk,ozqc8Mj,xY6DYja,TYBSNk2,V_QCvn,P0SPmGM,oKm4IvN,Qaz51mQ,OJE7tud,X_ykDdi,hSwAP1e,fMWPkTk,FqAesn,gxVyB5C,BNQaFP,S4r65r8;function Eogo8m(FocrX7x){return yuPflV[FocrX7x<0x32?FocrX7x-0x53:FocrX7x>0x32?FocrX7x-0x33:FocrX7x+0x49]}yuPflV=i3ssQp8();function GNNGoa(FocrX7x,m60tmG){return hpTm3rj(FocrX7x,'length',{value:m60tmG,configurable:!0x0})}FocrX7x(hpTm3rj=Object.defineProperty,yIKbuAk=GNNGoa(XmgdkK((...m60tmG)=>{var hpTm3rj=XmgdkK(m60tmG=>{return yuPflV[m60tmG<0x60?m60tmG+0x28:m60tmG>0x60?m60tmG-0x61:m60tmG+0x55]},0x1);FocrX7x(m60tmG[hpTm3rj(0x7e)]=Eogo8m(0x33),m60tmG[Eogo8m(0x34)]=m60tmG[0x1]);return m60tmG[0xd](m60tmG[0x0]())}),0x2)(mnEslCn,PLmJx_j));var aDMbXSR=[],GxWJoe9=[oVdb75(0x0),oVdb75(Eogo8m(0x53)),oVdb75(Eogo8m(0x33)),'|+jJYRdw',oVdb75(0x3),oVdb75(0x4),oVdb75(Eogo8m(0x51)),oVdb75(0x6),oVdb75(0x7),oVdb75(Eogo8m(0x5e)),oVdb75(Eogo8m(0x62)),oVdb75(0xa),oVdb75(Eogo8m(0x66)),oVdb75(0xc),oVdb75(Eogo8m(0x34)),oVdb75(0xe),oVdb75(0xf),oVdb75(0x10),oVdb75(Eogo8m(0x6e)),oVdb75(0x12),oVdb75(0x11),oVdb75(Eogo8m(0x6f)),Eogo8m(0x35),oVdb75(Eogo8m(0x38)),'f4)g[~C9oK1"d*NXPgv5!wn$z$;(/L_Su]w|{gG>HY25%FB4&%E2DY5fMml3>_]*,8',oVdb75(Eogo8m(0x37)),oVdb75(0xf),oVdb75(Eogo8m(0x36)),Eogo8m(0x35),oVdb75(Eogo8m(0x36)),Eogo8m(0x35),oVdb75(Eogo8m(0x37)),oVdb75(Eogo8m(0x46)),oVdb75(0x14),oVdb75(Eogo8m(0x69)),oVdb75(0x16),oVdb75(Eogo8m(0x71)),oVdb75(0x18),oVdb75(Eogo8m(0x60)),oVdb75(Eogo8m(0x87)),'Th|Ws',oVdb75(Eogo8m(0x85)),oVdb75(0x1c),oVdb75(Eogo8m(0x38)),oVdb75(Eogo8m(0x114)),oVdb75(0x1e),oVdb75(Eogo8m(0x57)),'_`T7JcBH#|!',oVdb75(0x20),oVdb75(Eogo8m(0x92)),oVdb75(Eogo8m(0x93)),oVdb75(0x23),oVdb75(0x24),'):@UEd^`1T}*{EL4U0a`1y={n7~lU^@@||}EQK0g;_|w&WI)s,T7JceMU_1K?7HM#3Y3aZ,u^H@=}ZY4]JB@DxC*^+^GMGJ9SI<=9L{rB','gUjWk4%_s#$Q+LmE$SVBU~Q]lG<9GbcA/$LPM7!=hqmvs|]!5sK5f','jO3$]xo|FH',oVdb75(0x13),oVdb75(0x25),oVdb75(Eogo8m(0x7c)),oVdb75(Eogo8m(0x3b)),oVdb75(Eogo8m(0x94)),oVdb75(0x29),Eogo8m(0x41),'9s}P|(J:','@+|PKT89a',oVdb75(Eogo8m(0x5c)),oVdb75(Eogo8m(0x68)),oVdb75(Eogo8m(0x9f)),oVdb75(0x2d),'K2@R.e`qa|',oVdb75(0x2e),oVdb75(0x2f),oVdb75(0x30),oVdb75(0x31),oVdb75(0x32),oVdb75(0x33),oVdb75(Eogo8m(0x5a)),oVdb75(Eogo8m(0x7a)),'jO3$]xo|FH','Ur|B~9X5bgOqko',oVdb75(0x36),'|bQ$~Yb$E6I|7&',oVdb75(Eogo8m(0x54)),oVdb75(0x38),oVdb75(0x39),oVdb75(Eogo8m(0x5b)),oVdb75(0x3b),oVdb75(Eogo8m(0xe1)),oVdb75(0x3d),'<O3m|4~:','Zs|Wm',oVdb75(Eogo8m(0x3d)),oVdb75(Eogo8m(0x4c)),oVdb75(Eogo8m(0x38)),oVdb75(Eogo8m(0xaf)),oVdb75(0x13),oVdb75(0x41),oVdb75(0x42),'xb|Wm',oVdb75(0x43),oVdb75(0x44),oVdb75(0x45),oVdb75(0x46),oVdb75(Eogo8m(0x90)),oVdb75(0x48),oVdb75(Eogo8m(0x6d)),'*s;~K9|n<',oVdb75(Eogo8m(0xae)),'5sd~0$Do96|}>s<g,JC',oVdb75(Eogo8m(0x8d)),oVdb75(0x4c),oVdb75(Eogo8m(0x7b)),oVdb75(0x4e),oVdb75(0x13),oVdb75(0x41),oVdb75(0x4f),oVdb75(0x50),oVdb75(0x51),oVdb75(0x52),oVdb75(Eogo8m(0x7f)),oVdb75(Eogo8m(0xbf)),'A}B^|*/6,d<F8',oVdb75(0x55),'<O|W}w,<f@Bpz',oVdb75(Eogo8m(0xc0)),oVdb75(Eogo8m(0xc1)),oVdb75(Eogo8m(0x5d)),oVdb75(0x59),oVdb75(0x5a),oVdb75(Eogo8m(0xba)),oVdb75(0x5c),oVdb75(0x5d),oVdb75(0x5e),oVdb75(0x5f),oVdb75(Eogo8m(0x78)),oVdb75(Eogo8m(0x12b)),oVdb75(0x62),oVdb75(0x63),oVdb75(Eogo8m(0xc9)),oVdb75(0x65),oVdb75(0x66),oVdb75(0x67),oVdb75(0x68),oVdb75(Eogo8m(0x3a)),oVdb75(0x6a),oVdb75(Eogo8m(0xc5)),oVdb75(0x6c),oVdb75(0x6d),oVdb75(0x6e),oVdb75(0x6f),oVdb75(Eogo8m(0x3c)),'"~efvgO&m|{$[',oVdb75(Eogo8m(0x150)),oVdb75(0x71),oVdb75(Eogo8m(0xcb)),oVdb75(0x73),oVdb75(0x74),oVdb75(Eogo8m(0x39)),oVdb75(Eogo8m(0xcc)),oVdb75(0x69),oVdb75(0x77),oVdb75(Eogo8m(0x39)),oVdb75(Eogo8m(0xcd)),oVdb75(0x68),oVdb75(Eogo8m(0x3a)),oVdb75(Eogo8m(0x38)),'fhl(|P.DF',oVdb75(Eogo8m(0xce)),'X,|Wm','gUjWk4%_f$&p|+;AMTP$pR$ox$&pU&',oVdb75(0x7a),oVdb75(0x7b),oVdb75(0x7c),oVdb75(0x7d),oVdb75(Eogo8m(0xa1)),Eogo8m(0x3f),Eogo8m(0x40),oVdb75(Eogo8m(0xb3)),oVdb75(0x48),'5}XP.o:Vd@fMg+|',oVdb75(Eogo8m(0x4b)),oVdb75(Eogo8m(0x89)),oVdb75(0x81),oVdb75(0x82),oVdb75(Eogo8m(0x111)),oVdb75(Eogo8m(0xc4)),'*s;~K9|n<',oVdb75(Eogo8m(0x10b)),oVdb75(0x86),'<O|W}w,<f@Bpz',oVdb75(0x43),oVdb75(Eogo8m(0x14f)),oVdb75(Eogo8m(0xd0)),oVdb75(0x88)
function Env(o, t) { 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((r, i) => { s.call(this, t, (t, e, s) => { t ? i(t) : r(e) }) }) } 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.logLevels = { debug: 0, info: 1, warn: 2, error: 3 }, this.logLevelPrefixs = { debug: "[DEBUG] ", info: "[INFO] ", warn: "[WARN] ", error: "[ERROR] " }, this.logLevel = "info", 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.encoding = "utf-8", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null, ...s) { try { return JSON.stringify(t, ...s) } catch { return e } } getjson(t, e) { let s = e; if (this.getdata(t)) 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(r => { this.get({ url: t }, (t, e, s) => r(s)) }) } runScript(a, o) { return new Promise(r => { let t = this.getdata("@chavy_boxjs_userCfgs.httpapi"); t = t && t.replace(/\n/g, "").trim(); var e = (e = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout")) ? +e : 20, [s, i] = (e = o && o.timeout ? o.timeout : e, t.split("@")); this.post({ url: `http://${i}/v1/scripting/evaluate`, body: { script_text: a, mock_type: "cron", timeout: e }, headers: { "X-Key": s, Accept: "*/*" }, timeout: e }, (t, e, s) => r(s)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; this.fs = this.fs || require("fs"), this.path = this.path || require("path"); var t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), r = !s && this.fs.existsSync(e); if (!s && !r) return {}; r = s ? t : e; try { return JSON.parse(this.fs.readFileSync(r)) } catch (t) { return {} } } writedata() { var t, e, s, r, i; this.isNode() && (this.fs = this.fs || require("fs"), this.path = this.path || require("path"), t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), r = !(s = this.fs.existsSync(t)) && this.fs.existsSync(e), i = JSON.stringify(this.data), !s && r ? this.fs.writeFileSync(e, i) : this.fs.writeFileSync(t, i)) } lodash_get(t, e, s) { let r = t; for (const t of e.replace(/\[(\d+)\]/g, ".$1").split(".")) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, r, e) { return Object(t) === t && ((r = Array.isArray(r) ? r : r.toString().match(/[^.[\]]+/g) || []).slice(0, -1).reduce((t, e, s) => Object(t[e]) === t[e] ? t[e] : t[e] = Math.abs(r[s + 1]) >> 0 == +r[s + 1] ? [] : {}, t)[r[r.length - 1]] = e), t } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { var [, s, r] = /^@(.*?)\.(.*?)$/.exec(t); if (s = s ? this.getval(s) : "") try { const t = JSON.parse(s); e = t ? this.lodash_get(t, r, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { var [, r, i] = /^@(.*?)\.(.*?)$/.exec(e), a = this.getval(r), a = r ? "null" === a ? null : a || "{}" : "{}"; tr