KR/jd_dongDongFarm_help.js

26 lines
68 KiB
JavaScript
Raw Normal View History

2023-10-30 19:34:17 +08:00
/*
新东东农场助力
种植任务浇水 暂无助力
环境变量
jd_dongDongFarm_Notify // 是否推送通知true/false默认不推送
代理变量
JD_Farm_PROXY_OPEN // 代理启用变量默认不开启true/false
JD_Farm_PROXY_TUNNRL // 代理池代理地址变量,默认不开启,仅支持代理池模式(auto-proxy-pool)格式为http://ip:port
JD_Farm_PROXY_URL // API代理地址变量默认不开启仅支持 数据格式:txt;提取数量:每次一个格式为http://api.xxx.xxx
JD_Farm_NO_PROXY // 禁止走代理,默认 127.0.0.1,*.baidu.com 需要自行修改
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#新东东农场助力
2023-10-30 20:08:37 +08:00
45 6,16 * * * jd_dongDongFarm_help, tag=新东东农场助力, enabled=true
2023-10-30 19:34:17 +08:00
*/
const $ = new Env('新东东农场助力')
var version_='jsjiami.com.v7';const iiI1l11i=iIi1llIl;(function(lliIIiIi,IIlIiill,I11ilI1,li1iIll1,l1il1iil,lliiIill,llIlIil){return lliIIiIi=lliIIiIi>>0x5,lliiIill='hs',llIlIil='hs',function(lii1li1l,iiIl1il1,I1lIiiIl,III11lI,lII1lii){const illiI1=iIi1llIl;III11lI='tfi',lliiIill=III11lI+lliiIill,lII1lii='up',llIlIil+=lII1lii,lliiIill=I1lIiiIl(lliiIill),llIlIil=I1lIiiIl(llIlIil),I1lIiiIl=0x0;const IilIiii=lii1li1l();while(!![]&&--li1iIll1+iiIl1il1){try{III11lI=parseInt(illiI1(0x22a,'afQV'))/0x1*(parseInt(illiI1(0x2ea,'d&ev'))/0x2)+parseInt(illiI1(0x237,'eMGN'))/0x3*(-parseInt(illiI1(0x2a1,'%giz'))/0x4)+parseInt(illiI1(0x3e7,'Z4M4'))/0x5+parseInt(illiI1(0x39f,'sQF@'))/0x6*(-parseInt(illiI1(0x24d,'hBhd'))/0x7)+-parseInt(illiI1(0x2f2,'!NRM'))/0x8+-parseInt(illiI1(0x458,'F0O]'))/0x9*(parseInt(illiI1(0x2ef,'#9nx'))/0xa)+parseInt(illiI1(0x3d3,'y56J'))/0xb;}catch(lIl1i1){III11lI=I1lIiiIl;}finally{lII1lii=IilIiii[lliiIill]();if(lliIIiIi<=li1iIll1)I1lIiiIl?l1il1iil?III11lI=lII1lii:l1il1iil=lII1lii:I1lIiiIl=lII1lii;else{if(I1lIiiIl==l1il1iil['replace'](/[EuUbBHKMnCqPxGpdVftlS=]/g,'')){if(III11lI===iiIl1il1){IilIiii['un'+lliiIill](lII1lii);break;}IilIiii[llIlIil](lII1lii);}}}}}(I11ilI1,IIlIiill,function(lIl1il11,i1lIl111,l1lIi11,ill1lI1l,IIl1ll11,i1ii1III,iI11Iil1){return i1lIl111='\x73\x70\x6c\x69\x74',lIl1il11=arguments[0x0],lIl1il11=lIl1il11[i1lIl111](''),l1lIi11=`\x72\x65\x76\x65\x72\x73\x65`,lIl1il11=lIl1il11[l1lIi11]('\x76'),ill1lI1l=`\x6a\x6f\x69\x6e`,(0x145198,lIl1il11[ill1lI1l](''));});}(0x1780,0x2bf91,ii11IiIi,0xbe),ii11IiIi)&&(version_=iiI1l11i(0x358,'#9nx'));const illiIIll=require('./jdCookie'),ilI1iIIl=require(iiI1l11i(0x309,'HY2@')),IlIi1l11=require(iiI1l11i(0x3d2,')06z')),iilIl1Il=require('./function/krgetH5st'),Ii1lI1lI=process[iiI1l11i(0x2a4,')06z')][iiI1l11i(0x43b,'X6y3')]===iiI1l11i(0x2a0,'%giz'),l1ii11I=iiI1l11i(0x1f6,'kWXs'),ii1IiIli={0x1:'水滴'},I1ll1II=process[iiI1l11i(0x431,'Cu7F')]['JD_Farm_PROXY_OPEN']===iiI1l11i(0x224,'hBhd'),Il11l1il=process[iiI1l11i(0x23f,'NRXs')][iiI1l11i(0x2c6,'UImf')],Il1l1l=process[iiI1l11i(0x3b3,'WcAp')][iiI1l11i(0x2e5,'9e(*')],Iii1il1l=process[iiI1l11i(0x221,'[E0J')][iiI1l11i(0x1f9,'9s&F')]||'*.kingran.cf,127.0.0.1,*.baidu.com';let liiiiiI='',I1Iii111=0x0;const Iiilll11=require('fs');let l1ilII1i=![],Il1i1i1=iiI1l11i(0x21d,'I7nf'),Iiii1lII=Iiilll11['existsSync'](Il1i1i1),I1iIl1Ii=[],il111IIl=[],I11iiiII=[];Iiii1lII&&(console['log'](iiI1l11i(0x392,'n2@R')),I1iIl1Ii=Iiilll11['readFileSync'](Il1i1i1,iiI1l11i(0x3e5,'Ac*@')),I1iIl1Ii&&(I1iIl1Ii=I1iIl1Ii[iiI1l11i(0x20d,'(HH4')](),I1iIl1Ii=JSON[iiI1l11i(0x451,'S$C6')](I1iIl1Ii)));let l1lllIIl=![];if(I1ll1II){l1lllIIl=!![];try{require(iiI1l11i(0x447,'!oHt'));if(Il1l1l){console[iiI1l11i(0x3dc,'miBW')](iiI1l11i(0x2ad,'[E0J')),console[iiI1l11i(0x289,'P05]')](iiI1l11i(0x20f,')06z')+Il1l1l+'\x0a');let lIiiI1lI=/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/g;global['GLOBAL_AGENT'][iiI1l11i(0x42b,'&C7A')]=lIiiI1lI[iiI1l11i(0x3d5,'hOlP')](Il1l1l)[0x0]+','+Iii1il1l;}else Il11l1il?(global['GLOBAL_AGENT'][iiI1l11i(0x377,'!NRM')]=Il11l1il,global['GLOBAL_AGENT'][iiI1l11i(0x29c,'8TDM')]=''+Iii1il1l,console[iiI1l11i(0x289,'P05]')](iiI1l11i(0x44d,'R6Fe')),console[iiI1l11i(0x3ef,'I7nf')](iiI1l11i(0x2b0,'lRE)')+global[iiI1l11i(0x26b,'&C7A')][iiI1l11i(0x407,'3HVr')]+'\x0a')):(console['log'](iiI1l11i(0x31c,'F0O]')),console['log'](iiI1l11i(0x3e9,'PQmD')),console[iiI1l11i(0x263,'(HH4')](iiI1l11i(0x29a,'!NRM')));}catch(lillIilI){console[iiI1l11i(0x345,'BZm@')](iiI1l11i(0x22c,'9s&F')),console[iiI1l11i(0x289,'P05]')]('\x0a安装命令npm\x20install\x20global-agent\x0a'),l1lllIIl=![];}}else console[iiI1l11i(0x3f0,'afQV')](iiI1l11i(0x288,'^j[k')),console[iiI1l11i(0x387,'AUMb')](iiI1l11i(0x3c9,'!NRM'));let lliIl1Il='';const IiilI1I1=Object['keys'](illiIIll)['map'](i1lII111=>illiIIll[i1lII111])[iiI1l11i(0x2c5,'BZm@')](l1liiiIl=>l1liiiIl);!IiilI1I1[0x0]&&($[iiI1l11i(0x396,'Ac*@')]($['name'],iiI1l11i(0x229,')06z')),process['exit'](0x1));function ii11IiIi(){const iilIlllI=(function(){return[...[version_,'GUjSnsdjCEViaxPmqi.tqcKSoftHmb.BGuvl7p
// 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