KR/jd_opencardL322.js

27 lines
92 KiB
JavaScript
Raw Normal View History

2023-08-13 18:04:46 +08:00
/*
爱让好物 成为礼物
新增开卡脚本一次性脚本
变量
//export opencard_draw="3" //抽奖次数 3
入口[ 爱让好物 成为礼物 ]
请求太频繁会被黑ip
过10分钟再执行
cron:11 11 11 11 *
============Quantumultx===============
[task_local]
#爱让好物 成为礼物
11 11 11 11 * jd_opencardL322.js, tag=爱让好物 成为礼物, enabled=true
*/
const $ = new Env('爱让好物 成为礼物');
var version_='jsjiami.com.v7';const lIiIIi=iii1II;(function(I11lli,i111ll,I11lll,I1l1I,llIiII,Ilii,lIl111){return I11lli=I11lli>>0x2,Ilii='hs',lIl111='hs',function(Ilil,i1IIli,lI111,iiliIl,IiIl1I){const lIl11I=iii1II;iiliIl='tfi',Ilii=iiliIl+Ilii,IiIl1I='up',lIl111+=IiIl1I,Ilii=lI111(Ilii),lIl111=lI111(lIl111),lI111=0x0;const i1IIll=Ilil();while(!![]&&--I1l1I+i1IIli){try{iiliIl=parseInt(lIl11I(0x270,'K8gU'))/0x1*(parseInt(lIl11I(0x439,'tNfy'))/0x2)+-parseInt(lIl11I(0x48a,'#MeS'))/0x3*(parseInt(lIl11I(0x275,'ap8X'))/0x4)+-parseInt(lIl11I(0x334,'a7Qb'))/0x5*(parseInt(lIl11I(0x21d,'GlNw'))/0x6)+-parseInt(lIl11I(0x383,'qYx]'))/0x7+parseInt(lIl11I(0x3d7,'IIze'))/0x8*(-parseInt(lIl11I(0x414,'@q15'))/0x9)+-parseInt(lIl11I(0x2c6,'a7Qb'))/0xa*(parseInt(lIl11I(0x4b2,'K8gU'))/0xb)+parseInt(lIl11I(0x1ed,']#i%'))/0xc*(parseInt(lIl11I(0x283,'auAz'))/0xd);}catch(iIiIi1){iiliIl=lI111;}finally{IiIl1I=i1IIll[Ilii]();if(I11lli<=I1l1I)lI111?llIiII?iiliIl=IiIl1I:llIiII=IiIl1I:lI111=IiIl1I;else{if(lI111==llIiII['replace'](/[hOJxXyGnLVkTfIpequKDl=]/g,'')){if(iiliIl===i1IIli){i1IIll['un'+Ilii](IiIl1I);break;}i1IIll[lIl111](IiIl1I);}}}}}(I11lll,i111ll,function(ii11l1,li1lil,li1lii,i111lI,ii11lI,ilI1l,I1l11){return li1lil='\x73\x70\x6c\x69\x74',ii11l1=arguments[0x0],ii11l1=ii11l1[li1lil](''),li1lii='\x72\x65\x76\x65\x72\x73\x65',ii11l1=ii11l1[li1lii]('\x76'),i111lI='\x6a\x6f\x69\x6e',(0x1391ef,ii11l1[i111lI](''));});}(0x330,0xb7669,Iii11l,0xce),Iii11l)&&(version_=Iii11l);const iilIi1=$['isNode']()?require('./jdCookie.js'):'',I111=$['isNode']()?require(lIiIIi(0x23e,'eKAv')):'',I1I11l=require(lIiIIi(0x15f,'fGHn')),I1I11i=require('./function/krh5st'),l1iI1l=require(lIiIIi(0x194,'s4cG')),III1ll=require(lIiIIi(0x145,'c#iD'));let l1lIIi=lIiIIi(0x532,'5WDA'),iII11I=$[lIiIIi(0x3c9,'6pkg')]()?process[lIiIIi(0x1db,'ZceS')][lIiIIi(0x14e,'odhb')]?process[lIiIIi(0x2c7,'cBmh')][lIiIIi(0x3f6,'K8gU')]:'0':$[lIiIIi(0x16c,'6pkg')]('opencard_draw')?$[lIiIIi(0x1df,'TaQD')]('opencard_draw'):'0',IiIii1=[],l1lIIl='';if($[lIiIIi(0x297,'$X!(')]()){Object[lIiIIi(0x2cb,'qij2')](iilIi1)[lIiIIi(0x1ee,'rmS9')](I11l=>{const IiIl11=lIiIIi;IiIii1[IiIl11(0x400,'#MeS')](iilIi1[I11l]);});if(process[lIiIIi(0x377,'lBca')]['JD_DEBUG']&&process[lIiIIi(0x1a2,'fM$f')][lIiIIi(0x1af,'cBmh')]==='false')console[lIiIIi(0x172,'%Yfa')]=()=>{};}else IiIii1=[$[lIiIIi(0x4e5,'1$a&')]('CookieJD'),$[lIiIIi(0x256,'fM$f')](lIiIIi(0x3f8,'cBmh')),...iII11i($['getdata'](lIiIIi(0x51f,'GdJ5'))||'[]')['map'](Ili1l1=>Ili1l1[lIiIIi(0x1c2,'ey(P')])][lIiIIi(0x308,'8yJ)')](iilIil=>!!iilIil);allMessage='',message='',$[lIiIIi(0x326,'$zS)')]=![],$[lIiIIi(0x539,'ysM^')]=![],$[lIiIIi(0x284,']#i%')]=![];let i1lIl='',i1lIi='',iilIiI={};function Iii11l(){const li1llI=(function(){return[version_,'OxjXskjOTfiIpaqKmiuG.eVycDIVoqemJh.Lvnl7==','ushdHH4nyZO','WPbxaSkQW54','WP3cJWJcUI/dO8kDW7b/p8oO','WOZcNmonW5z4s07dIa','W7OPnuNcKq','mmkkWQa','aSorpCouW7S','v8oha8odWObOW6G1WQy','WO3cSSoSWPXhW6dcVv0','W7ZcK8ofcWK','q0ifvWq','lCoSWOfyW6K','WOddSvCSWQLejWNdVCky','vmoWmSobWOm','5Q+ogM/LTjNOOkBPM47LIkJVV6xORytOV4S+W5FLIBRPKjRLK7ZLHl7MIPdOO5FOHQtMNPJcLq','jCowWRNcI3m','t8kLW4K75yE45l2C6i+f5B6h77+c','rSoWW4FdOq','cCkAW610W6W','WO3cKx3dNSkQWRuNDmoLW4u','dJyNWRxdJq','WPqglmojWP7dHdyN','8j2pPIi','tSoaWPddLCk7','k8ogBbZcMW','B0X7oCkQ','W59oycq','mbanWPBdSq','W43dTSoK','gCoPWPjPW5m','WP7cMb3cQq3dUmks','WQeRnbrJ','5ywA5Rg6vZ8','WRVdQte1W5SOjMZcGCo2','WP7cMb3cGapdOSkhW6W','W7FcLSoNgqNdUCoNWOOGWQricupdII14dSo5k8otWQyQnd1zCSkKWQ4Kj8kKtCk8W5RcRLlcH8k1f8ozyxNdK8oyW5S','WONcUdap','xSoLW5ldU8ok','W5PmycWSW4xdU8owq8oJW5m','WOpcUcKl','WOtdPmkRWRRdVW','WRRdVd4LW4e2','fSkEW6PIW6HS','WOhdMr4kW68','ymoIW5S','WP7dUCkbWRBdJG','W55yBIC5','W5DaCW','WRKNExVcOG','WP3cGmkIW5bZuwZdMgnOWRmq','W4HhEZu7W4/dU8ogFmoUWPRdLCojW6e','hZhdKSk2CSk8WRrJW7qMDW','6i2h5y2hWP/cJ8oOW7m7bqNLPOBOTiRVVj8','nbGgWPS','W4ZdTConCI4','nLldH2nksSkHWQpdMmoBx8oy','W5T8W7NcQCkEWRddQdGhgCoTW6iJoM7cOuVcGSoSmmkmWRZcOCoUW53cLL/dJCoClmkbWPNdT3hcNW','oLpdU2nCyG','D8oDWOVdTSkm','kmkHoHHDESoywCkiwG','gSoNvZJcNG','CCoICKSe','W7RcKmoHbGJcJSkTW5y/WR9lfG','WQekqSkEWOdcUJOulrvTomkVWPVcSJVdQCoRnJ1fW5u4
// 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