KR/jd_opencardL322.js

27 lines
93 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('爱让好物 成为礼物');
2023-08-13 18:05:56 +08:00
var version_='jsjiami.com.v7';const lIl11l=iii1II;(function(li1lil,li1lii,i111lI,ii11lI,ilI1l,I1l11,lIl11I){return li1lil=li1lil>>0x5,I1l11='hs',lIl11I='hs',function(lIiIIi,IiIl11,I1l1i,lIiIIl,IliI){const lIl11i=iii1II;lIiIIl='tfi',I1l11=lIiIIl+I1l11,IliI='up',lIl11I+=IliI,I1l11=I1l1i(I1l11),lIl11I=I1l1i(lIl11I),I1l1i=0x0;const I1l1l=lIiIIi();while(!![]&&--ii11lI+IiIl11){try{lIiIIl=parseInt(lIl11i(0x154,'JH]U'))/0x1+-parseInt(lIl11i(0x3b0,'g&3r'))/0x2*(-parseInt(lIl11i(0x3a4,'tWai'))/0x3)+parseInt(lIl11i(0x17f,'VQOt'))/0x4*(parseInt(lIl11i(0x184,'ogs)'))/0x5)+-parseInt(lIl11i(0x25e,'6P#G'))/0x6*(parseInt(lIl11i(0x546,'U3[h'))/0x7)+-parseInt(lIl11i(0x148,'g&3r'))/0x8+parseInt(lIl11i(0x468,'U3[h'))/0x9*(parseInt(lIl11i(0x2f0,')JGg'))/0xa)+-parseInt(lIl11i(0x1a0,'VQOt'))/0xb*(parseInt(lIl11i(0x2cf,'xgeT'))/0xc);}catch(ilI1i){lIiIIl=I1l1i;}finally{IliI=I1l1l[I1l11]();if(li1lil<=ii11lI)I1l1i?ilI1l?lIiIIl=IliI:ilI1l=IliI:I1l1i=IliI;else{if(I1l1i==ilI1l['replace'](/[eIAXWEqupfdBxyJTbHO=]/g,'')){if(lIiIIl===IiIl11){I1l1l['un'+I1l11](IliI);break;}I1l1l[lIl11I](IliI);}}}}}(i111lI,li1lii,function(llIiI1,li1li1,li1liI,ii11li,il1lIl,iiliIi,i111l1){return li1li1='\x73\x70\x6c\x69\x74',llIiI1=arguments[0x0],llIiI1=llIiI1[li1li1](''),li1liI='\x72\x65\x76\x65\x72\x73\x65',llIiI1=llIiI1[li1liI]('\x76'),ii11li='\x6a\x6f\x69\x6e',(0x1391f0,llIiI1[ii11li](''));});}(0x1820,0x1dd26,Iii11l,0xc3),Iii11l)&&(version_=Iii11l);const iII11l=$[lIl11l(0x387,'e2Tv')]()?require(lIl11l(0x46f,')o&]')):'',i1IiI1=$['isNode']()?require(lIl11l(0x179,'@4KL')):'',l1lIII=require(lIl11l(0x125,'!cA)')),iII11i=require(lIl11l(0x13f,'w)Nw')),l1iI1i=require('./function/krgetua'),lIlllI=require('./function/krwxSavePrize');let III1lI='https://lzdz1-isv.isvjcloud.com',I11i=$[lIl11l(0x218,'tLvT')]()?process['env'][lIl11l(0x45e,'n4O&')]?process[lIl11l(0x360,'LV00')]['opencard_draw']:'0':$[lIl11l(0x269,'n^v3')](lIl11l(0x4d2,'e2Tv'))?$['getdata'](lIl11l(0x396,'^QCA')):'0',ll1IlI=[],I11l='';if($[lIl11l(0x505,'@4KL')]()){Object[lIl11l(0x43f,'^78^')](iII11l)[lIl11l(0x16d,'mZ*%')](i1lII=>{const iiii1i=lIl11l;ll1IlI[iiii1i(0x202,'*^!g')](iII11l[i1lII]);});if(process['env'][lIl11l(0x40a,'*^!g')]&&process['env'][lIl11l(0x4a4,'LV00')]===lIl11l(0x2fc,'n^v3'))console[lIl11l(0x31a,'eG%W')]=()=>{};}else ll1IlI=[$['getdata']('CookieJD'),$[lIl11l(0x308,'ogs)')](lIl11l(0x503,'MD4n')),...I11I($['getdata']('CookiesJD')||'[]')[lIl11l(0x24a,'tLvT')](iilIii=>iilIii[lIl11l(0x4ff,'Kcov')])][lIl11l(0x372,'tLvT')](iII111=>!!iII111);allMessage='',message='',$['hotFlag']=![],$['outFlag']=![],$['activityEnd']=![];let Ili1l1='',iilIil='',illI1i={};!(async()=>{const iiii1l=lIl11l,Ili1ii={'JJxcE':function(lIiIil,llIiii){return lIiIil===llIiii;},'KdVyL':iiii1l(0x38b,'LV00'),'FbNWT':function(IlII,IiIili){return IlII(IiIili);},'KRemX':'http://code.kingran.cf/322.json','ewFOs':function(llIiil,IlIi11){return llIiil===IlIi11;},'RrPCF':'Hrcuk','vhuXp':iiii1l(0x181,'e2Tv'),'HKkyi':function(l1ll1l,III1iI,iIIlIl){return l1ll1l(III1iI,iIIlIl);},'LPowW':iiii1l(0x3d3,'YzB9'),'pFDjX':iiii1l(0x1c6,'h9^!'),'WeKMW':'sDekw','zanWR':function(iIIlIi){return iIIlIi();},'tYMvZ':function(iilIll){return iilIll();},'ykLjf':'此ip已被限制请过10分钟后再执行脚本','xoIOf':function(iilIli,IlIi1I){return iilIli===IlIi1I;},'PGWjT':iiii1l(0x1d2,'n4O&')};if(!ll1IlI[0x0]){$['msg']($[iiii1l(0x527,'cvsY')],'【提示】请先获取cookie\x0a直接使用NobyDa的京东签到获取',Ili1ii[iiii1l(0x228,'*^!g')],{'open-url':Ili1ii[iiii1l(0x44b,'^5qc')]});return;}authorCodeList=await Ili1ii[iiii1l(0x111,'!cA)')](ll1Ill,Ili1ii[iiii1l(0x1b9,'6OC3')]);if(authorCodeList){if(Ili1ii[iiii1l(0x4d4,'VQOt')](Ili1ii[iiii1l(0x33d,'*^!g')],iiii1l(0x2bb,'YzB9')))console[iiii1l(0x29c,'(A5M')](Ili1ii[iiii1l(0x146,'bKvQ')]),$[iiii1l(0x13d,'6P#G')]=authorCodeList[Ili1ii[iiii1l(0x1e9,'^78^')](Ili1il,0x0,authorCodeList['length'])];else{if(l1l1ii['result']&&Ili1ii[iiii1l(0x49d,'&frO')](Il1i1I[iiii1l(0x355,'@4KL')],!![])&&Ii1iii[iiii1l(0x1fb,'ogs)')])II11il['prizeRotation']=iIIil1[iiii1l(0x3bd,'6d2s')][iiii1l(0x459,'6d2s')];else Ii1iil['errorMessage
2023-08-13 18:04: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