mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
19 lines
24 KiB
JavaScript
19 lines
24 KiB
JavaScript
/*
|
||
活动名称:批量店铺签到(历史查询)
|
||
活动链接:https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=<token>
|
||
环境变量:jd_dpqd_tokens // 活动令牌,多个用英文逗号分割
|
||
jd_dpqd_task_threads // 控制签到并发线程数(正整数),默认1
|
||
jd_dpqd_account_threads // 控制账号并发线程数(正整数),默认1
|
||
jd_dpqd_account_interval // 自定义运行间隔时长(整数,单位毫秒),默认1000
|
||
|
||
此脚本为高并发历史查询本,需要读取主脚本生成的活动信息缓存
|
||
脚本主要用于查询连签天数,不会进行签到操作,为了提高签到本的效率故将此功能分离
|
||
|
||
cron:1 1 1 1 *
|
||
|
||
*/
|
||
|
||
const $ = new Env('批量店铺签到(历史查询)')
|
||
const _0x20e94e=_0x1356;(function(_0x2df580,_0x2c49df){const _0x2b899d=_0x1356,_0xd9aa7=_0x2df580();while(!![]){try{const _0x6a0d8a=parseInt(_0x2b899d(0xf5,']KOJ'))/0x1+-parseInt(_0x2b899d(0x16c,'%m4P'))/0x2*(-parseInt(_0x2b899d(0x117,'ALvg'))/0x3)+-parseInt(_0x2b899d(0x121,'Kd)L'))/0x4*(parseInt(_0x2b899d(0x160,'iVgd'))/0x5)+parseInt(_0x2b899d(0x137,'5Y98'))/0x6+parseInt(_0x2b899d(0x135,'ALvg'))/0x7*(-parseInt(_0x2b899d(0x132,'(1HB'))/0x8)+parseInt(_0x2b899d(0x146,'**8x'))/0x9*(parseInt(_0x2b899d(0xf2,'Kd)L'))/0xa)+parseInt(_0x2b899d(0x12e,'!WZE'))/0xb*(-parseInt(_0x2b899d(0x12d,'!WZE'))/0xc);if(_0x6a0d8a===_0x2c49df)break;else _0xd9aa7['push'](_0xd9aa7['shift']());}catch(_0x1b66a1){_0xd9aa7['push'](_0xd9aa7['shift']());}}}(_0x323f,0x67e92));const jdCookie=require('./jdCookie'),notify=require(_0x20e94e(0x111,'1Q7N')),common=require(_0x20e94e(0xf9,'lOgR')),{jsTk}=require(_0x20e94e(0x140,'Kd)L'));console['log'](''),console[_0x20e94e(0x104,'IuQK')](_0x20e94e(0x169,'PIGh')+$[_0x20e94e(0x15c,'R$GJ')]+'变量说明=========='),console[_0x20e94e(0x145,'5odT')](_0x20e94e(0xed,'iVgd')),console[_0x20e94e(0xfe,'zzi*')](_0x20e94e(0x143,'K*]N')),console[_0x20e94e(0xee,'gl3B')]('jd_dpqd_account_threads\x20//\x20控制账号并发,默认1'),console[_0x20e94e(0x122,'3W^A')]('jd_dpqd_account_interval\x20//\x20自定义运行间隔时长'),console['log'](_0x20e94e(0x123,'!WZE')+$[_0x20e94e(0x10e,'gl3B')]+_0x20e94e(0x178,'CUQB')),console[_0x20e94e(0x145,'5odT')]('');let tokensList=(process[_0x20e94e(0x16d,'%m4P')][_0x20e94e(0x16f,'R$GJ')]||'')['split'](/[,@&|\n]+/g)[_0x20e94e(0x161,'1J$a')](Boolean),taskThreads=process['env']['jd_dpqd_task_threads']||'1',accountThreads=process[_0x20e94e(0xfb,'zZ)[')][_0x20e94e(0x127,'IuQK')]||'1';const runInterval=process[_0x20e94e(0x16e,'iVgd')][_0x20e94e(0x118,'ALvg')]||_0x20e94e(0x16a,'wHXr'),isNotify=![];function _0x1356(_0x908390,_0x84bc2c){const _0x323f2a=_0x323f();return _0x1356=function(_0x135670,_0xcb2f5d){_0x135670=_0x135670-0xeb;let _0x25e713=_0x323f2a[_0x135670];if(_0x1356['ijAIyS']===undefined){var _0x4beaf1=function(_0x216be6){const _0x38d8c2='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3ddc0f='',_0x4be639='';for(let _0x363c43=0x0,_0x4f87e1,_0x1a3dcd,_0x5474bb=0x0;_0x1a3dcd=_0x216be6['charAt'](_0x5474bb++);~_0x1a3dcd&&(_0x4f87e1=_0x363c43%0x4?_0x4f87e1*0x40+_0x1a3dcd:_0x1a3dcd,_0x363c43++%0x4)?_0x3ddc0f+=String['fromCharCode'](0xff&_0x4f87e1>>(-0x2*_0x363c43&0x6)):0x0){_0x1a3dcd=_0x38d8c2['indexOf'](_0x1a3dcd);}for(let _0x9865a2=0x0,_0x2eff59=_0x3ddc0f['length'];_0x9865a2<_0x2eff59;_0x9865a2++){_0x4be639+='%'+('00'+_0x3ddc0f['charCodeAt'](_0x9865a2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4be639);};const _0x3067c1=function(_0x43937a,_0x275a5d){let _0x4dfc81=[],_0x3a3d24=0x0,_0x56d3cd,_0x4ab6ff='';_0x43937a=_0x4beaf1(_0x43937a);let _0x1a702c;for(_0x1a702c=0x0;_0x1a702c<0x100;_0x1a702c++){_0x4dfc81[_0x1a702c]=_0x1a702c;}for(_0x1a702c=0x0;_0x1a702c<0x100;_0x1a702c++){_0x3a3d24=(_0x3a3d24+_0x4dfc81[_0x1a702c]+_0x275a5d['charCodeAt'](_0x1a702c%_0x275a5d['length']))%0x100,_0x56d3cd=_0x4dfc81[_0x1a702c],_0x4dfc81[_0x1a702c]=_0x4dfc81[_0x3a3d24],_0x4dfc81[_0x3a3d24]=_0x56d3cd;}_0x1a702c=0x0,_0x3a3d24=0x0;for(let _0x380ccf=0x0;_0x380ccf<_0x43937a['length'];_0x380ccf++){_0x1a702c=(_0x1a702c+0x1)%0x100,_0x3a3d24=(_0x3a3d24+_0x4dfc81[_0x1a702c])%0x100,_0x56d3cd=_0x4dfc81[_0x1a702c],_0x4dfc81[_0x1a702c]=_0x4dfc81[_0x3a3d24],_0x4dfc81[_0x3a3d24]=_0x56d3cd,_0x4ab6ff+=String['fromCharCode'](_0x43937a['charCodeAt'](_0x380ccf)^_0x4dfc81[(_0x4dfc81[_0x1a702c]+_0x4dfc81[_0x3a3d24])%0x100]);}return _0x4ab6ff;};_0x1356['IrgcxL']=_0x3067c1,_0x908390=arguments,_0x1356['ijAIyS']=!![];}const _0x584760=_0x323f2a[0x0],_0x33264=_0x135670+_0x584760,_0x4a54f6=_0x908390[_0x33264];return!_0x4a54f6?(_0x1356['sJCyfp']===undefined&&(_0x1356['sJCyfp']=!![]),_0x25e713=_0x1356['IrgcxL'](_0x25e713,_0xcb2f5d),_0x908390[_0x33264]=_0x25e713):_0x25e713=_0x4a54f6,_0x25e713;},_0x1356(_0x908390,_0x84bc2c);}let TokensMap=new Map();function _0x323f(){const _0x2d7b39=['WPfRv1zkW7myWQm','tNNdKa','W4iiW5pdJa','F27dU3LIWQKzW4O','kZhdJW','W6xcLWS','WP3dN8oLWRpcVg7dM8oPW5yx','gslcJ157ua','kmojW5bmW4FdRhvQWRTHW4hdHSo8','CZXKW5O','W5L7WRyYWO95f8kVvmkPWOHVreRcICkNW7jxFcG','WRRdNmkhW7/cVdTCW6dcSCkCW7/dJa','WQ8YhmoqW57dPgxcUmoAW6ik','tqHyW6i','pmozW4D8W4VdUgG','WRNdHLPuWOVcGCoxgSoDFa','WOpdImkxAq','n+IUQUAXKUwrTUw7ISkA','iZXsW64AW5hdSq','CJnM','W4NcImkK','W4ynW6hdJvpdQHhdM2fFoflcHWa','W5asWPhcLq','WQ7dVubtW60CWPCBcG7cGMa','WOajhmol','W7xdTmov','WQxdVSoeW6JdHsLCDW','iXndWPZdKYe','W5CjWPiKWRCaWPXsWP3cHSov','WPGWkG','5O+M56wK57ML5P67kbmyr27cJqaQWQZcHq','W6pcNHm6W5/dM8keDCkfiJaRWQq','WQBdS8kkWP/cIdxcS8khmG','WRRdNmkgW7/cVtviW7tcOSkCW5xdNG','W6m5WRmaWRzKWQHMWR/cOSkbgZX3W4RcHgi','W4BcGSknW6lcJM3dTmo1W4OqkYRdVG7cPv4NWOhMTldLIBVcHHBVV6dLPAdKU4NNLQFOIidML7RPGz/LJzlLIR/LI7O','W6NcL8kc','o+kFHmkm','W4hdH8o5sWxcJ8kfW7m','W77dTmopxmkMWPy','WOeLWOq0WOH4e8k1','77265Bsi6l6K5lQx6zMO77YJ','WP7dILa7','WPL1nI/dH8kaeCkXomoZWO/cHW','WRFdLvvhWOFcKSoA','W4BINPyE6k+v5RgC5AAR6lwq77+o5PAl5zgA5BMg5PwL5O+l77+j8yA7Pa','4P62WOVOHlpMNAtOVRpOO6/PG5ZLIPlKUOhPLyNOR5nt','WRXMW789rCkFWRVcJmo+q8ksqCk1WPtcLhxdKtJdSYddTSkfWOm','WQFdUv0nW7miW5jqtfJdG2dcO3hcImo5WOm4pSkyEmkTWPyZDSkpWPz2W4lcVcTUBhqsW7FcMmoIsSo1WQS8W7yWWQFdSCk4W5JdI2bqurpdKmkKWPDrs8kcWO/cMCkVlCoNkxzXW5dcISo4WQ3cOWC','WQNdRSkt','W7C6WOldGq','oa7cTW','W5GCWOi','sa5qW7n1WOK','W4dcNCogpwCPy8ovgSkRcCoU','W5hINAtdLEIST+AWJUwKOEI1IE+9IG','k01h','44gF6lsJ5yY2','d8k/WQq','kI3dJW','W4f6Da','WQ/cN8ooobJdOmk+WQXJWPz5W5tdTa','W4i0DgJcH8kmC8oBeSkIW67cICo9WQrBW6hdJSkeW6ddQq','d8ovDmkH','W7qWWPJdQcPHrg4MWRDqWOLUWRW','4PUMhUIVL+wfTowUUUs6How9NUIMREEAR+EpG+wIUEwpTEMhJ+wqIowfT+I9PoIGPoIfVUAFVU+8JW','AuBdNSoxgWCd','ptBcHxLAW6SgW4pcG8oRW6OhW4ldJSkcvSoUWQVdPG','W6VcMCkiW6i','md/dGu5aWQ4rW44','D1aiWQddMc3cSmoxbG','iqddHCochGCjW6tdSmoQWP/dGN0yW6VdLq0Oe8k+e8kVxmkWWPFdG8kb','W7ldHmk9','BqHsW7n1WPuXW500W5pdId8','W6JcMSocWQhdQgm','W4hdJ8oV','W6BcQCowW4VdTW5U','W7FcVXXkWRHXWOGUDIlcOa','WQxdQxyzW7bdWPKGrq7cJMldUhxcMmkiWOK5j8osAmk6WPu6','W7ZdTdlcNcJdUXlcL8kxz8kSFCkgW6ddSHPiW4GAEmoBBXBdQq','fCkFBSoEv0xdN8khWRveW4JcHL/cQG','h3K/c2nR','W7lcMCkmW7pdMx1EWQq','WQ3dOmk5','W71hWPW','W7RdISkxB1ZcUW','W7pdJSkPnYTYWPy','WOuLW7OcWPfyc8kksW','W7JdRYe','t8ohj8kGbrFcICotW60V','W5ZdH8oZDau','W4ldH8oSyG','W4mUDh3cHSoxp8kajCo0WQxcISkNWQTnWPddNSkdW6lcTSknWQNcVMxdOfrxlINcMs3dU8k2WR5Nv8kjWQe','cCk0WPXEB8oUjuW4W5zTtI9XbSk1WPRcTCklEmkoymot','fY7cGK57umk0','44k75O6f56s144gB6kY25yEj6iYZ5y++W5PvrSoOW7eH','W4fUcW','W7BcM8kxW67dVwa','W7RcNCodWQhdOwP4W4pcIG','q8oiEColB37dSSkK','s8oklCkTcbNcJCkcWQbDW6/cS2y','WQGsWPrfoG','Ctf/W5qS','W7BdSmovwG','WQVcOHRdUSknpSkjW7a','W4xdImoIAXxcNCkfW6W','W6Peoa','W7ZcUb5kWRikWQqUDqNcIhW','s+kCQcdINOXU5P6T6kYg5AAT6lEtWOldLL0','WQq5gSosW5tcNIJcGSo7W78Zxh8','WOudsmoBW6ddPJ8','WR/dIbJdICkXWOmPW43dK8kM','y0RdNSoraWm','W7VIN6BdNEkDR27MN6tORAVLPR7OTBlVVyG','hxeNhG','W4NdLmoZAbi','W5GwWOVcK8ooW7m','4P69W5JMN5/OGl3MRk/NOB7LPAJNKytcVa','WP46WRCJWPrwaCoUCSkPWPHvw1hcUCkF','6lwK5y6x5PEq5PA9WPtWRkMI','W7WGWPJdOILNsG','WPVcNmkQWQq8yqGDW6GZj8kkgSkmW4LEwcPvu8oIWQeGaEAmPowiN+ETJ+wkS+w5UEwoOo+/NoM4ToIUGaS','W4hdH8oX','W786WOS','WPS3vs3cOCoMp8kxsmk4fSoSWRy','WPVdIf0HfCokW6/dM040','WO7dHeiTdCkE','dCkXWQ5F','W49Ua3ldT8k3Aa','W6BdTmozt8o9WO7dHSoazGa','W6DhWOxdMa','W5ZcKSknW7BcL3i','W7FcRCotW53dUG','W7hcJWfeWO4','W67dVCkTWQ5WASolW7C2AmogBadcQ8oHWPapWPxcPN8','WRtdImkJW6tdUfzsWRu','W74SW6qUwmkB','xqzrW6i9WPq3WPKhW4pdLG','W4hcLCk1','WQJdMb/dRa','W44TzJ4','WP3cL8ks','xrnDW7vKWOGsWPKuW4i','oComW4VdOsS'];_0x323f=function(){return _0x2d7b39;};return _0x323f();}const invalidTokensMap=new Map(),CacheFile=__dirname+_0x20e94e(0x150,'r^0P'),cookiesArr=Object[_0x20e94e(0x172,'Fd4H')](jdCookie)[_0x20e94e(0x144,'G7WY')](_0x3067c1=>jdCookie[_0x3067c1])[_0x20e94e(0xff,'Z93F')](_0x216be6=>_0x216be6);!cookiesArr[0x0]&&($[_0x20e94e(0x154,'iVgd')]($[_0x20e94e(0x125,'G7WY')],_0x20e94e(0x129,'jgoB')),process[_0x20e94e(0x156,'jgoB')](0x1));!(async()=>{const _0x4894c9=_0x20e94e;try{notify['config']({'title':$[_0x4894c9(0x149,'IuQK')]});if(tokensList[_0x4894c9(0x11f,'Wsfq')]>0x0)tokensList=[...new Set(tokensList[_0x4894c9(0x11b,'#)hq')](_0x3ddc0f=>_0x3ddc0f!==''))];if(tokensList[_0x4894c9(0xf1,'aslA')]<=0x0){console['log'](_0x4894c9(0x10b,'nsh4'));return;}const _0x38d8c2=require('fs');if(_0x38d8c2['existsSync'](CacheFile)){const _0x4be639=_0x38d8c2[_0x4894c9(0x100,'wHXr')](CacheFile,_0x4894c9(0x14f,'PIGh')),_0x363c43=JSON[_0x4894c9(0x124,'G7WY')](_0x4be639);for(const _0x4f87e1 in _0x363c43){TokensMap['set'](_0x4f87e1,_0x363c43[_0x4f87e1]);}}$[_0x4894c9(0x10f,'Gasg')]=null;if(runInterval)try{const _0x1a3dcd=parseInt(runInterval);_0x1a3dcd>=0x0&&($['waitTime']=_0x1a3dcd);}catch{console['log']('⚠\x20自定义运行间隔时长设置错误');}try{const _0x5474bb=parseInt(taskThreads);_0x5474bb>0x0&&_0x5474bb!==0x1&&(taskThreads=_0x5474bb);}catch{taskThreads=0x1;}try{const _0x9865a2=parseInt(accountThreads);_0x9865a2>0x0&&_0x9865a2!==0x1&&(accountThreads=_0x9865a2);}catch{accountThreads=0x1;}await common['concTask'](accountThreads,cookiesArr,async(_0x2eff59,_0x43937a)=>{const _0x3a239e=_0x4894c9;await concMain(taskThreads,tokensList,_0x2eff59,_0x43937a,Main);if($[_0x3a239e(0x15a,'&XL8')])await $[_0x3a239e(0x14c,'E#nt')]($['waitTime']);}),isNotify&¬ify[_0x4894c9(0x139,'b$*X')]()&&await notify['push']();}catch(_0x275a5d){console[_0x4894c9(0x11d,'r^0P')](_0x4894c9(0xf8,'Vk^7')+_0x275a5d);}})()[_0x20e94e(0x14e,'Kts6')](_0x4dfc81=>$['logErr'](_0x4dfc81))[_0x20e94e(0x10c,'1Q7N')](()=>$[_0x20e94e(0xfc,'5odT')]());async function Main(_0x3a3d24,_0x56d3cd){const _0x391a57=_0x20e94e,{title:_0x4ab6ff,UA:_0x1a702c,cookie:_0x380ccf,message:_0x2e12a7,jsToken:_0x37be90}=_0x56d3cd;if(invalidTokensMap['get'](_0x3a3d24))return;let _0x285812='',_0x353a99='',_0x419ec9=null;const _0x1446aa=TokensMap['get'](_0x3a3d24);if(_0x1446aa)_0x285812=_0x1446aa['venderId'],_0x353a99=_0x1446aa[_0x391a57(0x147,'Vk^7')],_0x419ec9=_0x1446aa[_0x391a57(0xf0,'G7WY')];else try{if(_0x3a3d24[_0x391a57(0x133,'G7WY')](':')&&_0x3a3d24[_0x391a57(0x159,'V^L@')](':')[_0x391a57(0x152,'lOgR')]===0x3){const _0x22cbd7=_0x3a3d24['split'](':');if(!_0x22cbd7[0x0]||!_0x22cbd7[0x1]||!_0x22cbd7[0x2])return;_0x3a3d24=_0x22cbd7[0x0];if(_0x3a3d24[_0x391a57(0x13e,'zzi*')]!==0x20||!/^[A-Z0-9]*$/['test'](_0x3a3d24))return;_0x353a99=_0x22cbd7[0x1],_0x285812=_0x22cbd7[0x2],_0x22cbd7[0x2][_0x391a57(0x158,'Z93F')](_0x391a57(0x15b,'1J$a'))&&_0x22cbd7[0x2][_0x391a57(0x13e,'zzi*')]===0x8&&!_0x22cbd7[0x1]['startsWith']('123')&&(_0x353a99=_0x22cbd7[0x2],_0x285812=_0x22cbd7[0x1]),TokensMap[_0x391a57(0x106,'HWBL')](_0x3a3d24,{'index':null,'venderId':_0x285812,'shopName':'','activityId':_0x353a99,'startTime':'','endTime':'','isValid':!![],'rules':[],'minLevel':null,'maxLevel':null});}}catch(_0x33405e){return;}if(!_0x285812||!_0x353a99)return;const _0xd3f0ec=Math[_0x391a57(0x130,'%m4P')](Date['now']()/0x3e8)+'000';if(invalidTokensMap[_0x391a57(0x173,'aslA')](_0x3a3d24))return;await _0x32af9f(_0x391a57(0x162,']]!4'));if($[_0x391a57(0x11c,'gl3B')])await $['wait']($['waitTime']);function _0xd7e509(_0x9068c7,_0x2871d4){const _0xbb00fd=_0x391a57;try{switch(_0x9068c7){case _0xbb00fd(0x179,'PIGh'):if(_0x2871d4[_0xbb00fd(0x167,'Z93F')]===0xc8&&_0x2871d4[_0xbb00fd(0x168,']]!4')]===!![]&&_0x2871d4[_0xbb00fd(0x109,'NrjG')]){const _0x41e54b=_0x2871d4[_0xbb00fd(0x170,'zzi*')][_0xbb00fd(0xf4,'Vk^7')];console[_0xbb00fd(0x157,'K*]N')](''+_0x4ab6ff+_0x3a3d24+_0xbb00fd(0xef,'f%90')+(_0x41e54b>0x9?_0x41e54b:'\x20'+_0x41e54b)+'天'+(_0x41e54b>0x0&&_0x419ec9&&_0x41e54b>=_0x419ec9?_0xbb00fd(0xf3,'!WZE'):''));}else _0x2871d4[_0xbb00fd(0x105,'Gasg')]?console[_0xbb00fd(0x112,'(X2w')](''+_0x4ab6ff+_0x3a3d24+_0xbb00fd(0x13b,'XlyS')+_0x2871d4[_0xbb00fd(0x102,'nsh4')]+')'):console['log'](''+_0x4ab6ff+_0x3a3d24+_0xbb00fd(0x136,'NrjG')+JSON[_0xbb00fd(0x12c,'*lW#')](_0x2871d4));break;}}catch(_0x3e3f90){console[_0xbb00fd(0x12a,'**8x')](_0xbb00fd(0x13f,'K*]N')+_0x9068c7+_0xbb00fd(0x16b,'%m4P')+(_0x3e3f90[_0xbb00fd(0x120,'(X2w')]||_0x3e3f90));}}async function _0x32af9f(_0x4ea779){const _0x5c68bf=_0x391a57;let _0x320437='',_0x39a799=null,_0x110002=null,_0x3474ac=_0x5c68bf(0x134,'**8x'),_0x366de2={},_0x2db7fc={};switch(_0x4ea779){case'getSignRecord':_0x320437=_0x5c68bf(0x119,'3W^A'),_0x110002={'appid':_0x5c68bf(0x164,'Kd)L'),'functionId':_0x5c68bf(0x126,']KOJ'),'body':JSON['stringify']({'token':_0x3a3d24,'venderId':parseInt(_0x285812)||'','activityId':parseInt(_0x353a99)||'','type':0x38}),'jsonp':_0x5c68bf(0x17a,'zZ)[')};break;}const _0x2aba8b={'t':_0xd3f0ec,'loginType':'2','x-api-eid-token':_0x37be90};_0x39a799&&Object[_0x5c68bf(0x175,'cr%7')](_0x39a799,_0x2aba8b);_0x110002&&Object[_0x5c68bf(0x114,'*lW#')](_0x110002,_0x2aba8b);const _0x4ab549={'url':_0x320437,'method':_0x3474ac,'headers':{'Accept':_0x5c68bf(0x177,'HWBL'),'Accept-Encoding':_0x5c68bf(0xec,'iv^@'),'Accept-Language':_0x5c68bf(0x10d,'Gasg'),'Connection':'keep-alive','Content-Type':_0x5c68bf(0x14b,'aslA'),'Host':_0x5c68bf(0x171,'ALvg'),'Referer':_0x5c68bf(0x108,']KOJ'),'Sec-Fetch-Dest':_0x5c68bf(0x12b,'gl3B'),'Sec-Fetch-Mode':_0x5c68bf(0x138,'Fd4H'),'Sec-Fetch-Site':_0x5c68bf(0x153,'Z93F'),'User-Agent':_0x1a702c,'Cookie':_0x380ccf},'params':_0x110002,'data':_0x39a799,'timeout':0x7530};_0x3474ac===_0x5c68bf(0xfd,'1J$a')&&(delete _0x4ab549[_0x5c68bf(0x13c,'#)hq')],delete _0x4ab549[_0x5c68bf(0x128,'1J$a')][_0x5c68bf(0x113,'Z93F')]);const _0x38a26b=0x3;let _0x3180dc=0x0,_0x3c7d2c=null,_0xb3c806=![];while(_0x3180dc<_0x38a26b){const _0x4b078a=await common[_0x5c68bf(0x116,'Kts6')](_0x4ab549);if(!_0x4b078a['success']){_0x3c7d2c=''+_0x4ab6ff+_0x3a3d24+_0x5c68bf(0x101,'K*]N')+_0x4b078a[_0x5c68bf(0x13d,'G7WY')]+')🚫',_0x3180dc++;continue;}if(!_0x4b078a[_0x5c68bf(0x131,'aslA')]){_0x3c7d2c=''+_0x4ab6ff+_0x3a3d24+_0x5c68bf(0xf7,'&XL8'),_0x3180dc++;continue;}_0xd7e509(_0x4ea779,_0x4b078a[_0x5c68bf(0x163,'%m4P')]),_0xb3c806=![];break;}_0x3180dc>=_0x38a26b&&(console[_0x5c68bf(0x15e,'Gasg')](_0x3c7d2c),_0xb3c806&&($[_0x5c68bf(0x142,'5odT')]=!![]));}}async function concMain(_0x34d813=0x1,_0x17bac0,_0x49e2c8,_0x41d678,_0x31e5df){const _0x233793=_0x20e94e,_0x5c51b9=_0x17bac0[_0x233793(0x11e,'E#nt')](_0x43f066=>_0x43f066),_0x3b88bb=decodeURIComponent(common[_0x233793(0x11a,'!WZE')](_0x49e2c8,_0x233793(0x14d,'iVgd'))),_0x17cbcb=_0x233793(0x103,'i#c%')+_0x41d678+'】'+_0x3b88bb+':',_0x13c022=await common[_0x233793(0x10a,'5odT')](_0x49e2c8);if(!_0x13c022&&typeof _0x13c022===_0x233793(0x14a,'**8x')){console['log'](_0x17cbcb+_0x233793(0x141,'cr%7'));return;}const _0x33abec=notify['create'](_0x41d678,_0x3b88bb),_0x4c60d6=common['genUA'](_0x3b88bb),{jsToken:_0x2193df}=await jsTk(_0x4c60d6,_0x233793(0xfa,'ALvg'),{'bizId':_0x233793(0x176,'iv^@'),'v':_0x233793(0xf6,'PIGh'),'qs':_0x233793(0x148,'Vk^7')+_0x17bac0[0x0]}),_0x3039ca={'cookie':_0x49e2c8,'index':_0x41d678,'title':_0x17cbcb,'UA':_0x4c60d6,'message':_0x33abec,'jsToken':_0x2193df};let _0x5d7f1c=0x0;async function _0x235f0e(_0x3fe20e){await _0x31e5df(_0x3fe20e,_0x3039ca),_0x5d7f1c--,_0x3f42b7();}async function _0x3f42b7(){const _0x51ea8a=_0x233793;while(_0x5d7f1c<_0x34d813&&_0x5c51b9[_0x51ea8a(0x13a,'1Q7N')]>0x0){const _0x4877c3=_0x5c51b9[_0x51ea8a(0x12f,'XlyS')]();_0x5d7f1c++,await _0x235f0e(_0x4877c3);}}const _0x48cdc2=Math[_0x233793(0x115,'G7WY')](_0x5c51b9['length'],_0x34d813),_0x40c12d=[];for(let _0x3d271a=0x0;_0x3d271a<_0x48cdc2;_0x3d271a++){const _0x2a5512=_0x5c51b9['shift']();_0x5d7f1c++,_0x40c12d[_0x233793(0x155,'b$*X')](_0x235f0e(_0x2a5512));}await Promise[_0x233793(0x15f,'PIGh')](_0x40c12d),_0x3f42b7(),await new Promise(_0x5c2df4=>{const _0x905278=setInterval(()=>{_0x5d7f1c===0x0&&(clearInterval(_0x905278),_0x5c2df4());},0x64);});}
|
||
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)}
|