mirror of https://github.com/KingRan/KR.git
27 lines
86 KiB
JavaScript
27 lines
86 KiB
JavaScript
|
/*
|
|||
|
爱让好物 成为礼物 4
|
|||
|
新增开卡脚本,一次性脚本
|
|||
|
|
|||
|
变量
|
|||
|
//export opencard_draw="3" //抽奖次数 3
|
|||
|
|
|||
|
————————————————
|
|||
|
入口:[ 爱让好物 成为礼物 4]
|
|||
|
|
|||
|
请求太频繁会被黑ip
|
|||
|
过10分钟再执行
|
|||
|
|
|||
|
cron:11 11 11 11 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#爱让好物 成为礼物 4
|
|||
|
11 11 11 11 * jd_opencardL325.js, tag=爱让好物 成为礼物 4, enabled=true
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('爱让好物 成为礼物 4');
|
|||
|
var version_='jsjiami.com.v7';const l11llI=iii1II;(function(IIlIll,l11liI,li11Ii,lIiIII,i1i,I1Il1l,I1Il1i){return IIlIll=IIlIll>>0x9,I1Il1l='hs',I1Il1i='hs',function(i1l,IlIiII,iIliI,i1IlII,ilIii1){const IIlIil=iii1II;i1IlII='tfi',I1Il1l=i1IlII+I1Il1l,ilIii1='up',I1Il1i+=ilIii1,I1Il1l=iIliI(I1Il1l),I1Il1i=iIliI(I1Il1i),iIliI=0x0;const ll1III=i1l();while(!![]&&--lIiIII+IlIiII){try{i1IlII=parseInt(IIlIil(0x334,'1P(l'))/0x1+-parseInt(IIlIil(0x2ef,'qhk*'))/0x2*(parseInt(IIlIil(0x479,'1P(l'))/0x3)+-parseInt(IIlIil(0x418,'1P(l'))/0x4+parseInt(IIlIil(0x235,'o(sa'))/0x5+-parseInt(IIlIil(0x468,'Ezo0'))/0x6*(parseInt(IIlIil(0x53e,'jqte'))/0x7)+parseInt(IIlIil(0x538,'!H4v'))/0x8*(-parseInt(IIlIil(0x31f,'!H4v'))/0x9)+parseInt(IIlIil(0x3c6,'1yCq'))/0xa*(parseInt(IIlIil(0x370,'v32d'))/0xb);}catch(ll1II1){i1IlII=iIliI;}finally{ilIii1=ll1III[I1Il1l]();if(IIlIll<=lIiIII)iIliI?i1i?i1IlII=ilIii1:i1i=ilIii1:iIliI=ilIii1;else{if(iIliI==i1i['replace'](/[pYtVrQJDCNFgubyKdfwW=]/g,'')){if(i1IlII===IlIiII){ll1III['un'+I1Il1l](ilIii1);break;}ll1III[I1Il1i](ilIii1);}}}}}(li11Ii,l11liI,function(l11lii,IIlIii,l11lil,iIllli,iIlll1,ilIiiI,I1Il1I){return IIlIii='\x73\x70\x6c\x69\x74',l11lii=arguments[0x0],l11lii=l11lii[IIlIii](''),l11lil='\x72\x65\x76\x65\x72\x73\x65',l11lii=l11lii[l11lil]('\x76'),iIllli='\x6a\x6f\x69\x6e',(0x13923d,l11lii[iIllli](''));});}(0x17a00,0xefb10,Iii11l,0xbf),Iii11l)&&(version_=Iii11l);const Ii1IlI=$[l11llI(0x1a4,'1P(l')]()?require('./jdCookie.js'):'',Il1I1I=$[l11llI(0x259,'5hef')]()?require('./sendNotify'):'',ll1Il1=require('./function/krgetToken'),li11li=require(l11llI(0x2e8,'xj0f')),iliiii=require(l11llI(0x32a,'qhk*')),IIlIIi=require(l11llI(0x4f1,'LZ&U'));let iliiil=l11llI(0x4d7,'Hi1g'),li11ll=$[l11llI(0x478,'ZYFw')]()?process[l11llI(0x4ac,'8cp*')]['opencard_draw']?process[l11llI(0x50d,'0#Sq')][l11llI(0x4c0,'xj0f')]:'0':$[l11llI(0x2f5,'KjIF')](l11llI(0x33b,'zh%r'))?$['getdata'](l11llI(0x2fc,'2LIU')):'0',i1Il1=[],li1l1='';if($[l11llI(0x302,'0WbJ')]()){Object[l11llI(0x550,'u#EP')](Ii1IlI)['forEach'](ll1IiI=>{const i1IlIi=l11llI;i1Il1[i1IlIi(0x1d3,'qQin')](Ii1IlI[ll1IiI]);});if(process[l11llI(0x2b9,'Ezo0')][l11llI(0x420,'Hi1g')]&&process[l11llI(0x34f,'Hi1g')][l11llI(0x292,'[w*F')]===l11llI(0x314,'zh%r'))console[l11llI(0x511,'1yCq')]=()=>{};}else i1Il1=[$['getdata'](l11llI(0x4ab,'c]]W')),$[l11llI(0x541,'Lsxw')](l11llI(0x441,'zqQ[')),...lIilII($[l11llI(0x238,'HcY1')](l11llI(0x45c,'qQin'))||'[]')[l11llI(0x3ec,'0WbJ')](li1li=>li1li[l11llI(0x3c1,'qQin')])][l11llI(0x1ef,'nIug')](iIIIll=>!!iIIIll);function iii1II(_0x405ea2,_0x14cf1c){const _0x2f0028=Iii11l();return iii1II=function(_0x4c1391,_0xb5639){_0x4c1391=_0x4c1391-0x195;let _0xdbf14d=_0x2f0028[_0x4c1391];if(iii1II['xvswCd']===undefined){var _0x52737c=function(_0x9ea448){const _0x3848a3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x9f888f='',_0x5d2912='';for(let _0x34da53=0x0,_0x5550e5,_0x31c1fb,_0x13cf2f=0x0;_0x31c1fb=_0x9ea448['charAt'](_0x13cf2f++);~_0x31c1fb&&(_0x5550e5=_0x34da53%0x4?_0x5550e5*0x40+_0x31c1fb:_0x31c1fb,_0x34da53++%0x4)?_0x9f888f+=String['fromCharCode'](0xff&_0x5550e5>>(-0x2*_0x34da53&0x6)):0x0){_0x31c1fb=_0x3848a3['indexOf'](_0x31c1fb);}for(let _0x4802f4=0x0,_0x38f6b4=_0x9f888f['length'];_0x4802f4<_0x38f6b4;_0x4802f4++){_0x5d2912+='%'+('00'+_0x9f888f['charCodeAt'](_0x4802f4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5d2912);};const _0x1ad384=function(_0x4049b6,_0x2e2594){let _0x44fa19=[],_0x8410ff=0x0,_0x20bc0d,_0x1e7929='';_0x4049b6=_0x52737c(_0x4049b6);let _0x57be6a;for(_0x57be6a=0x0;_0x57be6a<0x100;_0x57be6a++){_0x44fa19[_0x57be6a]=_0x57be6a;}for(_0x57be6a=0x0;_0x57be6a<0x100;_0x57be6a++){_0x8410ff=(_0x8410ff+_0x44fa19[_0x57be6a]+_0x2e2594['charCodeAt'](_0x57be6a%_0x2e2594['length']))%0x100,_0x20bc0d=_0x44fa19[_0x57be6a],_0x44fa19[_0x57be6a]=_0x44fa19[_0x8410ff],_0x44fa19[_0x8410ff]=_0x20bc0d;}_0x57be6a=0x0,_0x8410ff=0x0;for(let _0x384315=0x0;_0x384315<_0x4049b6['length'];_0x384315++){_0x57be6a=(_0x57be6a+0x1)%0x100,_0x8410ff=(_0x8410ff+_0x44fa19[_0x57be6a])%0x100,_0x20bc0d=_0x44fa19[_0x57be6a],_0x44fa19[
|
|||
|
// 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
|
|||
|
|