mirror of https://github.com/KingRan/KR.git
15 lines
72 KiB
JavaScript
15 lines
72 KiB
JavaScript
|
/*
|
||
|
预约抽奖赢新品
|
||
|
|
||
|
cron:59 59 23 9-16 8 *
|
||
|
============Quantumultx===============
|
||
|
[task_local]
|
||
|
#预约抽奖赢新品
|
||
|
59 59 23 9-16 8 * jd_xm.js, tag=预约抽奖赢新品, enabled=true
|
||
|
*/
|
||
|
|
||
|
const $ = new Env("预约抽奖赢新品");
|
||
|
var version_='jsjiami.com.v7';const IIiIi1=iii1II;(function(iiilI,Il1IIi,IIiIl1,ilII11,l11ii,Il1IIl,l11il){return iiilI=iiilI>>0x8,Il1IIl='hs',l11il='hs',function(lli1lI,Ii1liI,liIilI,Ii1li1,iiil1){const l1Iii1=iii1II;Ii1li1='tfi',Il1IIl=Ii1li1+Il1IIl,iiil1='up',l11il+=iiil1,Il1IIl=liIilI(Il1IIl),l11il=liIilI(l11il),liIilI=0x0;const liIil1=lli1lI();while(!![]&&--ilII11+Ii1liI){try{Ii1li1=parseInt(l1Iii1(0x350,'nbBK'))/0x1*(-parseInt(l1Iii1(0x36e,'OYct'))/0x2)+parseInt(l1Iii1(0x3ba,'XW)w'))/0x3+-parseInt(l1Iii1(0x13b,'to%H'))/0x4*(parseInt(l1Iii1(0x1a5,'fE1D'))/0x5)+-parseInt(l1Iii1(0x1ff,'c6#F'))/0x6*(-parseInt(l1Iii1(0x3d3,'NzGL'))/0x7)+parseInt(l1Iii1(0x31f,'ndUc'))/0x8+-parseInt(l1Iii1(0x1c2,'zDMl'))/0x9+-parseInt(l1Iii1(0x10f,'c874'))/0xa*(-parseInt(l1Iii1(0x341,'fE1D'))/0xb);}catch(IIiIlI){Ii1li1=liIilI;}finally{iiil1=liIil1[Il1IIl]();if(iiilI<=ilII11)liIilI?l11ii?Ii1li1=iiil1:l11ii=iiil1:liIilI=iiil1;else{if(liIilI==l11ii['replace'](/[UtETnBGkDRdKPqhfwX=]/g,'')){if(Ii1li1===Ii1liI){liIil1['un'+Il1IIl](iiil1);break;}liIil1[l11il](iiil1);}}}}}(IIiIl1,Il1IIi,function(ilII1I,iiIlI1,lli1l1,lii1l,lii1i,lliIl,lliIi){return iiIlI1='\x73\x70\x6c\x69\x74',ilII1I=arguments[0x0],ilII1I=ilII1I[iiIlI1](''),lli1l1='\x72\x65\x76\x65\x72\x73\x65',ilII1I=ilII1I[lli1l1]('\x76'),lii1l='\x6a\x6f\x69\x6e',(0x138e14,ilII1I[lii1l](''));});}(0xc100,0x905f2,Iii11l,0xc3),Iii11l)&&(version_=Iii11l);const iliI11=$[IIiIi1(0x352,'^6aA')]()?require('./sendNotify'):'',ii1iI1=$[IIiIi1(0x326,'XnpJ')]()?require(IIiIi1(0x15a,'MOYu')):'',ll111I=require('./function/krgetToken');let liIl1I='https://szxyun-rc.isvjcloud.com',IIl111=[],lill='',Ill1lI='',Ii1lI1='';if($['isNode']()){if(process[IIiIi1(0x3cf,'L!*$')][IIiIi1(0x1e9,'*C3S')])$['teamId']=process[IIiIi1(0x3b0,'x%!#')]['jd_szxyun_teamId'];if(JSON[IIiIi1(0x1f0,'MOYu')](process[IIiIi1(0x301,'z*Np')])[IIiIi1(0x1ab,'nerL')](IIiIi1(0x2c0,'VVd@'))>-0x1)process['exit'](0x0);Object[IIiIi1(0x2ef,'VVd@')](ii1iI1)[IIiIi1(0x273,'Y4C)')](illIII=>{IIl111['push'](ii1iI1[illIII]);});if(process[IIiIi1(0x2b2,'W3iK')][IIiIi1(0x21c,'nerL')]&&process[IIiIi1(0x145,'#Ux]')]['JD_DEBUG']===IIiIi1(0x2a0,'ef!T'))console['log']=()=>{};}else IIl111=[$[IIiIi1(0x2e7,'W3iK')](IIiIi1(0x382,'WVKx')),$[IIiIi1(0x112,'yhnp')](IIiIi1(0x3b6,'WVKx')),...$[IIiIi1(0x2c1,'ef!T')]($[IIiIi1(0x12e,'khsU')](IIiIi1(0x334,'c6#F'))||'[]')['map'](iliI1l=>iliI1l[IIiIi1(0x1cc,'ndUc')])][IIiIi1(0x2c4,'I)G^')](ii1iIi=>!!ii1iIi);let IliliI=typeof $request!=='undefined';IliliI&&(GetCookie(),$[IIiIi1(0x2e4,'u]zx')]());!(async()=>{const I1i1=IIiIi1,iliI1i={'ufRby':function(IIl11i,i11III){return IIl11i+i11III;},'lmRfi':I1i1(0x19e,'WVKx'),'phhjN':function(ii1iIl,Ill1l1){return ii1iIl(Ill1l1);},'eHvRk':'http://code.kingran.cf/1.json','GaDaz':I1i1(0x2fb,'7Trq'),'gflKy':I1i1(0x245,'I)G^'),'jlsjC':I1i1(0x16f,'cZNv'),'WFBin':I1i1(0x26c,'OYct'),'DApUI':I1i1(0x308,'zDMl'),'wZzUW':'https://bean.m.jd.com/','yTaej':function(Ilili1,iIiiI){return Ilili1!==iIiiI;},'cVYuI':I1i1(0x198,'mjh$'),'teKah':function(Ii111i,l1iiiI){return Ii111i+l1iiiI;},'dwEvn':function(Ii111l,iI11li){return Ii111l+iI11li;},'RNoWr':I1i1(0x20d,'fE1D'),'kzjir':'【提示】cookie已失效','NImTj':function(lIi11,i11II1){return lIi11+i11II1;},'TmEXs':I1i1(0x342,'W3iK'),'Gaetb':function(Ilill1,I111lI){return Ilill1+I111lI;},'DHmyZ':I1i1(0x3b4,'Ec@l'),'aAmkA':function(l1iii1,iiilIl){return l1iii1+iiilIl;},'VdJcK':function(Il1ilI,iIliIl){return Il1ilI+iIliIl;},'mJshh':'\x0a请重新登录获取cookie','igBYl':function(l1Illi){return l1Illi();}};authorCodeList=await iliI1i[I1i1(0x31c,'eJjR')](iIiil,iliI1i['eHvRk']);authorCodeList?(console['log'](iliI1i[I1i1(0x343,'I)G^')]),$['shareId']=authorCodeList[0x0]['id'],$[I1i1(0x122,'L!*$')]=authorCodeList[0x0][I1i1(0x133,'ef!T')]):iliI1i[I1i1(0x1fc,'@0fu')]===I1i1(0x3df,'^6aA')?($['openId']=!![],console[I1i1(0x105,'u]zx')](iliI1i[I1i1(0x1ad,'KOMH')])):(I11iI1[I1i1(0x1a7,'nbBK')](iliI1i['ufRby']('',l1lIil['stringify'](IiiIli))),iillli[I1i1(0x38a,'XW)w')](iliI1i[I1i1(0x1d5,'W3uc')](I1l1Ii[I1i1(0x3de,'mmk&')],iliI1i[I1i1(0x3ac,'jfO)')])));$[I1i1(0x34b,'z*Np')]=iliI
|
||
|
// 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.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"])
|