faker3/jd_clean_coupon.js
2024-07-28 00:58:58 +08:00

14 lines
28 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
删除优惠券
环境变量JD_COUPON_PIN_FILTER_GOODS // 需删除优惠券的账号填入pin多个用@分割)
JD_COUPON_DELETE // 需删除优惠券的关键字(填入关键字,多个用英文逗号,@,换行分割)(默认删除:限购@部分商品)
JD_COUPON_EXCLUDE // 需保留的优惠券关键字(填入关键字,多个用英文逗号,@,换行分割)(默认保留:东东@农场@无门槛)
cron:1 1 1 1 *
*/
const $ = new Env('删除优惠券')
const _0x397af4=_0xe4be;function _0xe4be(_0xecdcc7,_0x410bea){const _0x401271=_0x4012();return _0xe4be=function(_0xe4be9,_0x20df39){_0xe4be9=_0xe4be9-0xd5;let _0xff5812=_0x401271[_0xe4be9];if(_0xe4be['XuOABi']===undefined){var _0x407f54=function(_0x1558d0){const _0x1136e6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x340fc1='',_0x37ced5='';for(let _0x3f67ec=0x0,_0x1464e8,_0x4eb2f3,_0x57596d=0x0;_0x4eb2f3=_0x1558d0['charAt'](_0x57596d++);~_0x4eb2f3&&(_0x1464e8=_0x3f67ec%0x4?_0x1464e8*0x40+_0x4eb2f3:_0x4eb2f3,_0x3f67ec++%0x4)?_0x340fc1+=String['fromCharCode'](0xff&_0x1464e8>>(-0x2*_0x3f67ec&0x6)):0x0){_0x4eb2f3=_0x1136e6['indexOf'](_0x4eb2f3);}for(let _0x43b232=0x0,_0xbb4773=_0x340fc1['length'];_0x43b232<_0xbb4773;_0x43b232++){_0x37ced5+='%'+('00'+_0x340fc1['charCodeAt'](_0x43b232)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x37ced5);};const _0x5b3332=function(_0x24cc56,_0x4fd424){let _0x422454=[],_0x21e707=0x0,_0x4e52b9,_0x1da85e='';_0x24cc56=_0x407f54(_0x24cc56);let _0x6d6000;for(_0x6d6000=0x0;_0x6d6000<0x100;_0x6d6000++){_0x422454[_0x6d6000]=_0x6d6000;}for(_0x6d6000=0x0;_0x6d6000<0x100;_0x6d6000++){_0x21e707=(_0x21e707+_0x422454[_0x6d6000]+_0x4fd424['charCodeAt'](_0x6d6000%_0x4fd424['length']))%0x100,_0x4e52b9=_0x422454[_0x6d6000],_0x422454[_0x6d6000]=_0x422454[_0x21e707],_0x422454[_0x21e707]=_0x4e52b9;}_0x6d6000=0x0,_0x21e707=0x0;for(let _0x318367=0x0;_0x318367<_0x24cc56['length'];_0x318367++){_0x6d6000=(_0x6d6000+0x1)%0x100,_0x21e707=(_0x21e707+_0x422454[_0x6d6000])%0x100,_0x4e52b9=_0x422454[_0x6d6000],_0x422454[_0x6d6000]=_0x422454[_0x21e707],_0x422454[_0x21e707]=_0x4e52b9,_0x1da85e+=String['fromCharCode'](_0x24cc56['charCodeAt'](_0x318367)^_0x422454[(_0x422454[_0x6d6000]+_0x422454[_0x21e707])%0x100]);}return _0x1da85e;};_0xe4be['pNcFjr']=_0x5b3332,_0xecdcc7=arguments,_0xe4be['XuOABi']=!![];}const _0x47f541=_0x401271[0x0],_0x2de75a=_0xe4be9+_0x47f541,_0x4432f9=_0xecdcc7[_0x2de75a];return!_0x4432f9?(_0xe4be['PMFOlq']===undefined&&(_0xe4be['PMFOlq']=!![]),_0xff5812=_0xe4be['pNcFjr'](_0xff5812,_0x20df39),_0xecdcc7[_0x2de75a]=_0xff5812):_0xff5812=_0x4432f9,_0xff5812;},_0xe4be(_0xecdcc7,_0x410bea);}(function(_0x5893a9,_0x114768){const _0x231006=_0xe4be,_0x17daef=_0x5893a9();while(!![]){try{const _0x573c8c=-parseInt(_0x231006(0xed,'WZJ$'))/0x1*(parseInt(_0x231006(0x117,'Hx54'))/0x2)+-parseInt(_0x231006(0x15a,'[Q[F'))/0x3*(parseInt(_0x231006(0x189,'Hx54'))/0x4)+parseInt(_0x231006(0x1a0,'4cWL'))/0x5+-parseInt(_0x231006(0x147,'Cn)X'))/0x6+-parseInt(_0x231006(0x192,')H&K'))/0x7*(-parseInt(_0x231006(0x165,'Edhn'))/0x8)+-parseInt(_0x231006(0x18c,'l]sc'))/0x9+parseInt(_0x231006(0x10c,'#YGX'))/0xa;if(_0x573c8c===_0x114768)break;else _0x17daef['push'](_0x17daef['shift']());}catch(_0xb776ce){_0x17daef['push'](_0x17daef['shift']());}}}(_0x4012,0x764f8));const jdCookie=require(_0x397af4(0xe4,'2Zeg')),notify=require(_0x397af4(0x150,'#YGX')),common=require(_0x397af4(0x1ab,'@v1%')),{H5st}=require(_0x397af4(0xf9,'t73!')),excludeKeywords=(process['env'][_0x397af4(0x100,'JX@5')]||_0x397af4(0xef,'[q7I'))[_0x397af4(0x16e,'Y3dg')](/[,@\n]+/g)[_0x397af4(0x174,'q*5k')](_0x5b3332=>_0x5b3332[_0x397af4(0x11a,'gh)a')]())[_0x397af4(0x167,'fzI%')](Boolean),requiredKeywords=(process[_0x397af4(0x135,'pxHT')][_0x397af4(0x19a,'ZAbn')]||'限购@部分商品')[_0x397af4(0x112,'q*5k')](/[,@\n]+/g)[_0x397af4(0xf3,'r%De')](_0x1558d0=>_0x1558d0[_0x397af4(0xe0,'&plp')]())[_0x397af4(0x148,'t73!')](Boolean),pinFilterGoods=(process[_0x397af4(0x127,'fAvK')]['JD_COUPON_PIN_FILTER_GOODS']||'')[_0x397af4(0x13a,'ww7]')]('@')[_0x397af4(0x129,'^dU%')](_0x1136e6=>_0x1136e6),isNotify=![];let cookie='';const cookiesArr=Object[_0x397af4(0x120,'JX@5')](jdCookie)[_0x397af4(0xde,'YJHt')](_0x340fc1=>jdCookie[_0x340fc1])[_0x397af4(0x17b,'&plp')](_0x37ced5=>_0x37ced5);!cookiesArr[0x0]&&($[_0x397af4(0x118,'U0Vt')]($['name'],'【提示】请先获取Cookie'),process['exit'](0x1));!(async()=>{const _0x4e09f4=_0x397af4;console['log'](_0x4e09f4(0x158,'^xOy')+$[_0x4e09f4(0xe9,'ZAbn')]+_0x4e09f4(0x154,'0@]c')),console[_0x4e09f4(0x185,'C*cq')](_0x4e09f4(0xe3,'@v1%')),console['log'](_0x4e09f4(0x111,'#YGX')),console['log'](_0x4e09f4(0x15c,'Edhn')+excludeKeywords['join'](',\x20')+']'),console[_0x4e09f4(0x16c,'Hx54')](_0x4e09f4(0x161,'r&U4')+requiredKeywords['join'](',\x20')+']'),console[_0x4e09f4(0x1ae,'2Zeg')]('执行账号:\x20['+(pinFilterGoods[_0x4e09f4(0xf5,'UY9H')]?pinFilterGoods[_0x4e09f4(0x115,'t73!')](',\x20'):_0x4e09f4(0x164,'vW9K'))+']'),console[_0x4e09f4(0x12a,'jHQ&')](_0x4e09f4(0xf2,'#YGX')+$[_0x4e09f4(0x183,'8M[L')]+_0x4e09f4(0x101,'toC0'));if(pinFilterGoods==''){console[_0x4e09f4(0x146,'UY9H')](_0x4e09f4(0x106,'B5et'));return;}notify['config']({'title':$[_0x4e09f4(0x10a,'fAvK')]});for(let _0x1464e8=0x0;_0x1464e8<cookiesArr[_0x4e09f4(0xee,'&plp')];_0x1464e8++){$[_0x4e09f4(0x160,'JX@5')]=_0x1464e8+0x1,cookie=cookiesArr[_0x1464e8],common[_0x4e09f4(0x11f,'YuO5')](cookie),$[_0x4e09f4(0xeb,'Hx54')]=decodeURIComponent(common[_0x4e09f4(0x142,'[q7I')](cookie,'pt_pin')),$[_0x4e09f4(0x14c,'0@]c')]=notify['create']($['index'],$[_0x4e09f4(0x104,'YJHt')]),$['area']=_0x4e09f4(0x17c,'t73!')+common[_0x4e09f4(0x16a,'U0Vt')](0x4,_0x4e09f4(0x198,'l0#X'))+'_0',$[_0x4e09f4(0xdd,'q*5k')]='';if(pinFilterGoods[_0x4e09f4(0xec,'YuO5')](encodeURIComponent($['UserName'])))console[_0x4e09f4(0x159,'f*61')](_0x4e09f4(0x177,'YJHt')+$[_0x4e09f4(0xfb,'Edhn')]+'】'+($[_0x4e09f4(0x1a5,'l]sc')]||$[_0x4e09f4(0x11e,'4cWL')])+_0x4e09f4(0x14b,'t73!')),await Main();else{pinMsg='\x0a账号['+pinFilterGoods+']\x20不在账号列表中请检查环境变量是否配置正确\x0a';continue;}common[_0x4e09f4(0x180,'JX@5')]();if($[_0x4e09f4(0x11b,'YJHt')])break;await $['wait'](0x7d0);}if(pinMsg)console[_0x4e09f4(0x12c,'8M[L')](pinMsg);const _0x3f67ec=notify[_0x4e09f4(0xfa,'b!Dd')]();_0x3f67ec&&(console[_0x4e09f4(0x166,'Edhn')](_0x4e09f4(0x17f,'ww7]')+_0x3f67ec[_0x4e09f4(0xd9,'3]]&')](//g,_0x4e09f4(0x155,'fzI%'))),isNotify&&(notify[_0x4e09f4(0x1a7,'Hx54')]('\x0a'),await notify[_0x4e09f4(0x162,'B5et')]()));})()[_0x397af4(0x18a,'09vb')](_0x4eb2f3=>$[_0x397af4(0x124,'WZJ$')](_0x4eb2f3))[_0x397af4(0x121,'r%De')](()=>$['done']());async function Main(){const _0x1380f2=_0x397af4,_0x57596d=await common[_0x1380f2(0x163,'[q7I')](cookie);if(!_0x57596d&&typeof _0x57596d===_0x1380f2(0x170,'^xOy')){console['log'](_0x1380f2(0x17d,'jHQ&'));return;}try{$[_0x1380f2(0x15f,'&plp')]=![],$['totalNum']=0x0,$['useable']=[],await sendRequest('queryJdCouponListAppletForJd');if($['totalNum']>0x0){console['log'](_0x1380f2(0x109,'[Q[F')+$['totalNum']+_0x1380f2(0x19f,'#YGX')),$['message']['insert'](_0x1380f2(0x13c,'ww7]')+$[_0x1380f2(0x1a8,'ww7]')]+_0x1380f2(0x156,'pxHT'));if($[_0x1380f2(0x14d,'B5et')][_0x1380f2(0x139,'vW9K')]>0x0){let _0x43b232=[...$[_0x1380f2(0xfd,'UY9H')]],_0xbb4773=0x0,_0x24cc56=0x0;while(_0x43b232[_0x1380f2(0x181,'WZJ$')]>0x0&&!$[_0x1380f2(0xf7,'2Zeg')]){const _0x4fd424=_0x43b232[_0x1380f2(0x103,'YuO5')](0x0,0x14);$[_0x1380f2(0x143,'@4m(')]=_0x4fd424['filter'](_0x422454=>{const _0x1f7e65=_0x1380f2,_0x21e707=excludeKeywords['some'](_0x1da85e=>typeof _0x422454[_0x1f7e65(0x133,'^xOy')]===_0x1f7e65(0x1a6,'Cn)X')&&_0x422454[_0x1f7e65(0x137,'Y3dg')][_0x1f7e65(0x126,'ZAbn')](_0x1da85e)),_0x4e52b9=requiredKeywords[_0x1f7e65(0x144,'#YGX')](_0x6d6000=>typeof _0x422454['limitStr']===_0x1f7e65(0x128,'q*5k')&&_0x422454[_0x1f7e65(0xd7,'B5et')][_0x1f7e65(0xdf,'8M[L')](_0x6d6000));return typeof _0x422454['couponTitle']===_0x1f7e65(0x18d,'fzI%')&&!_0x21e707&&_0x422454[_0x1f7e65(0x132,'Edhn')]===0x1&&typeof _0x422454[_0x1f7e65(0x131,'Hx54')]==='string'&&_0x4e52b9;})[_0x1380f2(0xff,'ww7]')](_0x318367=>{const _0xf63d8c=_0x1380f2;let _0xe39f21='';const _0x141155=parseFloat(_0x318367[_0xf63d8c(0x196,')H&K')]),_0x3288f8=parseFloat(_0x318367['discount']);if(_0x318367[_0xf63d8c(0x11d,'ycNJ')]===0x0)_0xe39f21='满'+_0x141155['toFixed'](0x2)+'元减'+_0x3288f8[_0xf63d8c(0x168,'fAvK')](0x2)+'元';else{if(_0x318367[_0xf63d8c(0x140,'^dU%')]===0x3){const _0x3dd76d=(0x1-_0x3288f8)*0x64;_0xe39f21='满'+_0x141155['toFixed'](0x2)+'元打'+_0x3dd76d['toFixed'](0x0)+'折';}}return console[_0xf63d8c(0x1a1,'[Q[F')]('即将删除:'+_0x318367[_0xf63d8c(0x175,'Edhn')]+'('+_0xe39f21+')('+_0x318367[_0xf63d8c(0x14e,'WZJ$')]+')'),_0x318367[_0xf63d8c(0x176,'b!Dd')]+','+_0x318367[_0xf63d8c(0x12e,'@4m(')]+','+_0x318367[_0xf63d8c(0x138,'[Q[F')];})[_0x1380f2(0xd8,'@4m(')]('|');if($[_0x1380f2(0x136,'l]sc')]){const _0x5ce56d=$[_0x1380f2(0x10b,'P!gt')][_0x1380f2(0x1a9,'l0#X')]('|')[_0x1380f2(0x190,'@4m(')];_0x5ce56d>0x0&&(console[_0x1380f2(0x173,'eOTU')](_0x1380f2(0xe1,'zJ4d')+_0x5ce56d+_0x1380f2(0x187,'2Zeg')),$['delrun']=![],await sendRequest(_0x1380f2(0x10e,'C*cq')),$['delrun']&&(await $[_0x1380f2(0x153,'09vb')](0x3e8),_0xbb4773+=_0x5ce56d,$[_0x1380f2(0x113,'r%De')]=$[_0x1380f2(0x108,'l]sc')]['filter'](_0x1c088=>!_0x4fd424[_0x1380f2(0x195,'eOTU')](_0x1c088)),_0x43b232=_0x43b232['slice'](0x14)));}else{console[_0x1380f2(0x16d,'49Ze')](_0x1380f2(0x182,'ww7]'));break;}_0x24cc56++;if(_0x24cc56>=0x32){console[_0x1380f2(0xe8,'pxHT')]('删除优惠券次数过多,多余的次数请再执行脚本~');break;}}console[_0x1380f2(0x16c,'Hx54')](_0x1380f2(0x178,'#YGX')+_0xbb4773+_0x1380f2(0xf1,'49Ze'));}else console[_0x1380f2(0xf8,'@v1%')](_0x1380f2(0xd5,'zJ4d'));}else console[_0x1380f2(0x185,'C*cq')](_0x1380f2(0x1aa,'Edhn'));}catch(_0x37543d){console[_0x1380f2(0x188,'q*5k')](_0x1380f2(0x151,'Y3dg')+_0x37543d);}}function _0x4012(){const _0x489749=['W65VWOinWR9SW5KvW6CRba','W7lcJ8kZESkakW','5RcC5P295OQr5yUV5y+55yIM6zQx55Qy5l2l5Oga5yUl','oCkOWPhcUq','4P65W53MNAZOG6BMRBxNOk3LPk7NKRvY','zmkKW5C','rCkGWQPAW6iKWOT0W6FdL8kRWQ8','5lQU5lYI5Ooy5yQT','sYiX','rSkHWQ5BW6aIWR1TW7JdTSkOWQu','WQ5thSkGW4a','B8o5rs8hWRm','WPVcOCkECWZdMvFcOG8ZW7zZca','CSoRx15smG','AmoZxc0DWRpcPt5yfCoZWO/cH8ov','W7n1WOuyWRGvWPLvW60YcbZcKgKwWPz/nmoOW6TBWR5pW5K','WQhdOSoYzgJdGq','W67dGxNcTWzpbSkuW7WZsxZcK3ZdICkQxYiPDthdRmohsH3cIx5M','W4tdKwDPWQDMWPHgtq','nmosW4W','EMJcOCkbpmkQ','ySoYsJehWRNcQsm','WOpcLJT1WRC','F8k+pSk1vHHLvSkGWQNdLq','W7pcJY3cS8oOcSo3xIaE','WQVdNmoRlSocCX3cRtdcQM1w','W7bvqZ/dRCk8uCoGWOjkfw5TxSk0tq','WPxcU8oxWOWzjCk3','yCo4bd4cWRxcQdvih8oZWONcHmoeogG1','W7iyW6xdOSoRC0zbcqZcKcXQE8khW4/dSSkkWQRcGSoFWOiDW6e','ecpdQmkgWPS3','5lUO5l+s5Ogd5yQb','gfTHuSokW7GuW7ldSvmDkCoo','WRjJWPa','W6LzW5VdV8oWDa','jXuUW6KWWRDArKS','WQpcUSotW5xcShpdOCoMcSo1WONdT39rxtPHfSombSknE8oSv8o8WRhcI8ohpmoUW6y0W5K','W4FdUCokk3FcIG3cLW','W4NcIvCGvKS','eSoNW6GnWRH2WQ9ZW4tdSCkfWQxcKq','W4KBWPVcVNPiWOzX','WRddJNpdQCkO','5PEQ5y6f55wQ5lYQ5OgH5yIC5OU95PYd6iYy5y675yIe5l2X5OoG5yUC5yMU6kkl','WOxdOSkAW4JdPLytW4ylWRy2tmkgja/cTWdcRW3cL3BdRSkB','WR7cJSoPqSkQWP8MkSo8n1jdWRhdVJ1M','tIm1W4JcRgFdUIa','W6HvxW','5PER5y+F55sF5lYy5OkK5yMa5OI75PYm6iYE5y6L5yMA5l2a5OkX5yUJ5yUI6kkh','WPJcKdTVWQzVWQHBua','WQvmWP7cP01KWPtdMq','WQFdQmo1Bq','W57dUmkGW4nEoMK','tZKIW5tcQJNcShWljmoFkehcNN3dVq/cPG','WQxdOSo9z3NdM8os','smkaWQ0ht8oK','ssq1W4/cL2ldSJy','D8kdDq','pSkNWP/cSgpcHSkmrq','WOHwbHW','5BYl5AE75y6m5yIG6zIG5lMY6l+D','WPNcKIe','5Rgd5OEc5lMK6Aof776v5RkB5lUR6kYE5yQM6lYd6kcy77YL5Rgl5lUC6k6N5yII6l606kkG44gG','WQOvuSoXW6zmFKTdbq','W7ldRSkvW4nXWR/dJCkiqXf6l8o6WOTDW47dRaj8W78UW5W','mSkKWOZcQg8','WP3cLIbhWRPnWO0','W4jjW4S','W5rWCrK','ACoRwuDpBZ3cH8kkmCkrWQhcOSoXzs0OW7/dKmoXW5uDDqy','jSoKW70AWPHZWOf5','gIldVSkAWOe9c8oD','WQRdMmoQjConDclcHsZcVwDv','WPbbarBdG8kW','5lI95lIDpoweN+wFSmo35Ps96zEo5QAg','rCkLWQ9AW68QW5XAW4tdNCk5WOBcNq','5lUt5l+r5Ook5yQa','W7/dT8kEWOtdPc3cVCkVxSkN','WPJcNdy','W69EW5/dQSoNA0y','bauGWQ8jW6W','uqD0jSk2W61BW63cR0Pmumk4FHb0WRVdGmk3AJ54W7JdTCkcWRa0WOlcVmoucqldPu7cVCouWQRcQgD2u8kXaSkSqLBcNW','W7DruCoLW7DwFW','W4FcOSki','BSk+sSkHWONcGmoCyNNdGSklW4pcHSoKW412','W7hdRSknW6TGWQNdVCkguqq','yWqMv8o5','WRFdI8ogr8kTWOGIlmoknuugWR/dKJfNW5pdNXxcKg0CWRLC','hrmRWQKFW6Hu','WPRcLYbXWQuwW4u/y0RdS8kdWObTW6KzictdRW','W5avWP8','W5ffWQ4RWOr6W6y1W4iDjgRcVGSPWRyu','5yYh6ysX54IV5OcV57Iq5P6JEMpcQgubuCoMWRbVnq','mSkQW4FdNuKbWRtcOvddMtG8WR0','acddTmkvWPe','t8krymoaW73cHmk4bG','WQ1NWP5+dmoOqG','W4pMNi/ORy3NVQdNJPBLORtLJlJPHAqbWRq0WO/dOgTSuL/dIh3dVSk7qmkUW6RdNwZcM2xdIWXKhqtdKE+/I+MbQUweU+AlNUIGVMm','W4mFWP1VWRRdJx/dQmkhr8oRWPufrSoYWPVdKq','W5ZdO8omivVcHWu','5PY76k+U5yUh5yw/5P2x','oGaXW6u','ySoXWORcMHrwW6JcUfpdNJGCWPBdSa','W7tdUmkuWOVdOcJcSmoudCocWR7cLx8','W7JcG8kL','BmkUW5WgW6DzuxytWRXgiWLHW5T5kNlcQZXXla','W63cI8kWEmozld7cTqxcSeS','k+IVH+AXTEwKSEI1OvJINReg','5zom5OgE5lIL77616kYU5OMB5yIO5z66iSokWRFKU5lLM5NMLyRNQ7pMGk/LPjVKVkpMGyRLIzhJG70','vd06W43cRq','WOdcJIn6Dc9p','y8kkWOVcKvNcJSkQ','kSo+vSk7','WOdcLJPeWRHi','r8ouW68LWPL+WQ8','BSoKra','fmoYW6WGW6nHWPG','oMNdMSkX','AmkxA8o3W53cGq','W7LyW6tdNeldTudcVSkMzq','W57cUqtdOwOWANVcGfxcSG','FHW8f8k2WQbmW6a','acNdQCk1WPS2bCohWPO','W7bKWOGB','WPpcLcH6EI9t','WOddQmoMANddHCoasfmDWPbWk8kdWPVcNxngcmocWOdcPSoUfLvVWOC5W5GOW7RcGCoUW4LxbgJdV8o9WRlcI3ehrCo6WR5rymork8kWW6qGpSk0W5ZdSLRcHCoFlSkvWOtcKSkIW77dOCkHWPThWQGXWQhdHgTSkCkGW6qjn8knW5GfWQZcSmoNp3NcMmkJamkMv8oPWOXlWRVcMCo+WORdVCksW6hcGSoXghfmW6z3tCobdYKogmkXvCoSW43dPmomkmoSeSkmkmoBW6TnW7O','WR7cJCoQr8kKWPi','W7lcHCk6wmkgmq','5yUI6zQU5l675Ogz5yUH5OIa5yIF','W5n/FXddL8knzmoC','mq8Q','vdKKW43cT2q','DSoKf2zNza','WPtcSCod','WQ95WPj8j8oxsmofbCodtmkVz8kuogNcL8klt2XgCSocCJNdKCo1WPu','o8kMWPS','iCoSAG','WQ7dQmoPC3pdH8ovhHzw','WPGuWP9JW7NcSgNdNmk4','W5L+EbK','h8o+W7ubWQjbWPHU','Aqu3qSoUsSkFumoFca','W6X6cSonjf51cCoJW6ddUW','koISVoAZSUwsRUw4HXW','W4TiW5O','W4RdV8oCmfBcHqNcNdODW7j1mSoR','W7LcW4/dU8oQAxDAiG3cJa','WR1JWOj+mCoZF8oYe8oAwq','W6vCW7JdMLVdRG','W44eWOpcTMi','WQXbgCkQW4/cRG','5P2y6k6w5yUF5yAU5PYF','WONORAFMS6VLPBhOTjZdI+kFVmos5PA85zk/5BIk5PwS5OYV','4P2pWRFMNiNNNA7OROhMS4xcNq','W7tcIIJcUmk6','C8oIdMjTEmkrF8kzW6ldUa','WPNdVmoyWO/cUGHxWRKkWPi8rSkJ','rMqiW4dcPCoyWRzpomk7WQJcSriT','WQ7dQmoPC3pdH8oicqbCW4W5CmkE','WQFcVmogW4VcOa','yq8NqSkSrCkhqmozca','ba8P','WOZdIHD7dbRdN8oAWPZcN8kAba','jSo4u8kHWOxcNG','WPJcH3LIWQzeWO51yL7dRmocWPPSWRvxiG','ievO','ASk7fCo/W4RdHSkL','jSoUDmo3brrX','WRXwWPBcR1TBWOu','W73cHCkOBCkBlrJcTrBcTua','BmkQW4qc','W6ZdPCowW43cShZdS8k9mCo/WOxcVwSpDt5ZvCooi8k7wmkUvSoNWRVcLW','4P+wdEIgOoAEP+I9LEIHI+MbPowiG+s7KoMvUoISHKW','vgJcRSkyp8kOhmolgmkzuCoEWOObWRD/dCoQuNJcPmoCW7LSWPtcKHhcUYJdTCkhtgHfW73cQ8ouWQTqCSo0W7Tcy8kjW6brW5nefuzaeCkWWQVdJqmAse/dTrm9WOeeWOmvDSoViM0YCxJdOendF8oZWPXHsCouW4LWW4DrtIqvWP/dJGJcJY/cTwP1h8obWP0PW7ynlCkvehjpkSozoa7cKvhcJNZdUmkXWPtcJ8oWkMdcIX7cM0vQWO0fW5O','WRPta8k3','5y6t6ywe5BYh5zkR54Us5OgYkqBdS8oFWP56W5PJWQaZ','iEkCGW0','5lQe5lY+5Ogm5yIZ','qmkVWQ1AWRqJW556WPldPSouWQ/dNCoCe8k0W50iW4hcSmopW7b7E8o0WOTZt1hcVmk1zW','WRiOqSkaDG0CxCkQWRe','DwJcSW','W61LWOb0nmoEvG','W59tW4L5W7hcSh/dICkob8kIW4mpBmo9W5/cKv1DdCkEW67dH2KapMPM','5l+x55sZ5ysX6zsC5A+whSolCG','8kQBINW','rGOQfSkzWQze','WO9pbGhdPCkTca','W7jVWPunWRm','5yQ/6zUq5ywV6zER5AYOp0lcJa','WRLqWOdcPG','rMqiW4/cPCoqWRridSkzWQJcQri7','5P6J5Ags5ysp6lAB5y+y','pL97a8kZt8kArmobjKi','zGuL','z8o2qunzjW','ia4AW6KMWRvx','WOtcIcnPBWLoW7a9WPNcOSo+ecm1CwZdTvFcGJFdNXK6WQ1UWR3dIW','zmoYtCozf8oPW5KaWPZdVuRcTmk/D8o7','hWeNWRW','h8o4W78','WPxcPK0','W6LDW5BdOSoX','WQ7cPCoe','W616emorlLfp','WRHqWPBcVeb9WOtdQctcHrVcO8obCLvUzCowxCohWPL6WPZdPCo+sSkuuW','WPlcHY9RoMnoW5y0WOdcS8oLg0n8ygO','z8oZtG','sIWM','zGmVw8o1D8kFwW','W7xdPmkmW5zQWRtdP8kd','emoil8kyWPNdJ8o/5B2J5AwT44gY5lUq5lQP6lw35y2K','5yAZ5yUQ6zUh','W7zYW4elWQOwWOnlWR12','EINcHmoKvmopcuxcQSouFfG','WPPnaWxdKSkQ','CCoocmoNWR8','6lEE5yYP5Pwe5PA3','WRxcPGa','WRFWOPcmW7/OV4BOOyRNUkdMNObz'];_0x4012=function(){return _0x489749;};return _0x4012();}async function handleResponse(_0x849407,_0x43b0b2){const _0x22ade3=_0x397af4;try{switch(_0x849407){case _0x22ade3(0x171,'B5et'):_0x43b0b2[_0x22ade3(0x130,'ZAbn')]==='0'?($[_0x22ade3(0xf4,'Y3dg')]=_0x43b0b2[_0x22ade3(0x194,'f*61')]['useable']||[],$['totalNum']=parseInt(_0x43b0b2[_0x22ade3(0x19e,'YuO5')]['useable_count']||0x0)):console['log']('❌\x20查询优惠券列表失败\x20=>\x20'+(_0x43b0b2?.['errMsg']||JSON['stringify'](_0x43b0b2)));break;case _0x22ade3(0x10e,'C*cq'):_0x43b0b2['retcode']===0x0?($[_0x22ade3(0x18b,'eOTU')]=!![],console[_0x22ade3(0x173,'eOTU')]('删除上述优惠券成功\x20✅'),$[_0x22ade3(0x19b,'jHQ&')][_0x22ade3(0xdc,'2RzM')](_0x22ade3(0x125,'#YGX'))):(console[_0x22ade3(0x16f,'#YGX')]('删除上述优惠券失败\x20=>\x20'+(_0x43b0b2?.['errMsg']||JSON[_0x22ade3(0x1a3,'fAvK')](_0x43b0b2))),$[_0x22ade3(0x15e,'4cWL')]['insert']('删除优惠券失败'));break;}}catch(_0x3e37d9){console[_0x22ade3(0xe2,'r%De')](_0x22ade3(0x184,'r%De')+_0x849407+_0x22ade3(0x134,'C*cq')+(_0x3e37d9['message']||_0x3e37d9));}}async function sendRequest(_0x220930){const _0x452529=_0x397af4;if($[_0x452529(0x116,')H&K')]||$['outFlag'])return;let _0x2bc8e5='',_0x91f58d=null,_0x533ec7=null,_0x5df60c=_0x452529(0x17e,')H&K'),_0x3cef8a={},_0x142612={};switch(_0x220930){case _0x452529(0x169,'r%De'):_0x142612={'appId':_0x452529(0x13f,'l0#X'),'functionId':_0x452529(0x12b,'[Q[F'),'appid':_0x452529(0x149,')H&K'),'body':{'bizModelCode':'6','externalLoginType':0x8,'bizModeClientType':'M','appId':_0x452529(0x107,'pxHT'),'token':'3852b12f8c4d869b7ed3e2b3c68c9436','tenantCode':_0x452529(0x12d,'0@]c'),'sourceType':_0x452529(0xfc,'toC0'),'state':0x1,'wxadd':0x1,'filterswitch':0x1},'version':'4.7','ua':_0x452529(0x152,'f*61')},_0x3cef8a=await H5st[_0x452529(0x119,'Hx54')](_0x142612),_0x2bc8e5=_0x452529(0xea,'fzI%'),_0x533ec7=Object[_0x452529(0x13b,'09vb')]({},_0x3cef8a[_0x452529(0x11c,'vW9K')]);break;case _0x452529(0xe5,'b!Dd'):_0x2bc8e5=_0x452529(0x18f,'JX@5'),_0x533ec7={'appid':_0x452529(0x19c,'eOTU'),'functionId':'deleteCouponListApplet','body':JSON['stringify']({'bizModelCode':'6','externalLoginType':0x8,'bizModeClientType':'M','appId':'m91d27dbf599dff74','token':_0x452529(0x157,'Hx54'),'tenantCode':'jgm','sourceType':_0x452529(0x19d,'Y3dg'),'couponinfolist':$[_0x452529(0x18e,'eOTU')]}),'g_ty':'ajax'};break;default:console['log'](_0x452529(0x13e,'U0Vt')+_0x220930);return;}const _0x5c5fc4={'_':Date['now'](),'sceneval':0x2,'g_login_type':0x1,'callback':_0x452529(0xd6,')H&K'),'g_tk':0x7d97a518,'g_ty':'ls','appCode':_0x452529(0x179,'JX@5')};_0x91f58d&&Object['assign'](_0x91f58d,_0x5c5fc4);_0x533ec7&&Object[_0x452529(0x123,'toC0')](_0x533ec7,_0x5c5fc4);const _0x2133a5={'url':_0x2bc8e5,'method':_0x5df60c,'headers':{'Accept':[_0x452529(0x191,'r&U4'),'deleteCouponListApplet'][_0x452529(0x1ad,'q*5k')](_0x220930)?_0x452529(0x1ac,'toC0'):_0x452529(0x14a,'Edhn'),'Accept-Encoding':_0x452529(0x172,'r%De'),'Accept-Language':_0x452529(0xf6,'4cWL'),'Connection':_0x452529(0x145,'Edhn'),'Content-Type':_0x452529(0x1a4,'#YGX'),'Cookie':cookie,'Origin':_0x452529(0xda,'q*5k'),'Referer':_0x452529(0xfe,')H&K'),'Sec-Fetch-Dest':_0x452529(0xe6,'8M[L'),'Sec-Fetch-Mode':'cors','Sec-Fetch-Site':_0x452529(0x10f,'WZJ$'),'User-Agent':_0x452529(0x122,'@4m(')},'params':_0x533ec7,'data':_0x91f58d,'timeout':0x7530,'httpsTlsOptions':[_0x452529(0x15b,'pxHT')]['includes'](_0x220930)?common['useAppTls']():null};_0x5df60c===_0x452529(0x193,'Hx54')&&(delete _0x2133a5['data'],delete _0x2133a5[_0x452529(0xdb,'@4m(')]['Content-Type']);const _0x11efce=0x1;let _0x174d63=0x0,_0x2e0d36=null,_0x3eec01=![];while(_0x174d63<_0x11efce){_0x174d63>0x0&&await $[_0x452529(0x16b,'UY9H')](0x3e8);const _0xb6a60f=await common['request'](_0x2133a5);if(!_0xb6a60f['success']){_0x2e0d36=_0x452529(0x15d,'fAvK')+_0x220930+_0x452529(0x110,'zJ4d')+_0xb6a60f['error'],_0x174d63++;_0xb6a60f['status']&&_0xb6a60f[_0x452529(0x1a2,'Y3dg')]===0x193&&($[_0x452529(0x105,'[Q[F')]=!![]);continue;}if(!_0xb6a60f['data']){_0x2e0d36='🚫\x20'+_0x220930+_0x452529(0x13d,'l]sc'),_0x174d63++;continue;}await handleResponse(_0x220930,_0xb6a60f[_0x452529(0x14f,'C*cq')]),_0x3eec01=![];break;}_0x174d63>=_0x11efce&&(console['log'](_0x2e0d36),_0x3eec01&&($[_0x452529(0xe7,')H&K')]=!![],$['message']&&$['message'][_0x452529(0x10d,'WZJ$')](_0x2e0d36)));}
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) }