KR/jd_fansDraw.js

21 lines
37 KiB
JavaScript
Raw Normal View History

2023-08-25 11:49:46 +08:00
/*
粉丝福利红包
活动链接https://wqs.jd.com/sns/202109/22/fansactiveall/index.html?qwer=<活动id>
环境变量jd_fansDraw_activityUrl // 活动链接
jd_fansDraw_Notify // 是否推送通知true/false默认不推送
活动非百分百中奖请勿重复运行
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#粉丝福利红包
1 1 1 1 * jd_fansDraw.js, tag=粉丝福利红包, enabled=true
*/
const $ = new Env('粉丝福利红包')
2023-09-09 18:03:46 +08:00
var version_='jsjiami.com.v7';const IlllllII=ii1iiili;(function(IiliI1I,Illlil11,Iil1ll1I,iIIIi11i,l1IiIiII,iiIII1i,l111IlIl){return IiliI1I=IiliI1I>>0x8,iiIII1i='hs',l111IlIl='hs',function(lillllIi,iIIlil,iI1i11Ii,lI1I1i11,iilIl111){const IIi1il1l=ii1iiili;lI1I1i11='tfi',iiIII1i=lI1I1i11+iiIII1i,iilIl111='up',l111IlIl+=iilIl111,iiIII1i=iI1i11Ii(iiIII1i),l111IlIl=iI1i11Ii(l111IlIl),iI1i11Ii=0x0;const i1III1Il=lillllIi();while(!![]&&--iIIIi11i+iIIlil){try{lI1I1i11=-parseInt(IIi1il1l(0x21c,'xheB'))/0x1*(parseInt(IIi1il1l(0x180,'[hN3'))/0x2)+-parseInt(IIi1il1l(0x11a,'[hN3'))/0x3+parseInt(IIi1il1l(0x188,'Bk$P'))/0x4+-parseInt(IIi1il1l(0x1ce,'w^rC'))/0x5*(-parseInt(IIi1il1l(0x1b5,'nxsw'))/0x6)+parseInt(IIi1il1l(0x1d9,'o&&q'))/0x7*(-parseInt(IIi1il1l(0x10f,'aV$B'))/0x8)+parseInt(IIi1il1l(0x139,'Yt05'))/0x9+parseInt(IIi1il1l(0x1df,'0*(U'))/0xa*(parseInt(IIi1il1l(0x16f,'6PrD'))/0xb);}catch(llIIIill){lI1I1i11=iI1i11Ii;}finally{iilIl111=i1III1Il[iiIII1i]();if(IiliI1I<=iIIIi11i)iI1i11Ii?l1IiIiII?lI1I1i11=iilIl111:l1IiIiII=iilIl111:iI1i11Ii=iilIl111;else{if(iI1i11Ii==l1IiIiII['replace'](/[ebArWyGTJhPgKqYukHd=]/g,'')){if(lI1I1i11===iIIlil){i1III1Il['un'+iiIII1i](iilIl111);break;}i1III1Il[l111IlIl](iilIl111);}}}}}(Iil1ll1I,Illlil11,function(ili1Ilii,IIIl1IIl,iIiIIIli,IIllil1i,I11iilIl,I11Ilili,IllIill1){return IIIl1IIl='\x73\x70\x6c\x69\x74',ili1Ilii=arguments[0x0],ili1Ilii=ili1Ilii[IIIl1IIl](''),iIiIIIli=`\x72\x65\x76\x65\x72\x73\x65`,ili1Ilii=ili1Ilii[iIiIIIli]('\x76'),IIllil1i=`\x6a\x6f\x69\x6e`,(0x13d640,ili1Ilii[IIllil1i](''));});}(0xc300,0x745ee,lIiIlI,0xc5),lIiIlI)&&(version_=lIiIlI);const Iiilil11=require(IlllllII(0x1ef,'qVt&')),lililIiI=require(IlllllII(0x192,'ZdUF')),iiii1Iil=require(IlllllII(0x1a3,'Hb[S')),iI11iIl1=process['env'][IlllllII(0x20a,'JI$b')]||'',II11I1Ii=process[IlllllII(0x19f,'xr$0')][IlllllII(0x161,'N]@3')]==='true',Ii1II11=IlllllII(0x142,'n%QM');function lIiIlI(){const I1I1ii1l=(function(){return[...[version_,'ujTGsrWyjbGeiPraJqmgiK.ekcHheomGWu.Avd7Y==','vSoFyaVcMCoxWOldMCkfAW','W6PeWOezobf4ja','W4ZcM3lcHhCzrXWimCo9WQ/cHCo/WRTIqSkSzHanqCkHWR/cN8keW5hcUCoEW65PW6K','W51zWOHdW70FvttcMCoZWOtdUSkE','W6PTWQStfG','q8kAW45wWPa','xt/dSColesv/BNRcV8kBq8orWPJdKmkhBSo5W4CzWPW','WR9cWP7cIWq','x0tcLaG','W71FWPOACwrUlCovWQLwqKtcQIBcJ8kx','W6RcRSoGW4q5jmobWQFcTmkssW','aSoSnghcPq','5REo5yUZ5AA95zgh77Yg','4P6aloI2HowmToAxMoAwGW','g8kFzbVcV8owWPK','WQtcUxOoferh','WPixWO/dNcJcNW','W7hdTG3dM+IUOoAWQ+wLV+I3SE+/KoIVHUAHIoADVUE8SUI1JEMhO+ISKq','W6LVW53cGmoX','xd8AW5L2','WOnLWPfJDInIWR08tCkyWOpdTW','W67dGIJdUZnu','WRRdHrtcNmoZ','WONJG47MTjpLIlxLP7BLK6tJG54','zSkvgd/cQG','W6GDW6KqoW','W4ZcMgBdUSor','k8oXwmoDWQjHq8kqW4j6oSkFEqxdJCknEHFdUSo4q2va','ASo1WQO3WQbtWQBdLX7cVmoCte90ACkYg8ovW6W','h8oIW5tdIs0','AgnohW','mmoqfmoZuq','iulcIa4S','e0lcJbud','dSkvWQDVWPeuvq','5y+/6igG5P6T5OUj5lUd','W5RcLNRdNmoq','W4pdJSoCbfe','eCoelxpcQSkVaq','EYFdK8owmG','rmkLoeWz','4PQWWR3ORBdLOj/LHBFMOypLV5pMR5ZNOz3NMBdLJAxPH60','WQ3cJMNcKvW9W507Dh7dRmowWO0','WPKxWPu','WPtcGSkGW4FdOG','WRlcQuZdHmoHxmkT','xuRcNG','hSoepG','exhcTbSs','4PICbEITIEwIUEweR+AHKow/REATOoEJNEEyNoMtKoAoOG','WQVcHMpcQxa','ymkZlt3cV2rOCuaBWR7dGf7dGCoJW5hcSM3dJSkWma','BZT6W4/cUW','xYhdVCojoG9W','W5vlW5RcT8oo','lCo6ya','WP4FW7/cSSoc','Euy2','W6XpWPXyW6W','W7y1W7qRa8kQW4rOxt5oWPxdHMK','WQ0rW5VcTSop','f2BcGCo0oCk+Eha','W6FdGSo2nG','5lMy5lQ85PY/5yM75zQ76l6z5zQD56I35PEO5OYE','h8okkq','kmkWWQ92WRK','qtSBW5LYW7Kz','ECkhW43dVL8','W6LFWPaHfW','FmoYW6a','DeOLgMOmW6WkW70G','W5myWRyncM9lW5BdHtRdLCoxWPKpW6q','5lI85lIh5PYr5yMN5zQ46l+J5zIK56Mw5PED5O6J','CSoOW6WeWPG','lCkWWPL3WP4','D3DgcmoNhSoFW4PWW63dLqhcVCobB8k6eSkRW7eGya','mxlcMH/dVG','DCkjW6DiWPa','W4FcQgC','WPmxWPldId3cKgC','xHjrW73cIG','W4BJGjZMTPNLIAVLNiJLNOVJGQq','z8kCW7dcLbyVW6mMW47cGG','W7y1W649lq','jSolDdjTWRiIWPy3WRvlwqK','W5FdICo6meBdHhnO','WQeQkSoWW6CaW4XlW6lcLCo2c8kE','ESoif1fFW5lcTCkAW5TgWOnWW4NdGxOmzSonWRiSW6RcIqfDW7L7W53dLSozWQxcS8oeW7m4W6XjW71JWPqDW7vGW4mCu8krvmkhh8oXqwlcRYJcV8oHW6H6W5W/C8kQWPFdRLdcLCohDSoEAmo/WPu6WPFdJSkHWOi2kXBcUerfFebMaSkPBqpdOLWErNldGCkZn8oLW4lcLcWEvCk/WOVdRmoHbCoBWQu5WOGlW70GAZ4ZW7ShWPJcH8k3bMa6EGfbW5ZcG8oRW6NdJCovWPy
2023-08-25 11:49:46 +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