KR/jd_token.js

23 lines
34 KiB
JavaScript
Raw Normal View History

2023-09-16 18:12:25 +08:00
/*
变量
JD_PROXY_OPEN // 代理启用变量默认不开启true/false
JD_PROXY_TUNNRL // 代理池代理地址变量,默认不开启,仅支持代理池模式(auto-proxy-pool)格式为http://ip:port
JD_PROXY_URL // API代理地址变量默认不开启仅支持 数据格式:txt;提取数量:每次一个格式为http://api.xxx.xxx
JD_NO_PROXY // 禁止走代理,默认 127.0.0.1,*.baidu.com 需要自行修改
根据自行需要设定脚本定时每25分钟自动执行一次
2023-09-16 23:07:39 +08:00
9.16更新不再读取缓存运行一次写入一次
2023-09-16 18:15:21 +08:00
cron:5/25 * * * *
2023-09-16 18:12:25 +08:00
============Quantumultx===============
[task_local]
#代理缓存Token
2023-09-16 18:15:21 +08:00
5/25 * * * * jd_token.js, tag=代理缓存Token, enabled=true
2023-09-16 18:12:25 +08:00
*/
const $ = new Env('代理缓存Token');
2023-09-16 23:07:39 +08:00
var version_='jsjiami.com.v7';const I1i11l1I=ll1iIIil;function i1ii111i(){const illl1IIi=(function(){return[...[version_,'GjhgtsjMiOUamiwd.wPcoNm.lGvq7RwtFbJUdbnu==','W7pdV8objhe','W6ZdQmoDm04N','u8oUyd7cGa','n2tdLCkn','WPjlW5OB','xsbFyspcGsy','W7JcTGRcIfW','WRpdIwS','W70LWOy','4PIu77U8W53cIqtcK8kOooE+KowSToAxREMwPdS','W4xcHSokdgmVWPPbWPdcKqZdRW','WPhdSZ7cKLm','rsVcPCktW5PQW4tdHq','b07dOSoJ','WOBdQq3cOgu','W5yJWOldVYC','W7lcLtFcINNdOW','W6pcKwJdIfa','emoWWPONW6S','WOhcJ8kRyZG9o8kozCoTW6/dLYfDywlcQJ9x','4PMe77IeWPhcTq9P5z+O5z2H5lIp55gy5BAG5B2Y5zkJ77+U','xJJdP1C','WR7dTSksBG','qhhcJmkpW5C','erGDWQ4','CSk4WP0mW4xcPxvBtmoUug3cGa','ASkFWO8','FSo0tq','BuNcNSkw','WO4sWPj8','B0tcI8kq','W70wB3BdHq','W4bqymoygCkaW7i9fcVcKeRcRq','WPiiWRbyfa','WOSKiSkMAa','dmk5zCoLW74gW7C','aIRcPadcJG','vsyzW73dQW','W7CCESowyXhdQq','t8oagmkKW6eUA1XBWQNdGeXM','FYhdILDH','bCotWQSqWOOT','ELZcI8kdW5ddTCk/jf7cKG','4PUo77QPlos7KoEsREAZTUs4JUEqVow3G+w/G+wsJ++9Sa','hmoPW6/dQCoa','WPTxecNcHw4pW55jeqxcU8kw','WOWcWPjKi8o6W63cOa','E8orsrf8j8oX','WQhdTGvQWQ0','8kMQICkBWRzEWPJdQ1FcRmoaW5VcPZGSn+IUIEAWJUwMT+I3HrBINkNdP0BdHv7dRuBcNCkNWPG+cCogW791W6a','wc/dVuPPW7Pjna','W6TvW6VcPmonFW','aYldGmoDWO/cRmowyEw8UUwKVooaMUs5HUs5R+I3NUwmTa','qSofh8oEjKHHWPC','4PUjd8ooW5yf5zYY5z+f5yYq6ysI77+1wYddRuJcQCodWPG+WPtcSSkyW5hdUreohqeNW63dJSkSWOSLsY7dNmkmWQ9Ul8oyW7jEpfJcVL7cTw3cLbC','W6pdOSoxmq','W6iOauTrrSoc','W7dcQ8oRkK0o','W6ldOSoxlq','FSk/WQHWta','oSo+WPSCW6pcUa','WOBcJmo9CJa','ErT2W5aEW6WF','W40qoNKQjCkYuCkxWOpdGuS','oSo4gshcVG','jComCCkBWPK','W5tcGdu','WRrwW6RdJ0m','imobW7a','WPpdOmkPCSkE','W4DmW73cQ8oP','W63dSCkV','BtnkzsO','W6iOauSyu8ocp8k8WRZdQ2xdLCowEJzWu8oKW7LraYNdIxLgn8kcfCknmq','hc3cGqdcJq','WPRcLmo8iwrMDSknrCokWQhdSd8','A8k3uKdcPb3dMeXSgW','WQZdLMbAW58','nEwkUoMsUNq','WQrZe04fcSkzECk/WQJcOhtcLSkCDJfvfmoQW6q','v3NcNf8','W4pcK1W','W7VcUXRdTq','amopWOi','W5RcGdBdNq'],...(function(){return[...['W6JdRCkgW4y1WPm','FHxcMCk0W78','WRqJWR5ehSoBW4BcNmktW5xcMqzM','pCo5Ca','jSoKWRO8WQ8lWQ8HcSopWRJdQ8oiESk2W4lcPa','W5RcVX3dKSoI','WRFdKNHdWPhcUCoc','cmoTWQmrW64','W57cGZ3dI8ok','W6dcR8oKia','W4BcKL/dG3O','5BwD6kYh5y+T5P6k5zYY576S5AY4nI/cGmktCCoe','WRpdGCkazSkl','W4isvMNdGwyrWOD9nsdcP8orx8o+gHpcJ8onWOe2W4m','z07cVSkXW4G','WRv4W5tdOG','8lgzHhldG8oDo8kjW4pcMx7dRdjJhMtORiJMS5xPL5tORRn84P2HW6BNRi7LK5xOJ67LJRFLP7BOT4O','BMVcPtK','DYruzGe','nGlcUq/cIG','8j2kG8okWPddGmoYWQGKuCkszmokmSkOWORORlVMSR7LPB3OTzZcSokDUaxMJQxLJRNOV6hLMRNKUkJNQOa','qY3cTCkmW7PQW4tdHq','BHWTW6ddKKzFW5u','C8oFsq1+','W7PFW7FcV8olDmkSAq','W6rvW6m','AaCMW6ddN1LvW4meaq','W6lcNM3dOMm','8jIzG8oyxLddNmolkmojWRNcUCkHuSkAnUwFHEwLM+EsIEISR+AZPoAvUUMdUEwlPEs7NEMwVEISLq','sSoCcq','WObNW73dTgq','W4Kjtg/dLY5kW71Tpa','WRSJb8k5zmoWWO0SnZhcLfFcTq','tdWv','oSo7WPyp','8l2AKCkKWQJdGw7cI2mqaSk3WRFdMCkQW63OR4hMS4FLPllOTyBcUa','WR3cUmoIAW1qW77dKW','WPxdOJHAW7VdVSkcvftdRmkrxmkWkmowWOBcMComE8kgWR4tbrHUW7jtDCkto8oHW5jfyNPegmozWR/dRSoCySk8iWq5W4a','W4RcKY/dQ1a','W5DfWOakW6q4WPNcO8oIx8kb','WPGwh8kcAa','fSotWQGMW4NcLuPIASotjW','amofWOSyWPOG','hCoyW5NdUSo1','W6yZeG','WRXQtq5Aw8oFFCk0WOFdGKFcTG','mbWfWRRdMW','CgWmWQ5dWPfnvhNcMHO','WOldKmkZw8kXzc7cT2JdMa','W6H1WOK','WQdcRmouFaq','5BAE6k2B5yYZ5P2t5z+E572B5A6/mdRdRCktW5hcHW','jmobW6pdUSoBpIa','eMTdWOddLKzSW4GUoq','fMtdNSkFnKxcKMu','xYhcPCkxW5TLW5RdHq','W6WCB8osle3cHCkzW7ym','W77cSqO','W7dcR8o2pK0nWRzL','WQJdPuZcVaJdHCo7i8kQWOxcTmktW6S','sCk+WOVcNHi','CmoquW','WP7dQ8kmBSka5Rkv5P215OUO5yQV6iY25y+K776/6yEI6k285lMz','W7pdSSkCW484','W7lcV8o2jG','B2RcVq','W5hcGcRdNgdcP8kygSkKWP0','o8oYWOmmW6FcVNS','WOPwW5q','lMpdGmoedu7dMSkjWQRcQNam','4PQnzoAGLUA2Row/P+wjHUAQIow+R+ACIow+JUwtS+s6OoEsVU++J+wpTowYKEMaMowgHa','W6RdLCoRdeK','aSoHW4JdRmoLeb9t','8ycOKL/cLLP+W7RdKWtdGSkTFND3W4VORjRMSl/LPl3OTjKX','W7OqA8of','W6xdPmksrGqrf8k+vCowWPldSq','owtdLG','WRzKWOpdVIDXWRNdKSoQyvVdIa','fSoiW4G3WO8MWPrjfSoiW43dJSkWgq','W4ChvNRdMG','eSorwSkbWOy','4PU1tow/Q+wrQ+s4HEEqUownSoMfNE+9T8orW7KBdGSmWOTQb1hcU0vLiSkLFSoyWOXoFGZdQ8kGWPW2eSoLW5NdPa','sYpcUCkjW54','W6P1WOlcGCoBWPHJ','ArZcMCkeW5G','pZtcSXZcLq','rSkCWPlcTGlcNCkheSkX'],...(function(){return['y8oiW6ldKSoukY5LuCkaE1DdWOZcNqfWWPS4W7j8d8khWRSLWO4','W4BdKSkhW6SqWROZW4xdQ0dcTti','cSoZWQy
2023-09-16 18:12:25 +08:00
// 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