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 18:15:21 +08:00
|
|
|
|
cron:5/25 * * * *
|
2023-09-16 18:12:25 +08:00
|
|
|
|
============Quantumultx===============
|
|
|
|
|
[task_local]
|
|
|
|
|
#代理缓存Token
|
2023-09-19 21:28:01 +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-19 21:22:48 +08:00
|
|
|
|
var version_='jsjiami.com.v7';const liIll1Ii=IIlIi1ll;(function(l1I111li,Iili1I11,IIIiliIl,lliilil,I1lliiii,lIiill1I,lll1l11i){return l1I111li=l1I111li>>0x6,lIiill1I='hs',lll1l11i='hs',function(il1IiIll,i1I1IIiI,Ii1111i,I1ii111,IlliIlII){const IIli1il1=IIlIi1ll;I1ii111='tfi',lIiill1I=I1ii111+lIiill1I,IlliIlII='up',lll1l11i+=IlliIlII,lIiill1I=Ii1111i(lIiill1I),lll1l11i=Ii1111i(lll1l11i),Ii1111i=0x0;const ilIIiIii=il1IiIll();while(!![]&&--lliilil+i1I1IIiI){try{I1ii111=parseInt(IIli1il1(0x1b9,'a5cX'))/0x1+-parseInt(IIli1il1(0x1f9,'lJ*@'))/0x2+parseInt(IIli1il1(0x199,'[[kL'))/0x3*(parseInt(IIli1il1(0x27d,'^Qs('))/0x4)+-parseInt(IIli1il1(0x1b6,'xdlP'))/0x5*(-parseInt(IIli1il1(0x247,'soni'))/0x6)+parseInt(IIli1il1(0x252,'GjW2'))/0x7*(parseInt(IIli1il1(0x265,'%$pC'))/0x8)+parseInt(IIli1il1(0x299,'BSKX'))/0x9+-parseInt(IIli1il1(0x1bc,'WcGY'))/0xa;}catch(il1il1l1){I1ii111=Ii1111i;}finally{IlliIlII=ilIIiIii[lIiill1I]();if(l1I111li<=lliilil)Ii1111i?I1lliiii?I1ii111=IlliIlII:I1lliiii=IlliIlII:Ii1111i=IlliIlII;else{if(Ii1111i==I1lliiii['replace'](/[tqfnlhXWVRCxbDrSEPY=]/g,'')){if(I1ii111===i1I1IIiI){ilIIiIii['un'+lIiill1I](IlliIlII);break;}ilIIiIii[lll1l11i](IlliIlII);}}}}}(IIIiliIl,Iili1I11,function(l11Il1Il,iIliilil,ilIi1lll,lilili1I,li1liII1,l1lliiIi,ilI1I1il){return iIliilil='\x73\x70\x6c\x69\x74',l11Il1Il=arguments[0x0],l11Il1Il=l11Il1Il[iIliilil](''),ilIi1lll=`\x72\x65\x76\x65\x72\x73\x65`,l11Il1Il=l11Il1Il[ilIi1lll]('\x76'),lilili1I=`\x6a\x6f\x69\x6e`,(0x13efe1,l11Il1Il[lilili1I](''));});}(0x3200,0xcf37e,ii1ll1li,0xca),ii1ll1li)&&(version_=ii1ll1li);const iIllli11=$[liIll1Ii(0x256,'[kJo')]()?require(liIll1Ii(0x206,'WcGY')):'',iI1Ili1l=$[liIll1Ii(0x1f5,'bh((')]()?require(liIll1Ii(0x20b,'U5Bz')):'',lIl1i1i=require(liIll1Ii(0x1d1,'6W1N')),i111l1Il=require('./function/cache/index'),i1liiil=require(liIll1Ii(0x1c7,'oo9j')),illliIli=require(liIll1Ii(0x23f,'xdlP')),i1l1llII=process[liIll1Ii(0x17b,'WjVl')][liIll1Ii(0x21c,'yLy&')]||'25';let Iii1I1Ii=parseInt(i1l1llII)*0x3c*0x3e8;const llIil1li=new i111l1Il(Iii1I1Ii,__dirname+liIll1Ii(0x1f4,'[[kL')),iIIIli1I=[liIll1Ii(0x235,'T2z1'),'http://kr.kingran.cf/sign'],l1l1i1ll=iIIIli1I[llIlIIi1(0x0,iIIIli1I[liIll1Ii(0x257,'5eRp')])],lil11iII=l1l1i1ll,Ill1I1Il=process[liIll1Ii(0x17c,'$%Ed')]['JD_SIGN_KRAPI']||'';let lli1l1Ii=liIll1Ii(0x209,'EU@#');const IIii11i1=process[liIll1Ii(0x18a,'Jl^i')][liIll1Ii(0x1da,'$%Ed')]===liIll1Ii(0x1b8,'[[kL'),l1lli1=process[liIll1Ii(0x22f,'LSKo')]['JD_PROXY_TUNNRL'],IIlii11i=process['env'][liIll1Ii(0x27c,'xdlP')],liIIIil1=process[liIll1Ii(0x25b,'soni')][liIll1Ii(0x204,'Uqup')]||'127.0.0.1,*.baidu.com';let ill1II1I='',I1I1II11=0x0;function IIlIi1ll(_0x2d11d1,_0x1d6424){const _0x42ef8e=ii1ll1li();return IIlIi1ll=function(_0x4a46ea,_0x473a39){_0x4a46ea=_0x4a46ea-0x179;let _0x591014=_0x42ef8e[_0x4a46ea];if(IIlIi1ll['DkvPhk']===undefined){var _0x393bbb=function(_0x4ed4f9){const _0x5c64dd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x7dbacb='',_0x185b30='';for(let _0x376925=0x0,_0x841cc,_0x192b0a,_0x37f9c7=0x0;_0x192b0a=_0x4ed4f9['charAt'](_0x37f9c7++);~_0x192b0a&&(_0x841cc=_0x376925%0x4?_0x841cc*0x40+_0x192b0a:_0x192b0a,_0x376925++%0x4)?_0x7dbacb+=String['fromCharCode'](0xff&_0x841cc>>(-0x2*_0x376925&0x6)):0x0){_0x192b0a=_0x5c64dd['indexOf'](_0x192b0a);}for(let _0x5f201f=0x0,_0x1f376a=_0x7dbacb['length'];_0x5f201f<_0x1f376a;_0x5f201f++){_0x185b30+='%'+('00'+_0x7dbacb['charCodeAt'](_0x5f201f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x185b30);};const _0x218d0b=function(_0x58dd9d,_0x196748){let _0x3b736a=[],_0x2c1f09=0x0,_0x2aa025,_0x11d928='';_0x58dd9d=_0x393bbb(_0x58dd9d);let _0x20cd89;for(_0x20cd89=0x0;_0x20cd89<0x100;_0x20cd89++){_0x3b736a[_0x20cd89]=_0x20cd89;}for(_0x20cd89=0x0;_0x20cd89<0x100;_0x20cd89++){_0x2c1f09=(_0x2c1f09+_0x3b736a[_0x20cd89]+_0x196748['charCodeAt'](_0x20cd89%_0x196748['length']))%0x100,_0x2aa025=_0x3b736a[_0x20cd89],_0x3b736a[_0x20cd89]=_0x3b736a[_0x2c1f09],_0x3b736a[_0x2c1f09]=_0x2aa025;}_0x20cd89=0x0,_0x2c1f09=0x0;for(let _0x1347a1=0x0;_0x1347a1<_0x58dd9d['length'];_0x1347a1++){_0x20cd89=(_0
|
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
|