mirror of https://github.com/6dylan6/jdpro.git
12 lines
24 KiB
JavaScript
12 lines
24 KiB
JavaScript
/*
|
||
京豆红包雨
|
||
|
||
cron:1 1 1 1 * jd_redrain_hby.js
|
||
|
||
*/
|
||
|
||
const $ = new Env('京豆红包雨')
|
||
var iil='jsjiami.com.v7';const IlI1il=iii1II;if(function(l1lIl1,IiiIlI,Iilli1,I1l1Il,llIll1,Illl1l,Illl1i){return l1lIl1=l1lIl1>>0x3,Illl1l='hs',Illl1i='hs',function(lIIiil,l1lIii,I11iI1,l1lIil,IiiIli){const IIlii=iii1II;l1lIil='tfi',Illl1l=l1lIil+Illl1l,IiiIli='up',Illl1i+=IiiIli,Illl1l=I11iI1(Illl1l),Illl1i=I11iI1(Illl1i),I11iI1=0x0;const iillli=lIIiil();while(!![]&&--I1l1Il+l1lIii){try{l1lIil=-parseInt(IIlii(0x166,']6bS'))/0x1*(parseInt(IIlii(0x159,'tUS0'))/0x2)+parseInt(IIlii(0x1d6,'U4(S'))/0x3*(parseInt(IIlii(0x17c,'BaCJ'))/0x4)+parseInt(IIlii(0x1a7,'tfLb'))/0x5*(-parseInt(IIlii(0x167,'bRNg'))/0x6)+-parseInt(IIlii(0x1b8,']6bS'))/0x7+-parseInt(IIlii(0x1ad,'a3!0'))/0x8*(parseInt(IIlii(0x18f,'TgI9'))/0x9)+parseInt(IIlii(0x155,'tfLb'))/0xa+parseInt(IIlii(0x1a4,'Qnc2'))/0xb*(parseInt(IIlii(0x1b6,'LRXG'))/0xc);}catch(I1l1Ii){l1lIil=I11iI1;}finally{IiiIli=iillli[Illl1l]();if(l1lIl1<=I1l1Il)I11iI1?llIll1?l1lIil=IiiIli:llIll1=IiiIli:I11iI1=IiiIli;else{if(I11iI1==llIll1['replace'](/[QfMexuOThtYqbVwyDCX=]/g,'')){if(l1lIil===l1lIii){iillli['un'+Illl1l](IiiIli);break;}iillli[Illl1i](IiiIli);}}}}}(Iilli1,IiiIlI,function(I1i11i,I1i11l,llIlii,llIlil,IIlil,ilI1lI,IiiIll){return I1i11l='\x73\x70\x6c\x69\x74',I1i11i=arguments[0x0],I1i11i=I1i11i[I1i11l](''),llIlii=`\x72\x65\x76\x65\x72\x73\x65`,I1i11i=I1i11i[llIlii]('\x76'),llIlil=`\x6a\x6f\x69\x6e`,(0x169fc7,I1i11i[llIlil](''));});}(0x648,0xcd643,Iii11l,0xcb),Iii11l){}const jdCookie=require('./jdCookie'),notify=require(IlI1il(0x1aa,'4jGn')),common=require(IlI1il(0x1c2,'w1jW')),isNotify=![];function Iii11l(){const l1lIll=(function(){return[...[iil,'tXujqwYsjifawVMmxieb.tOfcToemyD.vhQ7DhVC==','WOudWQpcUCo3','WRecW6tcUmkiymkeW5tcImoitbi','lxmEec8','gxxcHq','BZ3cUmodjSkCcq','WRGiW6RcTGf3qKinzwa','rmkYW73cVx7cKW','cbiNyYHwuCkMFMDMuq','D+IUMUAXV+wKVoI0NuJINRJcNq','W4XFoZT+ht7dGCkvW7dcNqad','W7NcUSk2WRCPbh7dKa','W6tdTSkkWP7cTSoaCa','W6TBWRy','sCkgpq','CSoEWRfizd7dIYyyW4bqFCoIW4G6WRiUWOu8','DavhBMxdH8oxjSozw8kW','sSoAW4hdP30','vbm9','cCoOcSoHlmohFow+RUwMQUobH+s4U+s4MUI3M+wmSq','W7JcHSoxaSkcWRC1hmkzWQexWQHTj8onzwyaWPjAW4BdMmob','tmo7W5NcLmkwWP3dPgC','B8kTrW','5B+W5Aw3566e','hSk3bmk6WR4AW4TpWOCDECo4lSk9zbWlWPbXWQjyWQFcG8oSBmkNrhJcI3vzrmoej8oDCCkgWOJdOW','imo/WRhcSSoi','Cd3cQW','uSoIWQ/dJ8kYftZcL8o1','zdhdISoLWPG','x8oAW7ZdG08','jxujkq','gx/cJmoEfxi','nmk0b8kVW4y','WPRdTsVcUmodvG','uSkUW6VcUx7cTsHnwItdNW','rCo1qSo6WRynWR1dWRiPEmko','WRhdJmoraZW','x8oBW4FdLNxdOJu','pXLjFuTsc8ksWQqmcSo2Ewmixg59kcK','W47ORyBMSyJLK6hLUPhcOq','rCo6smo9WR1IWQnJWP4uxq','WRTfW6JdS0TNbN9jAa','W7PvWPpdGG','WOb2W6tcQSoR','xCoJnsOTAHlcRvbLr0BdTCkpsYC','hgCDmColWPS','uCkUCSk6ra','6lsL5y2/5Pwl5Psp','CmoMW5JcG8kG'],...(function(){return[...['WPtdVZBcRColvMi','WOSsAg8QvN0','iSo1WRBcLCo2','ucHC','8kYPRrq','WPddQmoSo8k6','rmkLW67cMmoPqXBdMgm','tqnmxxnMW6epvMGu','W5ZdTv1NxmoUW7i','igpcGSoVxSkrWOxdS8o7W7xdHubvrq','rSoSWRtdLSoWuJhcLmoQhSkjWPD9W4u7rCkb','hh8PaCoQ','BSoPW5xcKG','fCkeW4/cL1pcMs0','W6qvWRlcRW','W7XhW5BdPSo2','WRRdHSofm8kzWQK','aCkyWOtcPY/cT2qxDMxdKZZdPYm','k2qvW4PNWPm','vmk5smo7rX7dRq','5B+N5zko57IU5y2Y6zUy5OUe5yMO772r','iWZcSq','WRddOdlcUCom','W73dOmko','ymkJvmkOBG','WRmdW6FdOCoXcCkwW4lcVq','W45rpJH6hgJdV8kiW7xcVqG','a0ddQ8obWPNdV8kYW7W','WOGsEgq','uatdGSomWPpdQCkKW5P1WOlcN1JcHwr3W4tcJSkyW7qlW5LcELT3WOJcRmkIWOpcPmkPW4Ke','gCo0WRtcU8okyq','WQxdJ8onbsuCW615','WPCPWQ/cOa','aH07','W4pdRSoe','rY7cU8oyaM/dQsG','s8kLW7BcU37cNG','W6uwWRxcR1j/','DCoNW5S','W4SRWOT2W4ddKb5X','o3/cN8oYqSkpWRK','q8kaiG','xaFdLq','WQddR8oUo8k+','W6CrWQZcUvbSfG','nCknj8kDW7C','eqlcJG','5B2U5yIw5PYr6i685BYj5AwL5yIm77YH5y6r6ic45RA+5yML57Ql5PY85OUl6ioU6BIj5y+U','WRevWPGPWPldISk/qCkM','mWXjBa'],...(function(){return['WOVdVZtcQ8opqNm','v8kGq8oauq','WQtdJmovf8kzWR8iuSkMWQe','WRPiW4ZcPSoy','bCk2eSkjW6TrWOe','WOXMBZ3dHd7dOq','fSo5e8klhu3cUcdcT8kYoCo5WP4','W64BWRhcRW','WQz4WOpdNry','W7VdTSkoWOZcPCodzGiOWRH5','uHnsqNq','WQpdS8ougCk/','WPZdTZxcQSot','oGHoFLKpqq','WO7dKSonbulcTCko','vHhdHSoTWP/dUCk2W497WOG','4P2pWQJMNOhOGRRMR5JNO6JLPzRNK7FdSW','WQ9PW5K9W7tdNqzvdSkm','WOdLVkFMN4dMT7hLIPNLT7NNURZNU63MNAy16k6K56Ye5BYC5lIB5Q+K5REc5yUIWQu','W6RdVCortCou','ymoNW5K0','WR5KWP3dRGVcK8owWRFcRwq','acJcKrC','WOKrw18n','lSkLusvFlCopW5rlW6RdLW9Wvq','dsFcGrmI','xrhdNmohWO7dOG','rmoUWRtdKG','r8oJWQZdRCkR','WO16EbddPJ7dQ2S','W7tdOCkkW7r+rctcSemAW4i6h8kJW4VdMW','4P20xoADSoEDNoIUKEAYLmoW','fYJcIbn3gW/cKCkZW47cVW','jhOEoSonW4XRymoZFCkiWRiaW4ZcGSo3W5j4wW','v8kBEmkUqW','W4HnW5qTWRldTSkQhmoJWOZcOSoZAmoJnY3dGwVdMSksWQzuW7P5W5LdDvRdLSoSWQ/cI8kvuHldVc5rb8oyWP5fWROzFt0YW7FcI8k9EmkHbSoQhhvtAti6jmorWQ3cPSkXWRRdQ8kKWOOaWPtcHmopWOKbgCktz8kWW5VcJmk0gGPSC2zlDCkolMJcKCohW6f3WQZcIuyAECoNCGJdLqLBnSkJrSoFs8kpyupdVKDEW5SNWQddLWlcLg9eWOJdLSoitcpdV8oqsSoHWQnryCkXW69BqfKOW4a5lYGsW40CWPtdRSoBCSo1','c3Sfhmoj','WQ1xW5tcRSoFpq','WPJcTSoSWPKqW5vFW4W','B8oNW4W','fIZcLam/bWK','igdcJmoRxCksWOpcICobW7JdU3nc','W6K5WODW','W4jSW7NdR8ofW5fDBsi','hSkbW4BdPhddRYeitwBdPY/dIHRdPZCRDbtcQCkRWP1qWR/dMZL8','F8oeWQzkBNtcKeGkW4nqnmoHWOS1WRH0WQ83W4HsFmkvW4SJWO3cNmkAyr7dIaX2C8kFW4VcUNVdRmoWWPhdV8o5ESkqW61tm3ZdPCo+W6pcOhldM8oPW4VdU1yxzGLeWOWMexr0dCkaW5mWCCohcCkijrXdyCknxutcVaFdIComzCoWpmoSW7JcH8oMoCk6W6JcR8otjmoAC1hcSSkHWPfykCo5WRXJW7NdS8oyC8k+lCkzWPq4n20hfSoG','W5JdJSkAW5rx','WQdcU8oDW4jqFJ7cRwG','q8oBW5hdK3BdPZC'];}())];}())];}());Iii11l=function(){return l1lIll;};return Iii11l();}function iii1II(_0x65463c,_0x3f4735){const _0x1d8778=Iii11l();return iii1II=function(_0x28c814,_0x3967d2){_0x28c814=_0x28c814-0x149;let _0x4430ae=_0x1d8778[_0x28c814];if(iii1II['TfoACt']===undefined){var _0x4f83d1=function(_0x16f64e){const _0xa8adae='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2546f5='',_0x2e512c='';for(let _0x25788f=0x0,_0x399e50,_0x3cb9b9,_0xd61520=0x0;_0x3cb9b9=_0x16f64e['charAt'](_0xd61520++);~_0x3cb9b9&&(_0x399e50=_0x25788f%0x4?_0x399e50*0x40+_0x3cb9b9:_0x3cb9b9,_0x25788f++%0x4)?_0x2546f5+=String['fromCharCode'](0xff&_0x399e50>>(-0x2*_0x25788f&0x6)):0x0){_0x3cb9b9=_0xa8adae['indexOf'](_0x3cb9b9);}for(let _0x4c0eb9=0x0,_0x441a54=_0x2546f5['length'];_0x4c0eb9<_0x441a54;_0x4c0eb9++){_0x2e512c+='%'+('00'+_0x2546f5['charCodeAt'](_0x4c0eb9)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2e512c);};const _0x1b2ca9=function(_0x1068de,_0x2e9cc4){let _0x39c533=[],_0x300cf2=0x0,_0x488e5b,_0x46b09d='';_0x1068de=_0x4f83d1(_0x1068de);let _0x4df47c;for(_0x4df47c=0x0;_0x4df47c<0x100;_0x4df47c++){_0x39c533[_0x4df47c]=_0x4df47c;}for(_0x4df47c=0x0;_0x4df47c<0x100;_0x4df47c++){_0x300cf2=(_0x300cf2+_0x39c533[_0x4df47c]+_0x2e9cc4['charCodeAt'](_0x4df47c%_0x2e9cc4['length']))%0x100,_0x488e5b=_0x39c533[_0x4df47c],_0x39c533[_0x4df47c]=_0x39c533[_0x300cf2],_0x39c533[_0x300cf2]=_0x488e5b;}_0x4df47c=0x0,_0x300cf2=0x0;for(let _0x5a7236=0x0;_0x5a7236<_0x1068de['length'];_0x5a7236++){_0x4df47c=(_0x4df47c+0x1)%0x100,_0x300cf2=(_0x300cf2+_0x39c533[_0x4df47c])%0x100,_0x488e5b=_0x39c533[_0x4df47c],_0x39c533[_0x4df47c]=_0x39c533[_0x300cf2],_0x39c533[_0x300cf2]=_0x488e5b,_0x46b09d+=String['fromCharCode'](_0x1068de['charCodeAt'](_0x5a7236)^_0x39c533[(_0x39c533[_0x4df47c]+_0x39c533[_0x300cf2])%0x100]);}return _0x46b09d;};iii1II['ewplQY']=_0x1b2ca9,_0x65463c=arguments,iii1II['TfoACt']=!![];}const _0x5c8148=_0x1d8778[0x0],_0x10a9bc=_0x28c814+_0x5c8148,_0x556abc=_0x65463c[_0x10a9bc];return!_0x556abc?(iii1II['oDnnbO']===undefined&&(iii1II['oDnnbO']=!![]),_0x4430ae=iii1II['ewplQY'](_0x4430ae,_0x3967d2),_0x65463c[_0x10a9bc]=_0x4430ae):_0x4430ae=_0x556abc,_0x4430ae;},iii1II(_0x65463c,_0x3f4735);};let cookie='';const cookiesArr=Object[IlI1il(0x1d8,'v]U(')](jdCookie)['map'](iii1Ii=>jdCookie[iii1Ii])[IlI1il(0x1db,'AXGQ')](iii1Il=>iii1Il);!cookiesArr[0x0]&&($[IlI1il(0x176,'bRNg')]($['name'],'【提示】请先获取Cookie'),process[IlI1il(0x199,'[q[q')](0x1));!(async()=>{const IilliI=IlI1il,lI1IiI={'FANMQ':function(i1lI,IlI1l){return i1lI(IlI1l);},'ZWjcy':IilliI(0x190,'5KaS'),'Unknv':function(lilIil,i1l11){return lilIil<i1l11;},'qvPSB':function(i1l1li,i1ilii){return i1l1li+i1ilii;},'jyiRo':function(iIIII1,i1l1ll){return iIIII1(i1l1ll);},'ipBmf':'pt_pin','INDeG':function(I1iIiI){return I1iIiI();}};authorCodeList=await lI1IiI[IilliI(0x151,'w1jW')](getAuthorCodeList,IilliI(0x1c6,'U4(S'));if(!authorCodeList||authorCodeList[IilliI(0x198,'bRNg')]===0x0){console[IilliI(0x16e,'Qnc2')](lI1IiI[IilliI(0x191,'HS83')]);return;}notify[IilliI(0x1cf,'P0bd')]({'title':$[IilliI(0x15a,'5KaS')]});for(let li1I1=0x0;lI1IiI[IilliI(0x1c7,'BOMB')](li1I1,cookiesArr[IilliI(0x16a,'BOMB')]);li1I1++){$[IilliI(0x197,'*fyl')]=lI1IiI[IilliI(0x195,']6bS')](li1I1,0x1),cookie=cookiesArr[li1I1],common['setCookie'](cookie),$[IilliI(0x16b,'%&bl')]=lI1IiI[IilliI(0x186,'ayx8')](decodeURIComponent,common['getCookieValue'](cookie,lI1IiI['ipBmf'])),$[IilliI(0x14c,'P0bd')]=notify[IilliI(0x1b5,'tUS0')]($[IilliI(0x14b,'2P^4')],$['UserName']),$[IilliI(0x19b,'VS3S')]='',console[IilliI(0x1c0,'l2!h')](IilliI(0x1c1,'Q*JW')+$[IilliI(0x197,'*fyl')]+'】'+($['nickName']||$[IilliI(0x1c3,'2P^4')])+IilliI(0x174,'tfLb')),$['UA']=common['genUA']($[IilliI(0x173,'TgI9')]),await lI1IiI[IilliI(0x1d9,'AncS')](Main),common[IilliI(0x1d0,'tUS0')]();if($['runEnd'])break;await $[IilliI(0x1a8,'TgI9')](0x3e8);}isNotify&¬ify[IilliI(0x18d,'bRNg')]()&&await notify[IilliI(0x168,']6bS')]();})()[IlI1il(0x164,'Q*JW')](i1ilil=>$[IlI1il(0x15c,'w1jW')](i1ilil))['finally'](()=>$[IlI1il(0x185,'5KaS')]());async function Main(){const IlI1ii=IlI1il,lilIii={'plixy':function(iIIl1l,llIli1){return iIIl1l===llIli1;},'IpLOv':'boolean','MZYTv':function(iliIII,iIIl1i){return iliIII<iIIl1i;},'qutYg':function(I1lllI,ill111){return I1lllI+ill111;},'ApytW':function(Iliil1,i1III){return Iliil1(i1III);},'LXJju':'dotask'},i1ill1=await common['getLoginStatus'](cookie);if(!i1ill1&&lilIii[IlI1ii(0x17f,'Rheq')](typeof i1ill1,lilIii['IpLOv'])){console[IlI1ii(0x1c4,'Q*JW')](IlI1ii(0x14a,'x5&%'));return;}try{$[IlI1ii(0x1b3,'I0gL')]=![];for(let Ii1iIi=0x0;lilIii[IlI1ii(0x162,'odCw')](Ii1iIi,authorCodeList[IlI1ii(0x170,'tUS0')]);Ii1iIi++){const iliIIl=IlI1ii(0x1b4,'5KaS')[IlI1ii(0x181,'AncS')]('|');let Ii1iIl=0x0;while(!![]){switch(iliIIl[Ii1iIl++]){case'0':console[IlI1ii(0x1bb,'uK4u')](lilIii[IlI1ii(0x1a2,'AXGQ')](IlI1ii(0x1c5,'%&bl')+(Ii1iIi+0x1)+'个活动\x20',$[IlI1ii(0x1da,'r@(k')]));continue;case'1':console[IlI1ii(0x17a,'zUHh')]('');continue;case'2':$['encryptProjectId']=authorCodeList[Ii1iIi]['encryptProjectId'];continue;case'3':await $[IlI1ii(0x16c,'8G)p')](0x1f4);continue;case'4':await lilIii[IlI1ii(0x1d2,'%&bl')](sendRequest,lilIii['LXJju']);continue;case'5':$['encryptAssignmentId']=authorCodeList[Ii1iIi][IlI1ii(0x1bd,'if*V')];continue;}break;}}}catch(iliIIi){console[IlI1ii(0x1a5,'x5&%')]('❌\x20脚本运行遇到了错误\x0a'+iliIIi);}}async function handleResponse(ill11I,Iliiil){const lIIiii=IlI1il,li1Il={'ygAut':lIIiii(0x15e,'oFVu'),'UExEb':function(li1Ii,Iliiii){return li1Ii==Iliiii;},'CNWWs':function(i1illI,i1IIl){return i1illI===i1IIl;},'fuqKw':lIIiii(0x171,'5KaS'),'KEKlU':function(I1lll1,i1IIi){return I1lll1>i1IIi;},'fqXDD':function(IIII1I,Iii111){return IIII1I!==Iii111;},'ztrwd':lIIiii(0x1a9,'sDln'),'eKemY':lIIiii(0x17b,'Bu2n')};try{switch(ill11I){case li1Il['ygAut']:if(Iliiil&&li1Il[lIIiii(0x1ca,'bRNg')](Iliiil[lIIiii(0x182,'U4(S')],0x0)){const l1l1II=Iliiil[lIIiii(0x187,'0B$U')]?.['successRewards'],Iil1I1=Iliiil[lIIiii(0x1be,'vW3T')]?.['failRewards'];if(l1l1II&&li1Il[lIIiii(0x179,'U4(S')](typeof l1l1II,li1Il[lIIiii(0x19a,'[q[q')])&&Array['isArray'](l1l1II[0x3])&&li1Il[lIIiii(0x15b,'sDln')](l1l1II[0x3][lIIiii(0x1cd,'mVaK')],0x0)){const Ii1iII=l1l1II[0x3][0x0];let l1i11I=''+Ii1iII[lIIiii(0x180,'w1jW')];console[lIIiii(0x1bc,'$^O(')]('开启红包雨成功,获得:['+l1i11I+']');}else li1Il[lIIiii(0x157,'AXGQ')](typeof Iil1I1,li1Il[lIIiii(0x1bf,'4jGn')])&&Array[lIIiii(0x18c,'Zn6H')](Iil1I1)?Iil1I1['forEach'](function(II11II){const iI1lli=lIIiii;console[iI1lli(0x172,'2P^4')](iI1lli(0x160,'Zn6H')+II11II[iI1lli(0x14f,'Bu2n')]+'['+II11II[iI1lli(0x193,'ayx8')]+']');}):console['log'](li1Il[lIIiii(0x1af,'8G)p')]);}else{if(Iliiil[lIIiii(0x15f,'Rheq')]==0x1f)console['log'](Iliiil['msg']);else Iliiil[lIIiii(0x1ae,'4jGn')]==0x57b?console[lIIiii(0x1b2,'mVaK')](Iliiil[lIIiii(0x16d,'%&E]')]):console['log'](Iliiil[lIIiii(0x176,'bRNg')]);}break;}}catch(Ii1iI1){console['log'](lIIiii(0x18e,'x5&%')+ill11I+lIIiii(0x1d5,'[KF5')+(Ii1iI1[lIIiii(0x18b,'hrRR')]||Ii1iI1));}}async function sendRequest(lilIli){const ll1iI=IlI1il,Iliili={'otOSV':'GET','WdlIH':ll1iI(0x1a3,'AncS'),'TsbMc':ll1iI(0x196,'6gxb'),'FsTEl':function(iliII1,II11I1){return iliII1(II11I1);},'TYXeE':'keep-alive','IAsRP':'https://pro.m.jd.com','mhmCJ':ll1iI(0x1b9,'a3!0'),'OmQLv':ll1iI(0x18a,'P0bd'),'uZvoT':ll1iI(0x192,'x5&%'),'vFLMU':ll1iI(0x19e,'*fyl'),'RlRqB':function(Iii11I,Iil1II){return Iii11I<Iil1II;},'FJYwl':function(iIIl1I,I1iIli){return iIIl1I>I1iIli;},'SIjze':function(lI1Ill,lI1Ili){return lI1Ill>=lI1Ili;}};if($['runEnd']||$[ll1iI(0x183,'VS3S')])return;let Iliill='',IIII11='',i1illi=Iliili[ll1iI(0x1cb,'4jGn')];switch(lilIli){case Iliili[ll1iI(0x14e,'BOMB')]:;IIII11={'completionFlag':!![],'sourceCode':Iliili[ll1iI(0x188,'vW3T')],'encryptProjectId':$[ll1iI(0x19c,'a3!0')],'encryptAssignmentId':$[ll1iI(0x19f,'[(f#')]},Iliill=ll1iI(0x1ab,'if*V')+Iliili['FsTEl'](encodeURIComponent,JSON[ll1iI(0x1c9,'[q[q')](IIII11));break;default:console[ll1iI(0x163,'a3!0')](ll1iI(0x19d,'l2!h')+lilIli);return;}const i1illl={'url':Iliill,'method':i1illi,'headers':{'Accept':'application/json,\x20text/plain,\x20*/*','Accept-Encoding':ll1iI(0x156,'[q[q'),'Accept-Language':'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6','Connection':Iliili[ll1iI(0x1a0,'Q*JW')],'Content-Type':ll1iI(0x169,'bRNg'),'Cookie':cookie,'Origin':ll1iI(0x1d4,'hrRR'),'Referer':Iliili[ll1iI(0x1ac,'a3!0')],'x-rp-client':Iliili['mhmCJ'],'Sec-Fetch-Dest':Iliili['OmQLv'],'Sec-Fetch-Mode':Iliili[ll1iI(0x189,'w1jW')],'Sec-Fetch-Site':Iliili[ll1iI(0x177,'w1jW')],'User-Agent':$['UA']},'timeout':0x7530},I1llil=0x1;let I1llii=0x0,lilIll=null,l1i111=![];while(Iliili[ll1iI(0x149,'Q*JW')](I1llii,I1llil)){Iliili['FJYwl'](I1llii,0x0)&&await $[ll1iI(0x158,'2P^4')](0x3e8);const IliilI=await common[ll1iI(0x17e,'P0bd')](i1illl);if(!IliilI[ll1iI(0x14d,']6bS')]){lilIll=ll1iI(0x150,'6gxb')+lilIli+ll1iI(0x1b7,'hrRR')+IliilI['error'],I1llii++;continue;}if(!IliilI?.[ll1iI(0x194,'*fyl')]){lilIll='🚫\x20'+lilIli+'\x20请求失败\x20➜\x20无响应数据',I1llii++;continue;}handleResponse(lilIli,IliilI[ll1iI(0x1cc,'[(f#')]),l1i111=![];break;}Iliili[ll1iI(0x1b1,'Xw7K')](I1llii,I1llil)&&(console[ll1iI(0x1c8,'I0gL')](lilIll),l1i111&&($[ll1iI(0x1d3,'4jGn')]=!![],$[ll1iI(0x1ba,'0B$U')]&&$[ll1iI(0x178,'5KaS')][ll1iI(0x175,'$^O(')](lilIll)));}async function getAuthorCodeList(i1II1){const iI1lll=IlI1il,iIIl11={'aULWI':iI1lll(0x161,'*fyl'),'BwweB':iI1lll(0x1a1,'BaCJ')},l1l1I1=await common[iI1lll(0x1a6,'*fyl')]({'url':i1II1,'method':iIIl11['aULWI'],'headers':{'User-Agent':iIIl11[iI1lll(0x1ce,'U4(S')]},'proxy':null,'debug':![],'timeout':0x7530}),I1iIll=l1l1I1[iI1lll(0x17d,'hrRR')];return I1iIll;}var version_ = 'jsjiami.com.v7';
|
||
// 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"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }
|