mirror of https://github.com/KingRan/KR.git
27 lines
83 KiB
JavaScript
27 lines
83 KiB
JavaScript
|
/*
|
|||
|
爱让好物 成为礼物 3
|
|||
|
新增开卡脚本,一次性脚本
|
|||
|
|
|||
|
变量
|
|||
|
//export opencard_draw="3" //抽奖次数 3
|
|||
|
|
|||
|
————————————————
|
|||
|
入口:[ 爱让好物 成为礼物 3]
|
|||
|
|
|||
|
请求太频繁会被黑ip
|
|||
|
过10分钟再执行
|
|||
|
|
|||
|
cron:11 11 11 11 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#爱让好物 成为礼物 3
|
|||
|
11 11 11 11 * jd_opencardL324.js, tag=爱让好物 成为礼物 3, enabled=true
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('爱让好物 成为礼物 3');
|
|||
|
var version_='jsjiami.com.v7';const iIlii=iii1II;(function(liII1i,iIiIil,iIiIii,lI1i,i11,Ii1llI,i1I11i){return liII1i=liII1i>>0x7,Ii1llI='hs',i1I11i='hs',function(lI1l,li11Il,i1I11l,IIlIl1,liII1l){const lIiII1=iii1II;IIlIl1='tfi',Ii1llI=IIlIl1+Ii1llI,liII1l='up',i1I11i+=liII1l,Ii1llI=i1I11l(Ii1llI),i1I11i=i1I11l(i1I11i),i1I11l=0x0;const Ii1ll1=lI1l();while(!![]&&--lI1i+li11Il){try{IIlIl1=parseInt(lIiII1(0x13d,'FjER'))/0x1+parseInt(lIiII1(0x40e,'ogL8'))/0x2*(parseInt(lIiII1(0x20c,'QouL'))/0x3)+-parseInt(lIiII1(0xe9,'x48v'))/0x4+parseInt(lIiII1(0x12b,'NN(@'))/0x5*(-parseInt(lIiII1(0x35f,'10yy'))/0x6)+-parseInt(lIiII1(0x2ba,'51e%'))/0x7+-parseInt(lIiII1(0x13f,'RlFb'))/0x8*(-parseInt(lIiII1(0x3bd,'lShd'))/0x9)+parseInt(lIiII1(0x2f4,'j3a%'))/0xa;}catch(IIlIlI){IIlIl1=i1I11l;}finally{liII1l=Ii1ll1[Ii1llI]();if(liII1i<=lI1i)i1I11l?i11?IIlIl1=liII1l:i11=liII1l:i1I11l=liII1l;else{if(i1I11l==i11['replace'](/[RrdMYTxAwyPkbDJOteS=]/g,'')){if(IIlIl1===li11Il){Ii1ll1['un'+Ii1llI](liII1l);break;}Ii1ll1[i1I11i](liII1l);}}}}}(iIiIii,iIiIil,function(I1III1,iIll1,l11li1,i1I,liII1I,iIiIiI,iIlil){return iIll1='\x73\x70\x6c\x69\x74',I1III1=arguments[0x0],I1III1=I1III1[iIll1](''),l11li1='\x72\x65\x76\x65\x72\x73\x65',I1III1=I1III1[l11li1]('\x76'),i1I='\x6a\x6f\x69\x6e',(0x1391fc,I1III1[i1I](''));});}(0x6180,0xa30dc,Iii11l,0xc5),Iii11l)&&(version_=Iii11l);const ll1lI1=$[iIlii(0x39f,'[O%Q')]()?require('./jdCookie.js'):'',II1ll=$[iIlii(0x360,'ogL8')]()?require(iIlii(0x348,'Y^bS')):'',liii11=require('./function/krgetToken'),lIiIii=require('./function/krh5st'),i1Ill=require(iIlii(0x378,'FjER')),Il1I11=require('./function/krwxSavePrize');let lIl1II=iIlii(0x239,'2@OT'),Ii1Ili=$['isNode']()?process[iIlii(0x2a5,'OIiH')]['opencard_draw']?process['env']['opencard_draw']:'0':$[iIlii(0x15d,'avew')](iIlii(0x42e,'x@Ah'))?$[iIlii(0x2f6,'Pmff')](iIlii(0x286,'tI8a')):'0',IIiI11=[],Ii1Ill='';if($[iIlii(0x341,'ZmsR')]()){Object[iIlii(0xcc,'Pmff')](ll1lI1)[iIlii(0x123,'2@OT')](li11li=>{const lI1I=iIlii;IIiI11[lI1I(0x17f,'51e%')](ll1lI1[li11li]);});if(process['env']['JD_DEBUG']&&process[iIlii(0x320,'2@OT')][iIlii(0x27d,'qe)B')]===iIlii(0x3b2,'zU2R'))console[iIlii(0x189,'!x$D')]=()=>{};}else IIiI11=[$[iIlii(0x38c,'XdUB')](iIlii(0x32d,'V@K)')),$[iIlii(0x10d,')nlM')](iIlii(0x275,'V@K)')),...i1IlI($['getdata'](iIlii(0x36d,'XdUB'))||'[]')['map'](iliiii=>iliiii['cookie'])]['filter'](IIlIIi=>!!IIlIIi);allMessage='',message='',$[iIlii(0x1c0,'DdZZ')]=![],$[iIlii(0xfc,'Shu%')]=![],$['activityEnd']=![];let ll1Iii='',IIlII1='',ll1Iil={};function iii1II(_0x5f2b7e,_0x243d90){const _0x116dff=Iii11l();return iii1II=function(_0xc2e3ca,_0x46c73c){_0xc2e3ca=_0xc2e3ca-0xa4;let _0x4c62ea=_0x116dff[_0xc2e3ca];if(iii1II['OjDxqP']===undefined){var _0xf1acd5=function(_0xd4d261){const _0x27fd94='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2ee0dc='',_0x365542='';for(let _0x7fc7c=0x0,_0x5f2328,_0x522cd3,_0xfaa809=0x0;_0x522cd3=_0xd4d261['charAt'](_0xfaa809++);~_0x522cd3&&(_0x5f2328=_0x7fc7c%0x4?_0x5f2328*0x40+_0x522cd3:_0x522cd3,_0x7fc7c++%0x4)?_0x2ee0dc+=String['fromCharCode'](0xff&_0x5f2328>>(-0x2*_0x7fc7c&0x6)):0x0){_0x522cd3=_0x27fd94['indexOf'](_0x522cd3);}for(let _0x17ac59=0x0,_0x1f28a9=_0x2ee0dc['length'];_0x17ac59<_0x1f28a9;_0x17ac59++){_0x365542+='%'+('00'+_0x2ee0dc['charCodeAt'](_0x17ac59)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x365542);};const _0x3f1691=function(_0x31093d,_0x15f33f){let _0x12739d=[],_0x2f2374=0x0,_0x46b815,_0x2053bf='';_0x31093d=_0xf1acd5(_0x31093d);let _0x5c0dc8;for(_0x5c0dc8=0x0;_0x5c0dc8<0x100;_0x5c0dc8++){_0x12739d[_0x5c0dc8]=_0x5c0dc8;}for(_0x5c0dc8=0x0;_0x5c0dc8<0x100;_0x5c0dc8++){_0x2f2374=(_0x2f2374+_0x12739d[_0x5c0dc8]+_0x15f33f['charCodeAt'](_0x5c0dc8%_0x15f33f['length']))%0x100,_0x46b815=_0x12739d[_0x5c0dc8],_0x12739d[_0x5c0dc8]=_0x12739d[_0x2f2374],_0x12739d[_0x2f2374]=_0x46b815;}_0x5c0dc8=0x0,_0x2f2374=0x0;for(let _0x3d1895=0x0;_0x3d1895<_0x31093d['length'];_0x3d1895++){_0x5c0dc8=(_0x5c0dc8+0x1)%0x100,_0x2f2374=(_0x2f2374+_0x12739d[_0x5c0dc8])%0x100,_0x46b815=_0x12739d[_0x5c0dc8],_0x12739d[_0x5c0dc
|
|||
|
// 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
|
|||
|
|