mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
21 lines
31 KiB
JavaScript
21 lines
31 KiB
JavaScript
/*
|
||
活动名称:翻牌签到
|
||
活动链接:https://sendbeans.jd.com/jump/index/#/taro/pages/turncard/index?turnTableId=<活动ID>&shopId=<店铺ID>
|
||
环境变量:jd_sendbeans_url // 由于链接的特殊性多个活动仅支持 @ 链接
|
||
jd_sendbeans_task_threads // 控制签到并发线程数(正整数),默认1,最大3
|
||
jd_sendbeans_account_threads // 控制账号并发线程数(正整数),默认1,最大3
|
||
jd_sendbeans_account_interval // 自定义运行间隔时长(整数,单位毫秒),默认1500
|
||
jd_sendbeans_notify // 是否推送中奖信息(true/false),默认不推送
|
||
|
||
高并发脚本,谨慎使用并发
|
||
活动限制IP严重,建议使用代理
|
||
|
||
cron:1 1 1 1 *
|
||
|
||
*/
|
||
|
||
const $ = new Env('翻牌签到')
|
||
var iil='jsjiami.com.v7';const lilIIi=iii1II;(function(lI1lil,i1l1iI,liil1l,lI1lii,Iiili1,Iil1l1,i1i11I){return lI1lil=lI1lil>>0x6,Iil1l1='hs',i1i11I='hs',function(il1iIl,iii1ii,il1iIi,iii1il,II11li){const I1l11l=iii1II;iii1il='tfi',Iil1l1=iii1il+Iil1l1,II11li='up',i1i11I+=II11li,Iil1l1=il1iIi(Iil1l1),i1i11I=il1iIi(i1i11I),il1iIi=0x0;const I1l11i=il1iIl();while(!![]&&--lI1lii+iii1ii){try{iii1il=-parseInt(I1l11l(0x159,'A^^u'))/0x1*(parseInt(I1l11l(0xe9,'q0Rq'))/0x2)+-parseInt(I1l11l(0xe4,'iRDa'))/0x3+parseInt(I1l11l(0x191,'2d%V'))/0x4+-parseInt(I1l11l(0xee,'lDCr'))/0x5*(parseInt(I1l11l(0xd8,'2d%V'))/0x6)+-parseInt(I1l11l(0x15b,'xD*$'))/0x7*(-parseInt(I1l11l(0x16e,'Iet5'))/0x8)+-parseInt(I1l11l(0x15d,'LwUn'))/0x9*(parseInt(I1l11l(0xbc,'5^da'))/0xa)+parseInt(I1l11l(0xdc,'8I^U'))/0xb*(parseInt(I1l11l(0x13d,'uINZ'))/0xc);}catch(iIIiiI){iii1il=il1iIi;}finally{II11li=I1l11i[Iil1l1]();if(lI1lil<=lI1lii)il1iIi?Iiili1?iii1il=II11li:Iiili1=II11li:il1iIi=II11li;else{if(il1iIi==Iiili1['replace'](/[pQyYLqJWFDxPKgId=]/g,'')){if(iii1il===iii1ii){I1l11i['un'+Iil1l1](II11li);break;}I1l11i[i1i11I](II11li);}}}}}(liil1l,i1l1iI,function(liiI1i,ililIi,lilIIl,ililIl,liiI1l,i1l1II,i1ill){return ililIi='\x73\x70\x6c\x69\x74',liiI1i=arguments[0x0],liiI1i=liiI1i[ililIi](''),lilIIl=`\x72\x65\x76\x65\x72\x73\x65`,liiI1i=liiI1i[lilIIl]('\x76'),ililIl=`\x6a\x6f\x69\x6e`,(0x170407,liiI1i[ililIl](''));});}(0x3040,0xd2bee,Iii11l,0xc3),Iii11l)&&(iil=0x3935);const jdCookie=require(lilIIi(0xda,'jg0f')),notify=require(lilIIi(0x121,'8I^U')),common=require(lilIIi(0x10d,'pzXN')),{H5st}=require('./utils/Rebels_H');function iii1II(_0x53036c,_0x58179e){const _0x26f107=Iii11l();return iii1II=function(_0x43884b,_0x56e559){_0x43884b=_0x43884b-0x99;let _0x25d88d=_0x26f107[_0x43884b];if(iii1II['ZnLFQT']===undefined){var _0x168340=function(_0x29e28e){const _0x42abcf='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4f25cc='',_0x5af9c3='';for(let _0x523521=0x0,_0x199dbb,_0x17a51e,_0x537598=0x0;_0x17a51e=_0x29e28e['charAt'](_0x537598++);~_0x17a51e&&(_0x199dbb=_0x523521%0x4?_0x199dbb*0x40+_0x17a51e:_0x17a51e,_0x523521++%0x4)?_0x4f25cc+=String['fromCharCode'](0xff&_0x199dbb>>(-0x2*_0x523521&0x6)):0x0){_0x17a51e=_0x42abcf['indexOf'](_0x17a51e);}for(let _0x19c0c0=0x0,_0x32426b=_0x4f25cc['length'];_0x19c0c0<_0x32426b;_0x19c0c0++){_0x5af9c3+='%'+('00'+_0x4f25cc['charCodeAt'](_0x19c0c0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5af9c3);};const _0x523aa=function(_0x2dde5e,_0x5d4c6d){let _0x1e08ee=[],_0x19672a=0x0,_0x576c4d,_0x256ef6='';_0x2dde5e=_0x168340(_0x2dde5e);let _0x24b45a;for(_0x24b45a=0x0;_0x24b45a<0x100;_0x24b45a++){_0x1e08ee[_0x24b45a]=_0x24b45a;}for(_0x24b45a=0x0;_0x24b45a<0x100;_0x24b45a++){_0x19672a=(_0x19672a+_0x1e08ee[_0x24b45a]+_0x5d4c6d['charCodeAt'](_0x24b45a%_0x5d4c6d['length']))%0x100,_0x576c4d=_0x1e08ee[_0x24b45a],_0x1e08ee[_0x24b45a]=_0x1e08ee[_0x19672a],_0x1e08ee[_0x19672a]=_0x576c4d;}_0x24b45a=0x0,_0x19672a=0x0;for(let _0xd2403=0x0;_0xd2403<_0x2dde5e['length'];_0xd2403++){_0x24b45a=(_0x24b45a+0x1)%0x100,_0x19672a=(_0x19672a+_0x1e08ee[_0x24b45a])%0x100,_0x576c4d=_0x1e08ee[_0x24b45a],_0x1e08ee[_0x24b45a]=_0x1e08ee[_0x19672a],_0x1e08ee[_0x19672a]=_0x576c4d,_0x256ef6+=String['fromCharCode'](_0x2dde5e['charCodeAt'](_0xd2403)^_0x1e08ee[(_0x1e08ee[_0x24b45a]+_0x1e08ee[_0x19672a])%0x100]);}return _0x256ef6;};iii1II['BcxiYT']=_0x523aa,_0x53036c=arguments,iii1II['ZnLFQT']=!![];}const _0x178967=_0x26f107[0x0],_0x244b8f=_0x43884b+_0x178967,_0x46cefc=_0x53036c[_0x244b8f];return!_0x46cefc?(iii1II['EvtDDz']===undefined&&(iii1II['EvtDDz']=!![]),_0x25d88d=iii1II['BcxiYT'](_0x25d88d,_0x56e559),_0x53036c[_0x244b8f]=_0x25d88d):_0x25d88d=_0x46cefc,_0x25d88d;},iii1II(_0x53036c,_0x58179e);}function Iii11l(){const il1iII=(function(){return[...[iil,'pQjFKQsgjgDJiWgPaYJmWdiyW.cxWom.IyvY7qDL==','eSkYfqP+eLKv','WQhcVY/cJmoWpa','jmk3W5/cUmkR','W5NdUXRdK1HgW70','w1xdQCo3','e8kUBGOA','kL7cMXrAzSkLW6xdP8ku','muxcP1qeWPS','WOhcHColuG8+hSkFDxxcIhNdL8o4gMrIlCo2oSopbZ4jxG','r8oPpY9SnK8nW6BcJW','W6tcQsfOW5JdSZdcN8kGBX0','cCklWRtcG8oH','v8okWQxdL8kP','WQpdTwrjvCk8W7xcMmoSuCkwW4RcL0a','g8kXWOJdUtrj','eHldQCoUmCo+wq','WQnBW7ldKqpdR8kRW44','W60mWQ3cL2hcSSo+W57dQaNdNtLv','wKZdTmoI','WObUta','ssL3','ne7cULycWOC','h8klW47cKSkGWPDpWOFcHG','FfRdOCoOWOi','pshcPKFcKJXWW5BcOhz7oCkK','W4zOtdJcVmkLFuW','W5tdT0dcQGy','hmolyelcUW','mxdcPf0j','amkqW5S','p8k6qYGj','W5jjW6qKWPjoW5K','BsDwp8kfWQvV','W77cJSoUiqK','ywVcLmk9WO7dGmkUW57cQCoUWRCMgCk5A8oMW4VcJmkaiSkB','rmk0e2ldUYbU','kbJdKSo3hW','aCk2WPZdSG','WOvZWRKHW7DgkmkrdCkiF8kIuGK','bvxcM8ohza','j35cW6yxzW','rwVcSHCYW5m','sCkfWRPdxHHqW444','CgtcTdqW','W5PSucZcRCky','sdv3','a8o8w2tcJf3cSbJdUKxdHcGsh0TTWQbBW5GzW754WPiOWPpcKwPt','AvNcNCkqWPS','y3/dSa','WOFcJSoZ','W7JdPSoODW','gSoWA2FcOfC','W63cGqOtWRxcJfhcSM0loN5O','W64hDaG','WQaVW69lAG','56+v5yQU5AwA6lAdzG','dXNcTmopWR4aEmoSWQy','WRJdQColk8kUW4DOWOfjW7ZcTq','56YZ5yMs5AEH6lw/W7K','FdXloSkoWQnOmCou','WRHvW7W','cb7dI8osWPaKvmog','uSo2WO3dLSk4WQ3cKdaVW64vdbbgWRyM','cmkJW6dcLSoPW7BdGMvYWRyAhsXxWQeS','rt90mse','56Ym5yUV5AEk6lA5hq','o8kqW7tcKCkb','562X5yIG5OQh5yUU776QxG','WONdRwj3W4i','xmkyWQrEvq0','WOegWQBdJGvYmq','aCk3WPtdRa9z','EaZcLmkskmoNlWtcU8kI','WQJdNgm','4P2kWOJOH7ZMNzxOVR7OOOVPGPVLIkhKUjdPLQ/OR5GO','AKeW','FKlcTSktWRu','W6pcOCo7oW8','oL7cLrbxzW','W4JcIqigpa','5lMG6loA8lgbSW','suZdQCo3WPimw8oA','5lQI6lgd8ygrRCkd','rumWW7vK'],...(function(){return[...['rsPGzh3dMJScDmoHoINdVtuUW4xdOCo9WQCDreJcR8kgW4VdU3W8nIpdGJ8f','W63dSMVcTH7cSW','dfNcQ3Cs','W5ftW7C','gCooy2xcHW','WQ/dMuXShmkFW41bASkvWPyLjCovtZ7cUCoulCoqpInTb2HwW5nVEa','vSkEWQ8','ASohWOe','sCopo3b5qrWahw/dSM8','uSkfWRXAq0uwWOCYDmklWQP2h8ohW619W7i7DmogvxZcIe3cMLZcMmk0W6SWgHdcTvaNaMddVahdSmkKW6CiWQihnq','W73dUeNcUYS','W5ZdLhlcHWa','cmkEW4JcMG','W4TWW7m2WR0','s0hcQWil','W4VKU4VNVA/NIA3NRjtLIAdMTyhLIzuA','A2/cHCk4','WQddLgTnzCooWQWBvYendq','zhlcQeSzzsbfWQNdQmk1pCkDa8k5yCo1W7VcMG','FCoVgdPr','W6NdKejuW5BdTce','zHVcJ8kPla','kSk6WOxcRCohlseDvWBdLmkRWONcVa','WRRdIKLmW6FdLG','W7VcMmkp','yxdcJb3cSSomzq','W6tcTdrVW6xdOtRcMSk8','77YG8jY5TW','bmo9D2tcIftcSq','hmk6WP7dUbrynSk3sLLun8kYAxRdM1JdMmk/sCoP','DwBdNmkAWPlcICk5W5NdPmo6W4L5wmoRlSoMW6ZdMCkvESotW4xdNbL2b1hcUCodbWiuWQHrWPSNW7dcKSk5ECojWQ/dHSoqWOhcI8k7','WQ04WR/dGWW','oMxcJuqt','pCkuWQNdMWu','y0RcUmkrWPa','F8oxWOy','W63dNxrWW6ldTJK','chhcG1uG','W4xdJSo+rsK/fCkwExe','vc5pEh3dLW','W5uRgLVcMtn3bmo5odyZ','tv3dRmoQWRi','WQddK2u','W6tcTsvLW67dTsa','g8kjCI0KeHyof1tdVWj4CSkkymovWR3dTt7dOc7dH8oVy8kagCkiW5rSWQVcHIa','EuZcSZlcSa','BCoVdJ55','5lQu6lou8yUYK8ka','BHZdV8kEcM5ro8o3tv7dQ8kG','WOxcHmoXrtG1f8kszNhcPwxdP8oNeNjahmoMn8of','Cx/cNqqc','6lwp5y2V5PEK5PwF','5lMl6lcP8y2sMq','wCojWOtdJ8o4W4zLWOZcMbddQ34','WRVcV8oe','W7dcIYSRt8ohW6PoAmkMWPe3','Bq5eFge','WOqDWQ3dJH17','W77cOXaBbCoIWPhcR8oxE8kQW6hcGG','WR3dVNnCrmk3W5BcRSoStmkh','5lUL6lgW8ygXLKm','vcXPtMy','W6hdRMRcVb7cIHiSumo3jGa','aglcRHrR','ix9A','W7D1BG','WR3cTmoHW40nW6ZcLSkUh8otBSoLnKO','WRVdVCoqmCkUW49NWOG','cmoRD37cJL0','WQhcSSkRcmkvuIy/DvVdGCoCWQRcGa','neJcR8omwYut','WPH2WPiWW4jbfmkb','W4RdSGC','WR/dTmoqi8ko','o8kDW5JcICkw','lbZdN8oqhG','A0tcH2ysWR3dNG','FcfEpq','W7lcMCkE','W6ddS3BcTG','tSkvWOyaWO8','W5tcHIWmpW','W7ddMeNcGca','WQVdMeHeW63dIY3cHNS7','WQbpW6NdIWpdP8kKW4FdOINdGa','dmoQDNJcM37cSqNdRexdJt4'],...(function(){return['WOZcHmo6DcS','fSkwzq','W6LXwWhdPq','xmoWWO7dQc9rkmo3BLL1pCkXCuZdLhxdTCk0qCo8WOuA','yqnzFfi','qmkKhLC','W4BcVmk9WPtcRa','WOfYta','WQVcMWVcSCoV','sLZdSIldHa','WQFdSeTj','W4j7vYy','WPvpzdhdGG','CCozWRFdKCki','4P+NWR7OHBhMNOROV63OOBNPG47LIBxKUBJPL5pORjnC','pmoIAvRcUq','wmk1fu3dUszGn2C','i8kbvY4x','W5GLW41ZWQCytmkMnSkIq8kjrW','nthdRSofmW','A08N','oxRcM08Fyte','W7LSuaxcJq','W4mYxH3dG2TaqCo9nc0xW78wjCk3W6arpSomqSoozMfRASon','WQxdVKe','WQFcQsJcQCo2jIFdGSkWWOxcO8k7wCkuW7rTWRldRqm','WQddHh5Eaq','WOP5WO0','vGPQteC','zhlcTv0DzrvsWQ3dP8kVj8k2fa','FgBcNSkPWPxdGq','kmkQWRpcUmovEv9hvXJdICoSWPddQ8ooE8o+rNzKFmo8WPf5','zhlcLfatFI5oWQ3dP8k8eCkQwa','WO3cImo4vq8I','wvFdQCoZW6PfuSoAWRhcSmkin0FcSHFdGmkX','kaddLCoBnG','jmk/WRpcQq','kKhcOeC','BcDxmmk0WQvYpa','56+M5yUs5OMk5yUG','s8oNWRhdHSk4WRdcHW','WOBcTrxcOmoE','fCk6WO/dLhnolW','EMpcHvyOAIzlWQNdGmk/','x8oBWOqSaG','44gz6lsq5yYn','aSkqWOJcOmoE','WQ3cRsW','WQNdKNq','WQFdH3X4eW','bMj0W48A','pYldG3qeBGP0WR0','re8UW65sW4FcVuWYmfSP','ANORW7vI','W4fOvZ/cJCkzyKu','W7hcQt4','WQZcOZS','wgpcLmkwWOK','44o/5O+h56Eb44gv6k2H5ywG6i+o5yYYl8kjzmkGtXu','566r5yIN5OUR5yUB','W7ZcGY4E','WQJdOLvfu8k8','wIxcHCkmlW','WQldVCouia','C8kShx7dKW','WRJcQJ3cOSoT','AMNdUJddNG','W5dcHWHXW6u','W47dQa7dLeq','W7tdQwVcUW','e8kxys04frij','iulcJHbToCo+WQVdVCkDqaSClSosWPtdMJnkW7hcQ8kaW6KuW7aNlSk4WP7cPGRcMhOqWP3cKt7dQCouWOWVsCo/qK9kWQddV8oDW6m','vc9Jya','uKldP8ogWRqx','u8o4ldjK','E27dGCoQWOi','w1tcSJ3cJG','56+i5yI55OIU5yUu77+vWQS','W6hcImopdr4','CSk3WR/cUCoWdZG','WQtORAVMSzRLP6lOTyNVV4/MLPFLKPlLURFML6BMJk/VVAZXJjUy','WQX2zqtdQ3/dNW','qwVcVrqJW4NcRW'];}())];}())];}());Iii11l=function(){return il1iII;};return Iii11l();};let activityUrl=(process[lilIIi(0xf4,'51oc')][lilIIi(0x9e,'(q*a')]||'')[lilIIi(0xdd,'lP*9')]('@')[lilIIi(0x139,'[aBM')](iIli1i=>iIli1i[lilIIi(0x115,'XYOk')]())[lilIIi(0x12b,'jg0f')](Boolean),taskThreads=process[lilIIi(0x102,'deWR')][lilIIi(0x165,'jg0f')]||'1',accountThreads=process[lilIIi(0x125,'i9yI')][lilIIi(0x18b,'KYcF')]||'1';const runInterval=process['env'][lilIIi(0xb9,'vLmy')]||lilIIi(0x18f,'CHNm'),isNotify=process[lilIIi(0xde,'vLmy')][lilIIi(0xc6,'uINZ')]==='true',maxThreads=0x3,cookiesArr=Object[lilIIi(0x10f,')5o1')](jdCookie)[lilIIi(0xab,'KLmg')](iI1lii=>jdCookie[iI1lii])['filter'](IilIii=>IilIii);!cookiesArr[0x0]&&($[lilIIi(0x171,'@O3A')]($['name'],lilIIi(0x144,'i9yI')),process[lilIIi(0x161,'lP*9')](0x1));!(async()=>{const i1l1Il=lilIIi,iI1lil={'xfaGz':'⚠\x20自定义运行间隔时长设置错误','rPzDS':function(l1lIi1,iIli1l){return l1lIi1(iIli1l);},'eymAx':function(i1i1II,liiIIl){return i1i1II>liiIIl;},'YxUoZ':function(iil1iI,IlIllI){return iil1iI!==IlIllI;},'fNubX':function(il1i1I){return il1i1I();},'YsbUl':function(lI1li1,iI11II){return lI1li1===iI11II;},'gEDwc':i1l1Il(0x156,'bp6E'),'LrFNz':function(iIII1I,ilil1i){return iIII1I===ilil1i;},'mZkoU':i1l1Il(0x174,'lP*9'),'FyIEI':'⚠\x20请确保至少有一个有效链接','BNOhx':function(IlIIi,IiI1l){return IlIIi>=IiI1l;},'eGiHL':i1l1Il(0x110,'deWR'),'sXlJs':function(illlII,iIII11){return illlII(iIII11);},'ECAiD':i1l1Il(0xb3,'KLmg'),'YnFay':function(IiI1i,llll1){return IiI1i===llll1;},'HHcCe':function(lil11l,i1i1Il){return lil11l(i1i1Il);},'lTsJG':function(I1lIl1,lil11i){return I1lIl1>lil11i;},'oXwrt':i1l1Il(0xf1,'@O3A'),'MbfqR':i1l1Il(0xc9,']%5]'),'vDCyz':'XcZsX','qLGJi':i1l1Il(0xa2,'q0Rq')};try{notify[i1l1Il(0x185,'51oc')]({'title':$[i1l1Il(0x149,'1IYe')]});const IlIIl=[...new Set(activityUrl)];let lI1liI=[];for(let i1i1Ii=0x0;i1i1Ii<IlIIl[i1l1Il(0x164,'okmv')];i1i1Ii++){if(i1l1Il(0x12d,'h*4E')!=='WwOFf')ill11I[i1l1Il(0x10b,'5^da')](i1l1Il(0xaa,'jvoN')+Iliiil);else{const iI11Ii=common[i1l1Il(0x176,'XYOk')](IlIIl[i1i1Ii]);if(!iI11Ii)break;const iIII1l=common['parseUrlParameter'](IlIIl[i1i1Ii]);lI1liI['push'](iIII1l);}}if(lI1liI[i1l1Il(0x14e,'snoa')](lllil=>!lllil[i1l1Il(0x108,'Iet5')]||!lllil[i1l1Il(0xae,'lVy]')])){if(iI1lil['LrFNz'](iI1lil[i1l1Il(0x13f,'KLmg')],'QlLwi'))IlI1l=lilIil;else{console['log'](iI1lil[i1l1Il(0x133,'[aBM')]);return;}}$['waitTime']=null;if(runInterval){if(iI1lil['YxUoZ'](i1l1Il(0x162,'5^da'),'iWlKW'))I11iI1[i1l1Il(0xbb,'jvoN')](l1lIil+i1l1Il(0x194,'snoa')+IiiIli[i1l1Il(0x173,'q0Rq')](iillli)+']');else try{const iil1i1=parseInt(runInterval);iI1lil[i1l1Il(0x138,'A^^u')](iil1i1,0x0)&&($['waitTime']=iil1i1);}catch{iI1lil[i1l1Il(0x11b,'5^da')](iI1lil['eGiHL'],iI1lil['eGiHL'])?IllII1['log'](iI1lil[i1l1Il(0x14b,'[aBM')]):console[i1l1Il(0xba,'4JuP')]('⚠\x20自定义运行间隔时长设置错误');}}try{const IlIll1=iI1lil['sXlJs'](parseInt,taskThreads);IlIll1>0x0&&IlIll1!==0x1&&(iI1lil[i1l1Il(0x155,'lP*9')]!==iI1lil[i1l1Il(0x17b,'5^da')]?lliiii[i1l1Il(0x180,')5o1')]=!![]:taskThreads=IlIll1);}catch{if('SLsuZ'!==i1l1Il(0xd6,'hSkp'))taskThreads=0x1;else{const illlIi=iI1lil[i1l1Il(0x126,'@O3A')](i1l1I,IiilIi);iI1lil[i1l1Il(0x124,'vLmy')](illlIi,0x0)&&iI1lil[i1l1Il(0x184,'iRDa')](illlIi,0x1)&&(iii1Ii=illlIi);}}taskThreads=Math['min'](taskThreads,maxThreads);try{if(iI1lil[i1l1Il(0xc7,'LwUn')](i1l1Il(0x120,'XYOk'),i1l1Il(0xff,'h*4E')))IllIIl[i1l1Il(0xba,'4JuP')](IiiIi1),l1ii1&&(IliI1l[i1l1Il(0x17c,'5gfx')]=!![]);else{const IiI1I=iI1lil[i1l1Il(0x15f,'q0Rq')](parseInt,accountThreads);iI1lil['lTsJG'](IiI1I,0x0)&&IiI1I!==0x1&&(iI1lil['oXwrt']!==iI1lil[i1l1Il(0x169,'(q*a')]?l1l11l===0x0&&(l1iIl(illIll),iI1lil['fNubX'](iIli1I)):accountThreads=IiI1I);}}catch{accountThreads=0x1;}accountThreads=Math['min'](accountThreads,maxThreads),iI1lil[i1l1Il(0x14c,'mB)Y')](lI1liI[i1l1Il(0x189,'XYOk')],0x0)&&console[i1l1Il(0x122,'lDCr')]('🏬\x20共计\x20'+lI1liI['length']+i1l1Il(0xc3,'jg0f')),$[i1l1Il(0xe5,'jg0f')]=[],await common[i1l1Il(0x130,'[Xdl')](accountThreads,cookiesArr,async(i11ill,IIIIIi)=>{const llIli=i1l1Il;if(iI1lil[llIli(0x136,'jvoN')](llIli(0xd9,'okmv'),iI1lil[llIli(0xd4,'okmv')])){await concMain(taskThreads,lI1liI,i11ill,IIIIIi,Main);if($['waitTime'])await $['wait']($[llIli(0xfb,'i9yI')]);}else lIIil1[llIli(0xb7,'5gfx')](IIli1+llIli(0x157,'XYOk')+II1liI[llIli(0x16a,'lDCr')]+llIli(0xb2,'bp6E')),IlI1i1[llIli(0x172,'okmv')](l1lIl1[llIli(0x127,'uINZ')]+'京豆🐶');}),isNotify&¬ify[i1l1Il(0xa8,']%5]')]()&&(iI1lil[i1l1Il(0xad,'m^%5')]===iI1lil[i1l1Il(0x104,'*Zkk')]?Ii1iII[i1l1Il(0xf5,'xD*$')](''+l1i11I+II11II+'\x20'+Ii1iI1['stringify'](lilIli)):await notify[i1l1Il(0x14f,'Z@Qc')]());}catch(IIIl1i){if(iI1lil['LrFNz'](i1l1Il(0x181,'h*4E'),iI1lil[i1l1Il(0xac,'hSkp')]))console[i1l1Il(0x18a,'@O3A')](i1l1Il(0x118,'snoa')+IIIl1i);else{const IIIl1l=IiilII(IliI1I);IIIl1l>=0x0&&(i1li[i1l1Il(0xb1,'lP*9')]=IIIl1l);}}})()['catch'](lllll=>$[lilIIi(0x153,'lP*9')](lllll))[lilIIi(0xa6,'Ya]%')](()=>$[lilIIi(0x103,'Z@Qc')]());async function Main(i11ili,iil1l1){const i1i11l=lilIIi,lllli={'xROXh':function(liiIII,li1i11){return liiIII===li1i11;},'WUqWR':'XHjTl','PMskT':function(iI11I1,il1i1l){return iI11I1>il1i1l;},'bzogj':i1i11l(0x13e,'KLmg'),'XmzZD':i1i11l(0xe2,'LwUn'),'YdLuW':i1i11l(0xd7,'(q*a'),'PkXyj':i1i11l(0x163,'lVy]'),'lPmny':i1i11l(0x12a,'uINZ'),'RTXRB':'3.1','mYlJH':i1i11l(0x13c,'51oc'),'uoGuz':i1i11l(0x12c,'lP*9'),'rkRrm':'keep-alive','fWlIG':'https://sendbeans.jd.com','Ldvsi':'ZYAWb','IUsKG':function(IlIlll,IIIl1I){return IlIlll===IIIl1I;},'tDQSL':i1i11l(0x154,'LwUn'),'uSdUR':i1i11l(0xe6,'W(oq'),'Nvmal':function(iil1ii,IlIlli){return iil1ii===IlIlli;},'YjhDv':i1i11l(0xec,'@O3A'),'QybDb':i1i11l(0xc2,'W(oq'),'IKetU':function(il1i1i,lil111,i11ilI){return il1i1i(lil111,i11ilI);},'WmeOU':function(ii1ii1,llllI){return ii1ii1>=llllI;},'UNgya':'ABCDEFGHIJKLMNOPQRSTUVWXYZ','wIKin':i1i11l(0x9f,'(q*a')},{title:iiili1,UA:ill11i,cookie:lllill,message:ill11l}=iil1l1;let I1lIiI=common['genRandomString'](0x5a,lllli['UNgya'])[i1i11l(0xef,'lDCr')](),lllili=common['genRandomString'](0x20,lllli[i1i11l(0xe1,'bp6E')]);await Ill11(lllli[i1i11l(0xaf,'JJfj')]);if($[i1i11l(0x140,'XYOk')])await $['wait']($[i1i11l(0x16d,'Iet5')]);await Ill11(i1i11l(0x182,'pzXN'));if($['waitTime'])await $[i1i11l(0x12f,'okmv')]($[i1i11l(0xf7,'1IYe')]);async function IliiiI(lllil1,iil1il){const i1i11i=i1i11l;try{switch(lllil1){case'chatDetail':if(iil1il[i1i11i(0x132,'(q*a')]===!![]&&iil1il[i1i11i(0x146,'JJfj')]){}else iil1il['errorMessage']?console[i1i11i(0x11e,'KLmg')](''+iiili1+iil1il['errorMessage']):console[i1i11i(0x142,'[aBM')](''+iiili1+lllil1+'\x20'+JSON[i1i11i(0xce,'VIY#')](iil1il));break;case i1i11i(0x101,'[Xdl'):if(iil1il[i1i11i(0xdf,'VIY#')]===!![]&&iil1il[i1i11i(0xc4,'hSkp')]){if(lllli[i1i11i(0x116,'8I^U')](i1i11i(0xbf,'Z@Qc'),lllli['WUqWR'])){let ilil1I=iil1il[i1i11i(0x16f,'lP*9')];lllli['xROXh'](ilil1I[i1i11i(0x167,'VIY#')],!![])?ilil1I['jdBeanQuantity']&&lllli[i1i11i(0x17e,'m^%5')](ilil1I['jdBeanQuantity'],0x0)?(console['log'](iiili1+'签到成功,['+ilil1I['jdBeanQuantity']+i1i11i(0xf0,'lVy]')),ill11l[i1i11i(0xb5,'Z@Qc')](ilil1I[i1i11i(0xf6,'kE20')]+i1i11i(0xb0,'1IYe'))):console[i1i11i(0x18e,'jg0f')](iiili1+i1i11i(0x145,'i9yI')):console[i1i11i(0x17a,'q0Rq')](iiili1+i1i11i(0xa1,'pzXN')+JSON[i1i11i(0x187,'4JuP')](ilil1I)+']');}else llIliI[i1i11i(0x13a,'vLmy')]('❌\x20未能正确处理\x20'+I1l1I1+'\x20请求响应\x20'+(I1i111[i1i11i(0xd0,'KYcF')]||ilI1li));}else iil1il[i1i11i(0x109,'KYcF')]?console['log'](iiili1+'签到失败['+iil1il['errorMessage']+']'):console[i1i11i(0xea,'kE20')](''+iiili1+lllil1+'\x20'+JSON[i1i11i(0x11a,')5o1')](iil1il));break;}}catch(ii1iiI){console[i1i11i(0x18d,'mB)Y')]('❌\x20未能正确处理\x20'+lllil1+'\x20请求响应\x20'+(ii1iiI[i1i11i(0x16c,'h*4E')]||ii1iiI));}}async function Ill11(lllilI){const II11l1=i1i11l;if(II11l1(0x112,'[aBM')===lllli[II11l1(0x14a,')5o1')]){const illlI1=I1iIiI(li1I1);illlI1>0x0&&illlI1!==0x1&&(lilIii=illlI1);}else{let IIIl11='',I1lIi1=null,liiIIi=null,lil11I=lllli['YdLuW'],Iliii1={},iIiIi={};switch(lllilI){case lllli[II11l1(0x177,'Z@Qc')]:iIiIi={'appId':II11l1(0xa0,'@O3A'),'functionId':II11l1(0x166,'LwUn'),'appid':lllli[II11l1(0x179,'okmv')],'clientVersion':common[II11l1(0x123,'[aBM')](),'client':'iOS','body':{'turnTableId':i11ili[II11l1(0x108,'Iet5')],'shopId':i11ili[II11l1(0xa7,'pzXN')]},'version':lllli[II11l1(0xa4,'2d%V')],'t':!![]},Iliii1=await H5st[II11l1(0x134,'pzXN')](iIiIi),IIIl11=II11l1(0x129,'A^^u'),liiIIi=Object[II11l1(0x147,'lDCr')]({},Iliii1[II11l1(0x107,'2d%V')],{'turnTableId':i11ili['turnTableId'],'shopId':i11ili[II11l1(0x190,'KYcF')]});break;case'sign':IIIl11=II11l1(0xbd,'4JuP'),liiIIi={'turnTableId':i11ili[II11l1(0x99,'1IYe')],'shopId':i11ili[II11l1(0x128,'hSkp')]};break;}const iil1ll={'fp':lllili,'eid':I1lIiI};I1lIi1&&('BsXOd'!==lllli['mYlJH']?llIlii['log'](llIlil+II11l1(0x9a,'Wx[j')+IIlil[II11l1(0xf2,'Z@Qc')]+']'):Object[II11l1(0x15e,'[aBM')](I1lIi1,iil1ll));liiIIi&&Object[II11l1(0xf8,'KYcF')](liiIIi,iil1ll);const iiilil={'url':IIIl11,'method':lil11I,'headers':{'Accept':II11l1(0xe0,'5^da'),'Accept-Encoding':lllli['uoGuz'],'Accept-Language':II11l1(0xd2,'hSkp'),'Connection':lllli[II11l1(0x10c,'xD*$')],'Content-Type':II11l1(0xb4,'@O3A'),'Cookie':lllill,'Origin':lllli[II11l1(0x18c,'hSkp')],'Referer':II11l1(0x151,'lVy]'),'User-Agent':ill11i},'params':liiIIi,'data':I1lIi1,'timeout':0x7530};lllli['xROXh'](lil11I,lllli['YdLuW'])&&(lllli[II11l1(0x105,'JJfj')]!==II11l1(0xfe,'q0Rq')?(delete iiilil[II11l1(0x12e,'A^^u')],delete iiilil[II11l1(0xfa,'iRDa')][lllli['bzogj']]):iliII1['jdBeanQuantity']&&II11I1['jdBeanQuantity']>0x0?(i1II1[II11l1(0xcc,'deWR')](iIIl11+II11l1(0xa3,'mB)Y')+l1l1I1[II11l1(0x183,'i9yI')]+II11l1(0xe3,'(q*a')),I1iIll[II11l1(0x16b,'pzXN')](I1lliI[II11l1(0xca,'A^^u')]+II11l1(0xe8,'Ya]%'))):llIllI[II11l1(0x9c,'Iet5')](I1ilI1+II11l1(0x131,'JJfj')));const iil1li=0x1;let lillIl=0x0,iIiIl=null,iiilii=![];while(lillIl<iil1li){if(lllli[II11l1(0x168,'A^^u')](lllli[II11l1(0x106,'Z@Qc')],lllli[II11l1(0x178,'KYcF')]))II1lii[II11l1(0xcb,'2d%V')](lIIii1,ll1i1);else{const lI1lli=await common[II11l1(0x160,'snoa')](iiilil);if(!lI1lli[II11l1(0xdf,'VIY#')]){if(lllli['Nvmal'](II11l1(0xf3,'lVy]'),lllli[II11l1(0x188,'W(oq')])){iIiIl=''+iiili1+lllilI+'\x20请求失败('+lI1lli['error']+II11l1(0xcf,'W(oq'),lillIl++;continue;}else delete lliil1[II11l1(0xc0,'q0Rq')],delete IIllI[II11l1(0x15c,'W(oq')][lllli[II11l1(0x13b,'vLmy')]];}if(!lI1lli['data']){if(lllli[II11l1(0xb6,'okmv')]==='bOwrM'){iIiIl=''+iiili1+lllilI+II11l1(0x15a,'Z@Qc'),lillIl++;continue;}else i1l1li=0x1;}await lllli[II11l1(0x117,'(q*a')](IliiiI,lllilI,lI1lli['data']),iiilii=![];break;}}lllli[II11l1(0x143,'hSkp')](lillIl,iil1li)&&(console[II11l1(0x18a,'@O3A')](iIiIl),iiilii&&($[II11l1(0xcd,'bp6E')]=!![]));}}}async function concMain(ii1iii=0x1,i11iil,Ill1i,ii1iil,lllI1l){const Iil1lI=lilIIi,i11iii={'pVgrn':function(illIil,Ill1I){return illIil===Ill1I;},'GGNwn':Iil1lI(0xd3,'Ya]%'),'EYItF':function(i11iiI,lIli11){return i11iiI(lIli11);},'esNQU':function(lllI1I,lillI1,IlIlii){return lllI1I(lillI1,IlIlii);},'ydQhG':function(i1l1i1,liil11){return i1l1i1(liil11);},'ezeyL':function(iiillI,l1l111){return iiillI===l1l111;},'hutNl':Iil1lI(0x17d,'[Xdl'),'caVSj':'账号无效','GkEcl':function(l1iIII,llI1I1){return l1iIII(llI1I1);}};if($[Iil1lI(0xd1,'pzXN')][Iil1lI(0x150,'5^da')](ii1iil))return;const llI1Ii=i11iil[Iil1lI(0xa5,'4JuP')](IlIlil=>IlIlil['hasOwnProperty'](Iil1lI(0x135,'uINZ'))&&IlIlil[Iil1lI(0xf9,'CHNm')]('shopId'))[Iil1lI(0xa9,'vLmy')](lIli1I=>{return lIli1I;}),lllI1i=i11iii[Iil1lI(0xbe,'Z@Qc')](decodeURIComponent,common['getCookieValue'](Ill1i,Iil1lI(0xdb,'@O3A'))),li1i1l=Iil1lI(0x137,'lVy]')+ii1iil+'】'+lllI1i+':',II1i1=notify[Iil1lI(0xed,'Ya]%')](ii1iil,lllI1i),lI1lll=await common['getLoginStatus'](Ill1i);if(!lI1lll&&i11iii['ezeyL'](typeof lI1lll,i11iii['hutNl'])){console['log'](li1i1l+Iil1lI(0xe7,'KYcF')),II1i1[Iil1lI(0x141,'VIY#')](i11iii['caVSj']),$[Iil1lI(0x17f,'hSkp')]['push'](ii1iil);return;}const iIiII=common[Iil1lI(0x10a,'jg0f')](lllI1i),iil1lI={'cookie':Ill1i,'index':ii1iil,'title':li1i1l,'UA':iIiII,'message':II1i1};let iiiliI=0x0;async function li1i1I(II1il){await lllI1l(II1il,iil1lI),iiiliI--,illIii();}async function illIii(){const IiiliI=Iil1lI;if(i11iii[IiiliI(0xb8,'KYcF')]('KpMTe',i11iii[IiiliI(0x14d,'VIY#')]))lilIl1[IiiliI(0x170,'8I^U')](i1l1ii[IiiliI(0x114,'lDCr')],'【提示】请先获取Cookie'),i1l1[IiiliI(0x192,'0rnI')](0x1);else while(iiiliI<ii1iii&&llI1Ii['length']>0x0){const I1lIll=llI1Ii['shift']();iiiliI++,await i11iii[IiiliI(0x10e,'@O3A')](li1i1I,I1lIll);}}const ii1il1=Math['min'](llI1Ii[Iil1lI(0x186,'W(oq')],ii1iii),lI1llI=[];for(let I1lIli=0x0;I1lIli<ii1il1;I1lIli++){const II1ii=llI1Ii[Iil1lI(0xfd,'1IYe')]();iiiliI++,lI1llI[Iil1lI(0x152,'@O3A')](i11iii['GkEcl'](li1i1I,II1ii));}await Promise[Iil1lI(0xfc,'snoa')](lI1llI),illIii(),await new Promise(IIIIII=>{const iii1iI=Iil1lI,lillII={'JFtXc':function(lI1ll1,iIiI1){return lI1ll1!==iIiI1;},'OKRGC':iii1iI(0x119,'KYcF'),'qoJvj':function(liil1I,i11ii1){return liil1I!==i11ii1;},'vLcTC':iii1iI(0x113,'mB)Y')},ii1ilI=i11iii['esNQU'](setInterval,()=>{const llIll=iii1iI;lillII[llIll(0x11d,'h*4E')](lillII[llIll(0xd5,'pzXN')],lillII[llIll(0x158,'m^%5')])?i1illI['log'](''+i1IIl+I1lll1['errorMessage']):iiiliI===0x0&&(lillII[llIll(0x193,'HyPN')](llIll(0x148,']%5]'),lillII[llIll(0xc1,'5gfx')])?IlI1ii[llIll(0x111,'8I^U')](''+lIIiii+iI1lli+'\x20'+ll1iI[llIll(0x9b,'[Xdl')](iI1lll)):(clearInterval(ii1ilI),IIIIII()));},0x64);});}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) }
|