mirror of https://github.com/KingRan/KR.git
11 lines
14 KiB
JavaScript
11 lines
14 KiB
JavaScript
/*
|
||
new Env('getToken');
|
||
|
||
变量:
|
||
JD_TOKEN_INTERVAL //获取接口403延迟等待时长(正整数),默认延迟 30s=30000ms
|
||
JD_NEWTOKEN_INTERVAL //获取接口成功延迟等待时长(正整数),默认延迟 0s
|
||
JD_CACHE_INTERVAL //缓存TOKEN时长(正整数),默认缓存 15 分钟
|
||
根据自行需要设定,缓存文件数据通用,不再区分域名
|
||
*/
|
||
|
||
var version_='jsjiami.com.v7';const llili1I=iiiiiIli;(function(l11lll1i,iil1lIlI,iiII11i1,I1l1lli1,lIi11l11,l1IIlil,i1IiIlIl){return l11lll1i=l11lll1i>>0x2,l1IIlil='hs',i1IiIlIl='hs',function(i1l1lilI,lIl1Iiil,ill1IIl,ii1lI111,iIiliilI){const l1i11l1=iiiiiIli;ii1lI111='tfi',l1IIlil=ii1lI111+l1IIlil,iIiliilI='up',i1IiIlIl+=iIiliilI,l1IIlil=ill1IIl(l1IIlil),i1IiIlIl=ill1IIl(i1IiIlIl),ill1IIl=0x0;const iliil=i1l1lilI();while(!![]&&--I1l1lli1+lIl1Iiil){try{ii1lI111=-parseInt(l1i11l1(0x122,'N8oB'))/0x1+parseInt(l1i11l1(0x13f,'8pg*'))/0x2*(parseInt(l1i11l1(0x115,'pOe0'))/0x3)+parseInt(l1i11l1(0x152,'cT0A'))/0x4*(parseInt(l1i11l1(0x16d,'03NM'))/0x5)+parseInt(l1i11l1(0x11f,'Pj6K'))/0x6*(-parseInt(l1i11l1(0x177,'b^YG'))/0x7)+-parseInt(l1i11l1(0x166,'fuxx'))/0x8+-parseInt(l1i11l1(0x128,'74CN'))/0x9*(-parseInt(l1i11l1(0x16b,'SViI'))/0xa)+-parseInt(l1i11l1(0x172,'tMx@'))/0xb;}catch(iIliIlII){ii1lI111=ill1IIl;}finally{iIiliilI=iliil[l1IIlil]();if(l11lll1i<=I1l1lli1)ill1IIl?lIi11l11?ii1lI111=iIiliilI:lIi11l11=iIiliilI:ill1IIl=iIiliilI;else{if(ill1IIl==lIi11l11['replace'](/[qBLedtuDOTyhgVCEkf=]/g,'')){if(ii1lI111===lIl1Iiil){iliil['un'+l1IIlil](iIiliilI);break;}iliil[i1IiIlIl](iIiliilI);}}}}}(iiII11i1,iil1lIlI,function(l1ii11,Il1Iilll,III11Il1,llI1lIll,lilII1I1,l1I1I1l1,li1Iii){return Il1Iilll='\x73\x70\x6c\x69\x74',l1ii11=arguments[0x0],l1ii11=l1ii11[Il1Iilll](''),III11Il1=`\x72\x65\x76\x65\x72\x73\x65`,l1ii11=l1ii11[III11Il1]('\x76'),llI1lIll=`\x6a\x6f\x69\x6e`,(0x13d501,l1ii11[llI1lIll](''));});}(0x310,0x4115f,i11ii1l,0xc6),i11ii1l)&&(version_=i11ii1l);const ii1iIllI=require('got'),IlI1l1ll=require(llili1I(0x14a,'$)d*')),II1Iliil=require('./krgetSign'),IllIliIi=process[llili1I(0x12f,'jTgS')][llili1I(0x175,'jTgS')]||'15';let li1iIlI=parseInt(IllIliIi)*0x3c*0x3e8;const lI1i11li=new IlI1l1ll(li1iIlI,__dirname+'/cache/token.json'),lIii1lli=['http://api.nolanstore.cc/sign',llili1I(0x144,'lxJL')],iIIil1I1=lIii1lli[Illii11(0x0,lIii1lli[llili1I(0x125,'tMx@')])],I1llIlI1=iIIil1I1,II1li1I=process[llili1I(0x143,'XrSS')][llili1I(0x179,'rncm')]||'',i1iI11=process['env']['JD_TOKEN_INTERVAL']||'30',Ii1lilii=process[llili1I(0x123,'#H3h')][llili1I(0x13c,'[D1i')]||'0';function liIIillI(llI1i1l='',lIiiiiii){const ll1I111i=llili1I,il1ll1iI={'EFabU':function(IlliI1Ii,Iii1ilii){return IlliI1Ii>Iii1ilii;},'kuPyo':function(i1i1lIll,Iii11l1i){return i1i1lIll===Iii11l1i;},'zlwuc':ll1I111i(0x146,'cT0A'),'xhoHa':'izdZH'};let i1I1l1=lIiiiiii['exec'](llI1i1l);if(i1I1l1&&il1ll1iI['EFabU'](i1I1l1[ll1I111i(0x141,'22F5')],0x0))return il1ll1iI[ll1I111i(0x130,'UR^%')](il1ll1iI[ll1I111i(0x15e,'fuxx')],il1ll1iI[ll1I111i(0x173,'Uwno')])?iiiIiI1:i1I1l1[0x0][ll1I111i(0x14d,'wR^[')]();return'';}function l1lIiI1i(liI1IIil,IliIl111){const iIIilI1i=llili1I,l1il1il1={'saFTI':function(lIII11lI,lI11lII){return lIII11lI>=lI11lII;},'AlVor':function(IiiiIIl1,il1I1iii){return IiiiIIl1<=il1I1iii;}};let llIiIil1=new Date()[iIIilI1i(0x135,'pWG(')]();if(l1il1il1['saFTI'](llIiIil1,0x0)&&l1il1il1[iIIilI1i(0x149,'UR^%')](llIiIil1,0x17))return liI1IIil;return liI1IIil+'_'+IliIl111;}function Illii11(lll1lili,l11IIIl){const i111iIil=llili1I,IIilIlI1={'LVxpM':function(IiiIlIiI,I1i1IIii){return IiiIlIiI-I1i1IIii;}};return Math[i111iIil(0x170,'UR^%')](Math['random']()*IIilIlI1[i111iIil(0x11b,'ryUb')](l11IIIl,lll1lili))+lll1lili;}function iiiiiIli(_0x4d3474,_0x12ef84){const _0xfa8e9b=i11ii1l();return iiiiiIli=function(_0x2edb29,_0x3a6702){_0x2edb29=_0x2edb29-0x111;let _0x4e24b3=_0xfa8e9b[_0x2edb29];if(iiiiiIli['RKWqvg']===undefined){var _0x63f1d=function(_0x5e786c){const _0x231394='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xac4c3a='',_0x1f1d75='';for(let _0x8297c9=0x0,_0x1d852b,_0x1eba12,_0x48b5d9=0x0;_0x1eba12=_0x5e786c['charAt'](_0x48b5d9++);~_0x1eba12&&(_0x1d852b=_0x8297c9%0x4?_0x1d852b*0x40+_0x1eba12:_0x1eba12,_0x8297c9++%0x4)?_0xac4c3a+=String['fromCharCode'](0xff&_0x1d852b>>(-0x2*_0x8297c9&0x6)):0x0){_0x1eba12=_0x231394['indexOf'](_0x1eba12);}for(let _0x51c085=0x0,_0x35adc4=_0xac4c3a['length'];_0x51c085<_0x35adc4;_0x51c085++){_0x1f1d75+='%'+('00'+_0xac4c3a['charCodeAt'](_0x51c085)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1f1d75);};const _0x32baa7=function(_0x3ad076,_0x410964){let _0x6af7b8=[],_0x468544=0x0,_0x1aeffb,_0x38170b='';_0x3ad076=_0x63f1d(_0x3ad076);let _0x567957;for(_0x567957=0x0;_0x567957<0x100;_0x567957++){_0x6af7b8[_0x567957]=_0x567957;}for(_0x567957=0x0;_0x567957<0x100;_0x567957++){_0x468544=(_0x468544+_0x6af7b8[_0x567957]+_0x410964['charCodeAt'](_0x567957%_0x410964['length']))%0x100,_0x1aeffb=_0x6af7b8[_0x567957],_0x6af7b8[_0x567957]=_0x6af7b8[_0x468544],_0x6af7b8[_0x468544]=_0x1aeffb;}_0x567957=0x0,_0x468544=0x0;for(let _0x453820=0x0;_0x453820<_0x3ad076['length'];_0x453820++){_0x567957=(_0x567957+0x1)%0x100,_0x468544=(_0x468544+_0x6af7b8[_0x567957])%0x100,_0x1aeffb=_0x6af7b8[_0x567957],_0x6af7b8[_0x567957]=_0x6af7b8[_0x468544],_0x6af7b8[_0x468544]=_0x1aeffb,_0x38170b+=String['fromCharCode'](_0x3ad076['charCodeAt'](_0x453820)^_0x6af7b8[(_0x6af7b8[_0x567957]+_0x6af7b8[_0x468544])%0x100]);}return _0x38170b;};iiiiiIli['peCNeX']=_0x32baa7,_0x4d3474=arguments,iiiiiIli['RKWqvg']=!![];}const _0xba93b7=_0xfa8e9b[0x0],_0x1d32fb=_0x2edb29+_0xba93b7,_0x324495=_0x4d3474[_0x1d32fb];return!_0x324495?(iiiiiIli['uVRTbz']===undefined&&(iiiiiIli['uVRTbz']=!![]),_0x4e24b3=iiiiiIli['peCNeX'](_0x4e24b3,_0x3a6702),_0x4d3474[_0x1d32fb]=_0x4e24b3):_0x4e24b3=_0x324495,_0x4e24b3;},iiiiiIli(_0x4d3474,_0x12ef84);}function i11ii1l(){const IIil1llI=(function(){return[...[version_,'VTOujqskjTLiytami.kEceomE.vB7hggfeqDgdCg==','vSkCs0tcTa','ymkrx2lcOW','W6RcUCkDW7NdQG','WQaXW6SJW74','lb7dNHdcHLhcLfa1nZhcTgy','FCoIACoJW54','WRf9nG','pmkRWPy3','ASoPW64Vja','pq0bW6BdSG','WPJcH8k1kfNdK8o/W7u','WRbEq8ktpa','jSkHB2pcItBcTa','wmo8W7yxbW','o8kTWP4UftPaECoXW4xcQmkucG','WRf4WQlcUqq','Egn1W7KH','W7xdPZfHWQ4HpCkDWQLTWR9H','xmovW6CF','pav5','W4e1WRim','gSkHWQGmgq','8jYRVYxOJQBLJllMIktLI7VLUilOVlZORRFLR7BNRRdLVQRcQW','8lQ6R8omehKHcSkjWQlcRCkqW6mQy8od5z+b5AEI55oP6k6Z5Rco5Psh6ycU5yMp5lID6zsW6k+/','CmoCW5ujna','y0viW7WIW784W6e','jCkxsKdcTYBcUG','ySowW4i/hmkvW4NdOa','WQpcPCke','5BwI6k+X5y+t5PY55z6457295A6lwXK/ymounW','WOWKwf/dRMCPW6xcIvZcPCodWPG','WRhcU3CMW7v9hmkA','omkbWPDjzCoABmozWOddQuhdIG','W7b0WQm4za','W6nqxG'],...(function(){return[...['W4pdJcVdQ1m7WRGiuSow','WOhcNsexWRLYpmkEhCkVuvNcOcDSW6RdUN7dGhDFbhNcUCkpWOG1t8kMqtnpW5ldJez1Bg4vtXHiW7ZdVCo9W4e9','W4ZcNuukWRFcTutcJq','WR5ZjrRdJa','W44qW4FdVhDpWQn2WQ5JwCooW60','WQFcV3a3','pJydW6tdIq','WOCXW5iJW74','W51bW5CNW6a','gfVdPxBdRNjYbmkCkJ/cOa','W4pcS07dP8k0','W5WzlmoYWQm','W5XaWRm0xrywWQpcLSkbWRdcLY5HW5ZcQmkQ','gZ0TW6hdSW','q0JcVmo6rJWf','FSk8wG','w2rKW58eW5yfW5TGkwbGsa','W6ChWORdGq','q8oFW6JcLuq','WQ8DpKHn','W59+cHu','WQdcHCk8ewW','8j24M8kcgZlcNK3dJmkbW5L6WPVdSCoZiEISN+AWIowMGoI3Vu7INj3dI+I1HEwmMoAvGUAuUq','pMqXimk8FIxcN8kBEa','WQ3cPCkhWRm','DfjjW68IW7uU','WRRdUXldJHzwW5FcHq','W6KNz0JcNstcTSkWWP0PW5P0','W5NcImkTW7FdJq','W7fhfHZcKW','W7NdGND6yq','W6HfugiaWRr2W5LFjmoghCo6oSoNgGm','WOddJJBcLW','WR3dO8o9WPFcNtBcLZLgfGJdSq','WPNcGmkaW4W','WR0nocBdVq','W5NdGCoFWPvPx3OSECkGgmkh'],...(function(){return['W7xcTXO','WOlcLSkYkexcH8kJWR9PWR9MWRX9WR3dRmoZWQaEgZfbrYuEW5ldQZ7dUmkZW7DBudqjAHhdL8kMjb9vCXujD3JdV8omFJpdKmkmtfRdN0LSWPSk','qaVcVsdcOYG','W5f+cq','W77dVslcSW','iCknn8k6WOFdHCoxWPBcJHaeiCkq','W7mccq','W5JcLIVcSsO','Ftf2yCklwHFcKq','gGSUW6hdTc0+umoLWP0','W7f6BdVdPudcUuTyn2RdLW','WP1oWPtcTW','W7nQWPO','WOOOW601W6m','WQHRuSk2','WPPqxSk1dG','ECoeW5avoCknCmofWPm','WOBdHZpdIti','DSocW4VcI1lcGSkicq','Dmo1W5JcKuW','W6BcL8kEW5ldKW','W7PQChddGa','Dmk/uNNcOW','W7ddTYJcRCkZBq','W7NdIHtcOmkP','W5PowLVdJtNcH2a9euVdPxrIDSoglmkAh38','W4VcRLu','W5FcTey','W5JdLCoWAMxdUCoBW5fzWOG','W49+sZyrWQ7cNmovWPZdHSoykG','WPyImbNdUMO','WQVdSqxdMW','WODKWOO','BIrbW6pcUx7cHvP6W41nWPrJumkkW6yiCSoEWRCSf0RcISoh','WQldIqFdRMi9hwbsWRTFW4pcJG'];}())];}())];}());i11ii1l=function(){return IIil1llI;};return i11ii1l();};async function Il1iIII(liiIi1l1,ilIli){const lliilIll=llili1I,IiI11IIi={'NYRwK':lliilIll(0x14b,'74CN'),'HOGXt':function(I1ilil1l,lIlIIi1){return I1ilil1l*lIlIIi1;},'JgzIZ':function(ll1lI1Il,iliiilll){return ll1lI1Il-iliiilll;},'GJfXs':'NlAZY','jxPNv':function(iiI11ill,I1iIllii){return iiI11ill+I1iIllii;},'FwYFj':'🚫\x20获取失败延迟设定等待\x20','TPCJd':lliilIll(0x11e,'Mey]'),'GYtMP':function(ii1IIIiI,I11l1il){return ii1IIIiI(I11l1il);},'CtBnI':function(lIIll11l,IlII1i1i){return lIIll11l||IlII1i1i;},'RxWVy':function(lI1I1l11,IIil1III,llIlIi1){return lI1I1l11(IIil1III,llIlIi1);},'rBbtr':function(i1lliIlI,IlIIill1){return i1lliIlI===IlIIill1;},'gdaEQ':function(iIilI1i1,I11I111,iilliilI){return iIilI1i1(I11I111,iilliilI);},'acUYC':lliilIll(0x145,'S&HL'),'pmLlk':function(Ii1llI,iIliiill){return Ii1llI!==iIliiill;},'fpOOx':'eRgRq','TrNss':lliilIll(0x124,'8pg*'),'IOvOf':lliilIll(0x12d,'[D1i'),'SBBvq':'object','gNBhB':function(liiIllII,iiilI1Il){return liiIllII===iiilI1Il;},'FKOSh':function(l11iIiii,I1iil11){return l11iIiii===I1iil11;},'WILqH':function(lI11,IIIi1I1){return lI11!==IIIi1I1;},'iCNul':lliilIll(0x132,'xO^t'),'eXRjn':function(i11Il1I1,lllI1iil){return i11Il1I1===lllI1iil;},'mMVrz':lliilIll(0x151,'xO^t')};async function II1lIiI(ii1iIIll){const Iil1li=lliilIll;if(IiI11IIi[Iil1li(0x134,'D@br')]===IiI11IIi[Iil1li(0x155,'03NM')])return new Promise(llIli=>setTimeout(llIli,ii1iIIll));else{let Ii1i1i1I=iIiiI11l['exec'](IIii1);if(Ii1i1i1I&&Ii1i1i1I[Iil1li(0x13a,'5QWR')]>0x0)return Ii1i1i1I[0x0][Iil1li(0x120,'N8oB')]();return'';}}let i1lIIi1I='',i1iiiill=IiI11IIi[lliilIll(0x15b,'wR^[')](liIIillI,liiIi1l1,/(?<=pt_pin=)([^;]+)/);if(i1iiiill){let l1ii1i11=IiI11IIi[lliilIll(0x17b,'pWG(')](l1lIiI1i,i1iiiill,ilIli);i1lIIi1I=lI1i11li[lliilIll(0x159,'88vn')](l1ii1i11)||'';if(IiI11IIi['rBbtr'](i1lIIi1I,'')){let IlI1ll1i=await IiI11IIi['gdaEQ'](II1Iliil,IiI11IIi[lliilIll(0x148,'Pj6K')],{'url':ilIli,'id':''});if(IlI1ll1i)try{if(II1li1I){if(IiI11IIi['pmLlk'](lliilIll(0x136,'pWG('),IiI11IIi[lliilIll(0x167,'jTgS')]))return IiIiII1i[0x0][lliilIll(0x131,'xO^t')]();else body=IlI1ll1i[lliilIll(0x16e,'f*YW')][lliilIll(0x169,'Mey]')];}else body=IlI1ll1i[lliilIll(0x127,'5QWR')];const Ii1ll1li=await ii1iIllI['post'](IiI11IIi[lliilIll(0x14f,'R&AY')],{'headers':{'Host':IiI11IIi['IOvOf'],'Content-Type':'application/x-www-form-urlencoded','Cookie':liiIi1l1,'User-Agent':lliilIll(0x16a,'SpH$'),'Accept-Language':'zh-Hans-CN;q=1','Accept-Encoding':lliilIll(0x11d,'ha8!')},'body':body,'timeout':0x7530})[lliilIll(0x16c,'k!n0')](async I1I1II1=>{const lil1IIi=lliilIll,II1llI={'USmUa':function(iil1IIli,i1li11ll){return iil1IIli+i1li11ll;},'RReWd':function(IliIiIII,i1IIll11){const lIiIlIll=iiiiiIli;return IiI11IIi[lIiIlIll(0x12a,'#H3h')](IliIiIII,i1IIll11);},'NhMaD':function(lll1i11i,iiIIiIi){const IiiI1il=iiiiiIli;return IiI11IIi[IiiI1il(0x113,'8pg*')](lll1i11i,iiIIiIi);}};if(I1I1II1[lil1IIi(0x12b,'pOe0')]){console['log']('🚫\x20getToken\x20API请求失败\x20➜\x20Response\x20code\x20'+(I1I1II1[lil1IIi(0x150,'8pg*')]['statusCode']||'')+'\x20('+(I1I1II1[lil1IIi(0x161,'1Vy3')][lil1IIi(0x154,'wR^[')]||'')+')');if(I1I1II1[lil1IIi(0x118,'D@br')][lil1IIi(0x12c,'R&AY')]==0x193){if(lil1IIi(0x138,'O!*V')===IiI11IIi[lil1IIi(0x121,'22F5')])return II1llI[lil1IIi(0x14e,'kNGR')](IlIlIlIl[lil1IIi(0x139,'cT0A')](II1llI[lil1IIi(0x11a,'Pj6K')](Ii111Ill['random'](),II1llI['NhMaD'](ll1i1Ii,iiIll1iI))),iliIIi1i);else{let iIl1I1=parseInt(i1iI11)*0x3e8;console[lil1IIi(0x168,'ha8!')](IiI11IIi['jxPNv'](IiI11IIi['FwYFj']+iIl1I1,IiI11IIi[lil1IIi(0x111,'iIhm')])),await IiI11IIi['GYtMP'](II1lIiI,iIl1I1);}}}else I1I1II1[lil1IIi(0x165,'f*YW')][lil1IIi(0x112,'ryUb')]?console[lil1IIi(0x178,'cT0A')]('🚫\x20getToken\x20API请求失败\x0a'+(I1I1II1[lil1IIi(0x15f,'rncm')][lil1IIi(0x116,'v4ES')]||'')+'\x0a'):console[lil1IIi(0x162,'v4ES')]('🚫\x20getToken\x20API请求失败\x0a'+IiI11IIi[lil1IIi(0x174,'IT8v')](I1I1II1,'')+'\x0a');});if(Ii1ll1li&&IiI11IIi[lliilIll(0x147,'cT0A')](typeof Ii1ll1li,IiI11IIi[lliilIll(0x11c,'QOU8')])){if(Ii1ll1li[lliilIll(0x12e,'03NM')]){let iI1lllii=JSON[lliilIll(0x171,'ROBZ')](Ii1ll1li[lliilIll(0x15a,'jCAF')]);if(IiI11IIi[lliilIll(0x176,'R&AY')](iI1lllii[lliilIll(0x158,'kNGR')],'0')){i1lIIi1I=iI1lllii['token'],lI1i11li[lliilIll(0x13d,'Uwno')](l1ii1i11,i1lIIi1I,li1iIlI);let ilIi1i1=IiI11IIi[lliilIll(0x153,'1Vy3')](IiI11IIi['GYtMP'](parseInt,Ii1lilii),0x3e8);console[lliilIll(0x129,'IT8v')](lliilIll(0x15c,'pOe0')+ilIi1i1+IiI11IIi['TPCJd']),await II1lIiI(ilIi1i1);}else IiI11IIi['gNBhB'](iI1lllii[lliilIll(0x142,'D@br')],'3')&&IiI11IIi['FKOSh'](iI1lllii[lliilIll(0x117,'rncm')],0x108)?IiI11IIi[lliilIll(0x16f,'R&AY')](IiI11IIi[lliilIll(0x156,'rncm')],'SwWsU')?console['log'](lliilIll(0x114,'fuxx')):iI1l1l1i=lIl1IiIl[lliilIll(0x17a,'zeSJ')]:console[lliilIll(0x14c,'k!n0')]('🚫\x20getToken\x20API接口返回异常\x20➜\x20'+JSON[lliilIll(0x133,'fuxx')](iI1lllii));}else{if(IiI11IIi[lliilIll(0x13b,'5QWR')](IiI11IIi[lliilIll(0x137,'Pj6K')],IiI11IIi['mMVrz']))console[lliilIll(0x13e,'Uwno')]('🚫\x20getToken\x20API请求失败\x20➜\x20接口返回为空');else return new il1ililI(IiiliiII=>l1llii1i(IiiliiII,lI11ilI));}}}catch(iI1III11){console['log'](lliilIll(0x15d,'jTgS')),console['log'](iI1III11);}else console['log']('🚫\x20getToken\x20API请求错误\x20➜\x20签名获取失败');}else console[lliilIll(0x126,'ryUb')](lliilIll(0x163,'[D1i'));}return i1lIIi1I;}module['exports']=Il1iIII;var version_ = 'jsjiami.com.v7'; |