faker3/jd_opencard_0723.js
2024-07-23 16:32:44 +08:00

14 lines
34 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.

/*
环境变量:
export jd_opencard_draw="3" //抽奖次数 3
export jd_opencard_notify="true" // 是否推送
cron:1 1 1 1 *
*/
const $ = new Env('7.23-7.30 盛夏热浪 尽享特惠')
const _0x42e6a5=_0x88ed;(function(_0x1e26a2,_0x251008){const _0x58185e=_0x88ed,_0x1b959b=_0x1e26a2();while(!![]){try{const _0x276092=-parseInt(_0x58185e(0x29a,'JYjK'))/0x1*(-parseInt(_0x58185e(0x21f,'AGx9'))/0x2)+-parseInt(_0x58185e(0x2e7,'iLb0'))/0x3+-parseInt(_0x58185e(0x288,'Sf!a'))/0x4*(-parseInt(_0x58185e(0x2b4,'#ZVm'))/0x5)+-parseInt(_0x58185e(0x21b,'h0ne'))/0x6+-parseInt(_0x58185e(0x20f,'&Vld'))/0x7+-parseInt(_0x58185e(0x265,'EaUK'))/0x8+parseInt(_0x58185e(0x2ca,'TX6Y'))/0x9;if(_0x276092===_0x251008)break;else _0x1b959b['push'](_0x1b959b['shift']());}catch(_0x520b67){_0x1b959b['push'](_0x1b959b['shift']());}}}(_0x1033,0x29e90));function _0x1033(){const _0x4a8ddb=['WQDJWQv4W6zvtq','WRNdItG','W6ZcL8oSWP4OlWxdOSoXAtP9gCoBWO/dHZO','W4zigflcSuddM3FdT1a','cSk9W7C','W5L6y8kHvmkwoHW','WOrlW77dQsO3W5dcPa','cCkSxmk+','AGafha','vuNdV8kDdCoMvN8','WO0GtmoGWRKhWQSWW58dCIfJWOm+lq','zXiUhYZcGZJcRG','q3tdNmoaW4VdPWxcJhO','nLnctwNdKGJcR8kWn8kMWPa','5QYt5OQP5AEC','xKGUjmkZ','WRufFCoxWOWY','f8kZW67cVx8V','WR9fWRTiW6tdSG','wwhdOJzgWR4','W6ZdOfqQ','vSkGWOxdSJe','5P205Rs+6kEq5zE+5zo6','W6C7WRBdSa7dVSkPda','cghcJa','x3hdUCogdaNdVq','W7JdTfmJ','B0CGWOejCSk6WPldULpcNmkn','ptyvaG','b8kMs8kOWP4Aja','W7JcHCoQWPLgAGddQCoBBcH9','qsbzWQi','WPpcVSkrrmomgq','cSk5W7tcOgO7W7C','W5yYg8koA8k6vslcQG','W5KSdI7dQ0GAWQHB','C8kLW740F8kjj8kjdw5gWOm','ASkIW7m','W6SHWOhdTHZdVSkYhq0','uSkXWOpdTdu/','W7VcMmo2WOy','W5CVfmk5ymkl','5P2a55YM5AwU5zcA77+L','zmodwXlcSq','xNVdRq','vKa0W6m','WRLfWR4','hSkIs8kW','BCk0W5iSwCkj','8jAUVgFMG6BLLiROJk7LV4xLRj7NIytdVowNS+wsSUwsNUEKM+++Ha','W5bcWOjxW4D0WQO','W4eNi3VdHmoE','qLqZW6O','rhxdPSkh','5A2F5Psz5yMU5yM05BwX5RIt','rmkZWP7dQq','WRWnuZq','8jY4R8o9','W5jyhG','WPGPFCkTwCkr','r2/dQW','W5fwWPT0','f8kUW67cQw4','aJdcNG','W73dTLmRWRjEiwa','oX98W6Xsj8k7','WPBdSmkZW5S','WOpdSSk0W5NdReFcOmoJ','wCoFBXxcRCo1WPnS','5A2h5PAo5P2t5RsM6kAe5zEe5zks','vLy6jmkLW4lcUmolW7tcPmkjW6JcUW','W5GTpLBdOSovW59plW','v8orgeu','WP/cTmkl','x8k9WPa','W6FcGSoI','xSorfu7dLgi','W5dcOCoW','WOe9tJq+W6JdKmoufCoukSkP','5yQr5ysW5BQ96zcW5l6Z5zkQ5OM45yI7','B2Kax8ku','5B+D5y2mgUI9NoMCMEw/Gq','W5ryeaC','oSkiWOZcTmkOWQXN','5Bwm57U45yUq5yUY6l6l5lIe5zkmW5m','WPCScJ7dRcKoWQTxdq3dQt5Hg8o1WR3cTreolq','WO0Tz8kCrmkqaY/cKWOymMbgWR4','y8oHWQ5TFmonWPS','WRCsAmkxhIW','a8k9W7pcSG','W4CNlq','W5fLggy','vKu+kmk9W4m','W4K1hq','W7JcMmoMWO1HFbi','FwxdVgHLxG','W4OQh8ksBCkouI/cKxxdTa3dVq','qg/dH8ohW5hdS14','5A2G5PAi5yUM5yM25BwJ6lYn5yII6zU25yIO','5zoB6z2i55MD5y+Y6yg45l6y5yQG5yI1hCkjzmot','WPbirCo3EmkMqq','W4/dJSkJWORdUW','wCk9WP7dSWO+','fWZcU8obgSo6WR7dOJ1nW7tcHSkKWQnzfSoJefJdRSoTW4j1CmkgEcpdSCkOWPpcL8ozW4CuBbVdQ8oLg8o1AaH0rWddKCocWQddKXyaW4Pljmo3gSo0agD7WQhcNd1zCtHX','5P635BQG6zkd5B2P5yYT5AAZ6lw2WOhOTj3OVkZMI47OOzJdLq','lK8VyCkyj8k0','WPK9CmkQu8kpia','hHVcU8oyh8kLW4FcGG','WOVdOSkFW5ldQeFcImoS','W7uSWRddSbBdVmkjdHO','FNFdPq','uNZcPG','WRXeWRPPW7ddPMZdNq','W5SNi3VdUCojWOC','cmkQvSk/WRWCm8kqCunCW7G','wMhcOmoWfCoeWRz5Aq','gSkSuCk1WOSoCG','DmkOW6i3','xNhdPmosgqy','y8kIW6hcG8kBaCk9wW','CSk4W78gu8ki','5P2/55YD5yMa5yMb6lYP5zIa56ck','W44/a8kp','WQTlCCkXgG','WOaHrW','W43OR4/MS6pLKyBLU4XY','AHmqcHVcLcVcQSkU','5AYk5OMi5lI55yI4iW','W59Lh20','W6dcImo8','oZixhfBdTSo6','dMhcGSk8WOfgl8kxmY59WPmYCW','AwVdOwC','WQSlDa','F2/dPZDh','xCojqWtcVSo3WPC','eXFcQa','WO4Tz8kOx8kqia','W5fRaMi','5P6F5BYk5AA9','aCkAcuddP8kLW4vmWQGUW73cJCof','WOaNESkNF8ky','WR4kx8kz','WPONESkNqSkpyq','BCkOW6iWxmkliW','h8oBvrxcVmk/WODPWOOTW4pcO8orW4lcR8oYW5ddPgS6W4tdOmoX','WQXVWRHIW7rAzHddJW','W4FdG8kZWOBdTCkxW5fxigGR','wZPdWQtdOmkw','r0KJl8k/W5xdIq','lqr7W5TEoCkT','WRCEoSkzW7JdN2hcIuZcOHH6W4nqW7lcRq0QumoN','WR3dJt3cKbBdUNFcTI3dIbRdGW','WRPPWR9LW7nbgG','W7KXW5G2bSkUWQ3dHa','emk9W67cPW','W7ntk8keW5nTWRWrW58KBsC','D34fvCkIo8kpemkJW4u','WRSix8krdcZcKSk8','WOyNDa','WR0mpSoqWO0','xg/dIq','vtrEWQS','WQKNFCk9u8ksj2pcTrifmG','hHVcU8oyh8kL','fmk0W6BcOw4','zmoJEZlcKEImP+wmPowKTUI3HJW','ySk7W6FcHSkaeSk8','8lImNaFMGk/LLzJOJOZLV6dLRRhNIO44W63LPP7LKzZLKQlNP4BVVQa','mCkzWPdcL8kCWQy','WRqrCmoqWOySWOe','W5G8ohZdO8oDW51amW','FN3dRmkwamoo','yu3dU8kDj8ojwNFdOG','5PYE552B5AsQ5zoH776h','nmkBWP3cS8klWRS','obHG','5OId5AwH5Q2y5PszDSkIca','W6JcGSoRWOHTAa','osivaq','ywZdSmkygSobFM7dKa','5lQ6W6hNPB7LIyxLJ5lMIzhLPjddNq','B3qz','eWr+WRlcOmkUASo2t8k7W58BW7S','WRldNSktW6q','eX5IW5fxjSk/W4RcGHNdVmoyrH/cV8kuwH1NW4tcR3BcTSozv8o/WO4vg8oQWPNcRHZcT8oKf8o7WOJcU8kIW6BcQbHHW59vW79ba8k/utddKSobW4/cIN0BWQ7dU8kSW67cI8o0WRhdNCoXWOBdOSk2u8kBCqzRWOjhWPtdISkCWQFdSSo1W7FcVSozWQXFWQ4JWRj5gJeUW65aW7C6cColnCkxWO5WW53dGsq3jbmncmoufmo7zXhdL8kUc3eUWQnMW7vmsZddS8o3W7/dP8ooW5fGW6RcUaP6WPhdUSoeqmkAB8odBmkXWQxcVN3dNJRdRSkG','WRrmDW','xtPn','W6S5WRi','WOhdVSkKW5u','W5nJgNDRWQG','WPzitW','W5aVgYZdVdXuW6PngbVdNZTQwmkOWQ3dSXKppMtdUmkfW7JdU8oLWQncwXC','vLm+kCkKW5tcUmolW77cTq','WRebFCoxWOyTWRSb','WOhcTCkex8oFktGGaa','WO1Fx8o+Fa','vCk7WO8','vCoDceNdQ2m','z8kKW6VcHSkCba','WQVORi7MSyRLPPxOTiVdQUkEQmoB5PAc5zg15BU75PEr5O+s','5QYSaowiVowkNEEGKo+8T14','WQ5NWQjQ','vKu+kmk9W4pcSSoa','WOCTymk6v8kBnG','WPO6ESkZuW','W4FdG8kZWOBdTCkx','W7VcJhVdJa','W6/cMhZdHq','bmkUW7C0n8kaW5tLVjFLPlVJGiJKUj7KUQZOTORLJlK','W41dgbS4W5y6W4dcIW','W5nscHOTW6u2','q2JdJ8oBW4a','5yYa6yES54QM5Ooc57QS5P6GktFcTrGm','WPPiqSohDSkUt8kSrfa9nc95','r8okhvldQviHc8oV','ACkJW7iVsmkii8ku','5RwL5yUz5BEQ57MR5P2Kna','WPFdOSkLW4ldJg0','WP5mW5pdOJy1W5JcQCkc','WO/dTmkZW4pdU0xcJa','5lQR5A+45z+V','W5BdKSkUWPxdPG','W5yUcmkvymkiss3cTW','W5bwfaW','xxNdRCogW4hdPt7cN20','agmsW7pcM8okdmotcLvkhG','5P2a5yAR6yoq5B+B5y6E','5Rs15yUj5zg856An772eW4u','6Agt5y+85B+z5y2K5OQt5yIR5yQs5AE45yQmWP56','W4HwWP9L','wtpdLSoVW68','WRHZWRHoW6Lw','cwVcMmkHWRnjjq','qMBdO8opca','yrCudWRcJZtcOa','5lI76Agp5y2y5PAF6i+05y2r5Ask6ls/776l6k6E6yEw5PAU6l6v6kor','daZcVCoyb8kNW7JcQZC','WQnpWRDHW6ddSeddIG','W5bKeLDNWRFdUW','W59um1xcQ1C','5B2N5Asx5PwX6zsN77Yr','WO5xtSo9BmkVcCk3qIG1kYX2WOFdGgenWRWWj0BcUG','thlcR8oJp8oB','vvldPCkBq8oQWPS','xCoqd0xdR3i','qMhdUCoD','q8oyqH7cSCo3WPTHWPO','ywxdSG','r1qJo8kU','FbqFoddcGG','W7ONW5mGl8kZWOpdICoE','W45mo0NcU2RdUxVdOa','WODxW4pdHJKI','hIjpWQJdISoDhCoklL50jhWQcSkeW5ZcJZu','WQ9OWQa','wf49','W41wWPH1W4r4','WOpdSSk0W5NdReC','W55uWOj4W51W','W4O+hINdQNup','lcKztCktjCkhnG','iryuhZ3dItxcQSk7lCkSW7TudCoAgCo3W7FcLCkSWO4','Aw/dOwD4qq0','WOHEu8o2t8ko','s3qcqmkFpa','W5jVaLn8WRxdPSozcmoygSkuWR0a','44of5O+656EJ44cu6k2Y5yEk6i6+5y24FSolnCkyW6VcJG','WOfDW4/dRcW6','rMxdGmonW4ddSIxcJG','db3cOCovj8k1W7W','Bw4hymkFkW','z8kKW6dcRSk6eSk9','8jcUMSoH','WO8WESk9','ucjlWRJdJCkMeCouiG','WO7dVSkN','m8krWPe','WQKVWQFdUXVcTmkvbGRcOSoaWRWVAuWHqbBcLHRdVxa','mCkzW5Chvmkeha','C3VdTSkyaSodxMW','WOhcSSkisa','vmonrby','W4GPpNBdPq','eSkVW6lcOv0t','W4DRggDHWRC','W4/dJSk0WORdSCkg','WR1NWR9/','W7vEka','W40OcI7dG2KCWQXq','p8kWxCkPWReClmkr','W6W0bdNdOxu','F2hdSCkzfCouCG','W7Hso8keW6FdLG','W6hcICoAWOf0AG/dPmo2DZ9wgmkfW47dKG','rxxdO8ob','yreueWVcLdu','wCocuXVcQSo0WPD0','bw3cN8k7WQrl','re4Rm8kUW7pcJSonW74','gXNcU8oq','hmkMvSk/WPOpcmkq','b2hcJ8k3','hbFcOCoxamkN','W5PzWPjfW4j4WQG','vSoTWRFcKeW0W4BdKvG','tuJdVW','WOyfsLL7WRycW4FcGSkyW41q','WPXoqSoTB8kK','W7uWWQ3dQthdVW','BhRdPwP4tH9mvbBcOSoPxmkYnCkrjSoEW5DYWO3cIrxdJCkMeq9iCt/dH8kuAW','W5lMJRhOOzZLV4pLPkNMLiNPL6dVVja','fmkPW6tcSg4VW6e','5y2b6yE+5B2p5zoc54IN5OkYl8kBi8o6rW','gCk3wCkPWOSPkmkzxq','WQxdLMldGg3cPvVcKaVdNq','mghcGmk3WRXD','W5pdK8kIWP3dJ8kDW6jxoG','WQzFWRPMW6ddSxO','lI1qeSojESozl8kDW5RcKCojeG','WQ1ny8kMc8k8E2xdO0Xu','cmocW4K','bSkSxW','WOpdSSk0W5NdReFcVCoUh8oNjq','8l67S8oI','ENunCCkyiSkl','hUIVPoAYG+wMTUI1TCkw4P2ynG','W60skCo6sCoilhZdQK5lW6nS','WP/cPmkwrCoBdIG','WRLpWRDIW7hdQG','zfVdRSko','jtGb','W4GPhq','eGhcJmoEdCkLW4pcUca','yCoYWRHSsCodWPnY','WQyhz8oAWPu2WOyCW4qUua','r2/dUczmWQhcQa','WP7cSSkc','yG4w','whVdO8oBjaO','uSkXWOpdTdu/WPvS','v8o+bCoMW4i','W5S7W503dCkV'];_0x1033=function(){return _0x4a8ddb;};return _0x1033();}const notify=require('./utils/Rebels_sendJDNotify'),jdCookie=require(_0x42e6a5(0x2be,'h0ne')),getToken=require(_0x42e6a5(0x21a,'8X0U')),common=require('./utils/Rebels_jdCommon'),isNotify=process[_0x42e6a5(0x282,'jkE)')][_0x42e6a5(0x2e4,'AGx9')]==='true',opencard_draw=process['env'][_0x42e6a5(0x2a9,'FS(I')]||0x3;let domains=_0x42e6a5(0x243,'iXLV'),cookie='';const cookiesArr=Object[_0x42e6a5(0x1fd,'vd[#')](jdCookie)[_0x42e6a5(0x23f,'rc#q')](_0x2c65eb=>jdCookie[_0x2c65eb])[_0x42e6a5(0x241,'4zh4')](_0x30b831=>_0x30b831);!cookiesArr[0x0]&&($[_0x42e6a5(0x2cf,'vd[#')]($['name'],_0x42e6a5(0x28e,'MUd*')),process[_0x42e6a5(0x295,'^QQK')](0x1));!(async()=>{const _0x483e75=_0x42e6a5;console['log'](_0x483e75(0x2d8,'2gdT')+$[_0x483e75(0x317,'rOxA')]+_0x483e75(0x2bc,'8X0U')),console[_0x483e75(0x224,'xzR^')]('代理开关:\x20['+common[_0x483e75(0x28d,'4zh4')]()+']'),console[_0x483e75(0x316,'Qn^B')](_0x483e75(0x234,'g38R')+opencard_draw+'次]'),console[_0x483e75(0x222,'^QQK')]('通知推送:\x20['+(isNotify?'开启':'关闭')+']'),console[_0x483e75(0x324,'qIy9')](_0x483e75(0x26a,'GLda')+$[_0x483e75(0x263,'g38R')]+_0x483e75(0x258,'TX6Y')),authorCodeList=await getAuthorCodeList('http://code.257999.xyz/szxyun1.json'),$[_0x483e75(0x2d0,'3I5t')]=![];if(authorCodeList)$[_0x483e75(0x300,'rc#q')]=!![],$['authorCode']=authorCodeList[random(0x0,authorCodeList['length'])];else{}$[_0x483e75(0x2b8,'rc#q')]='1000100710',$['activeId']='unionOpenSXRL240723dDry3JVj',$[_0x483e75(0x2d2,'AGx9')]=_0x483e75(0x341,'3I5t'),$[_0x483e75(0x2fc,'vd[#')]=$[_0x483e75(0x244,'kmUm')],notify[_0x483e75(0x235,'FS(I')]({'title':$['name']});for(let _0x129b1d=0x0;_0x129b1d<cookiesArr[_0x483e75(0x22f,'O3^p')];_0x129b1d++){$['index']=_0x129b1d+0x1,cookie=cookiesArr[_0x129b1d],common[_0x483e75(0x321,'!jp^')](cookie),$['UserName']=decodeURIComponent(common[_0x483e75(0x259,'RQtx')](cookie,'pt_pin')),$['UA']=common['genUA']($[_0x483e75(0x2e3,'Q*L)')]),$[_0x483e75(0x26c,'GLda')]=notify['create']($[_0x483e75(0x33f,'cU0L')],$[_0x483e75(0x2a5,'2gdT')]),$['nickName']='',console[_0x483e75(0x2f2,'GLda')](_0x483e75(0x254,'7lqs')+$[_0x483e75(0x2e9,'kmUm')]+'】'+($[_0x483e75(0x1fa,'LQzO')]||$['UserName'])+_0x483e75(0x277,'3I5t')),await Main(),common[_0x483e75(0x2c3,'TX6Y')]();if($[_0x483e75(0x292,'Sf!a')])break;await $[_0x483e75(0x21e,'#ZVm')](parseInt(Math[_0x483e75(0x2a0,'4zh4')]()*0x5dc+0x7d0,0xa));}isNotify&&notify['getMessage']()&&(notify[_0x483e75(0x320,'kmUm')]('\x0a'),await notify['push']());})()[_0x42e6a5(0x29e,'!jp^')](_0x16ee2a=>$['logErr'](_0x16ee2a))['finally'](()=>$[_0x42e6a5(0x335,'4zh4')]());async function Main(){const _0x19c665=_0x42e6a5;try{$[_0x19c665(0x31b,')ECL')]=0x0,$[_0x19c665(0x2e5,'iLb0')]=![],$['Token']='',$[_0x19c665(0x28c,'Sf!a')]='',$[_0x19c665(0x209,'Qn^B')]=await getToken(cookie,domains);if($['Token']==''){console['log']('缺少必要参数,请重新运行'),$['message'][_0x19c665(0x298,'#C%L')](_0x19c665(0x229,'&Vld'));return;}await $[_0x19c665(0x311,'qIy9')](parseInt(Math[_0x19c665(0x276,'fZ74')]()*0x1f4+0x1f4,0xa)),await sendRequest(_0x19c665(0x2c0,'cU0L'));if($[_0x19c665(0x2d9,'7&bG')]){$[_0x19c665(0x2ad,'GLda')]='',await sendRequest(_0x19c665(0x286,'rOxA'));if($[_0x19c665(0x27d,'iLb0')])return;if($[_0x19c665(0x232,'#C%L')]){$['index']===0x1&&(console['log'](''+($['activeTitle']&&_0x19c665(0x267,'iLb0')+$['activeTitle'])),console['log'](_0x19c665(0x274,'#ZVm')+$[_0x19c665(0x2bd,'2gdT')]+'\x0a结束时间'+$[_0x19c665(0x272,'4zh4')]+_0x19c665(0x2ba,'TX6Y')+$[_0x19c665(0x2d1,'7lqs')]+'\x0a'));console[_0x19c665(0x297,'E*7Q')]('当前已邀请:'+$[_0x19c665(0x273,'f)zN')]+_0x19c665(0x238,'JYjK')+$[_0x19c665(0x212,'^QQK')]+_0x19c665(0x24c,'KpW0')+$[_0x19c665(0x24a,'LQzO')]);for(let _0x227f8f in $[_0x19c665(0x285,'E*7Q')][_0x19c665(0x280,')Z9U')]){let _0x18e073=$['active'][_0x19c665(0x2ec,'MUd*')][_0x227f8f];_0x18e073['details']=_0x18e073[_0x19c665(0x20c,'^QQK')]['filter'](_0x1f8e50=>_0x1f8e50['done']===null);let _0x5ed317=_0x18e073[_0x19c665(0x22c,'#C%L')]||0x1,_0x1bfe51=_0x18e073[_0x19c665(0x215,'jkE)')]||0x0;for(let _0x467ea8=_0x1bfe51;_0x467ea8<_0x5ed317;_0x467ea8++){$[_0x19c665(0x242,'RQtx')]=_0x227f8f,$[_0x19c665(0x31c,'E*7Q')]=_0x18e073,await sendRequest(_0x19c665(0x2ff,'JYjK'));}}$['opencard_list']=$[_0x19c665(0x2b7,'RQtx')][_0x19c665(0x1f5,'2gdT')]||[];let _0x12d3e8=$[_0x19c665(0x33a,'vd[#')]['filter'](_0x4ca218=>!_0x4ca218[_0x19c665(0x2dd,'f)zN')])||[];console[_0x19c665(0x1f1,'O3^p')]('共有'+$['opencard_list']['length']+_0x19c665(0x32b,'RQtx')+_0x12d3e8[_0x19c665(0x28f,')Z9U')]+'张卡');for(let _0x125cc0 of _0x12d3e8){$[_0x19c665(0x22a,'LQzO')]=_0x125cc0[_0x19c665(0x32d,'#C%L')],$[_0x19c665(0x2b0,'2gdT')]=common[_0x19c665(0x330,'^QQK')]($[_0x19c665(0x2ab,'iLb0')],_0x19c665(0x21d,'7&bG'));(!$['openUrl']||!/^\d+$/[_0x19c665(0x1f8,'JYjK')]($[_0x19c665(0x271,'MUd*')]))&&($[_0x19c665(0x290,'xzR^')]=_0x125cc0[_0x19c665(0x30f,'oI#u')]);const _0x6a454=await common[_0x19c665(0x206,'GLda')]($[_0x19c665(0x245,'AGx9')]);if(_0x6a454)console[_0x19c665(0x325,'FS(I')](_0x19c665(0x329,'EaUK')),await $[_0x19c665(0x312,'E[Rh')](parseInt(Math['random']()*0x3e8+0x3e8,0xa));else{console['log'](_0x19c665(0x342,'g38R'));break;}}if(opencard_draw){await sendRequest(_0x19c665(0x249,'RTPI')),await $[_0x19c665(0x2a2,'jkE)')](parseInt(Math[_0x19c665(0x2ed,'Qn^B')]()*0x1f4+0x1f4,0xa));let _0x8b80c2=parseInt($[_0x19c665(0x218,'kmUm')]/0x1),_0x2a9545=Math[_0x19c665(0x323,'kfD$')](opencard_draw,_0x8b80c2);$['prize']=[],console[_0x19c665(0x2d5,'iLb0')]('已设置抽奖'+opencard_draw+'次,共有'+_0x8b80c2+'次抽奖,可抽奖'+_0x2a9545+'次');for(m=0x1;_0x2a9545--;m++){await sendRequest('lottery');if(Number(_0x2a9545)<=0x0)break;if($[_0x19c665(0x1ef,'E*7Q')])break;await $[_0x19c665(0x269,'rOxA')](parseInt(Math[_0x19c665(0x315,'^QQK')]()*0x3e8+0x3e8,0xa));}$[_0x19c665(0x32a,'Sf!a')][_0x19c665(0x2cc,'MUd*')]&&console[_0x19c665(0x208,'AGx9')]('抽奖获得:\x20'+$[_0x19c665(0x250,'^QQK')][_0x19c665(0x32c,'g38R')](',\x20')+'\x0a');}if($[_0x19c665(0x31e,'&Vld')]||$[_0x19c665(0x1fb,'JYjK')])return;await sendRequest(_0x19c665(0x257,'xzR^'));if($[_0x19c665(0x264,'xzR^')])for(let _0x96a14e=0x0;_0x96a14e<authorCodeList['length'];_0x96a14e++){$[_0x19c665(0x332,'u63%')]=authorCodeList[_0x96a14e],await sendRequest(_0x19c665(0x2cb,'kfD$')),await $['wait'](parseInt(Math[_0x19c665(0x284,'rOxA')]()*0x190+0x190,0xa));}$['index']==0x1&&($['shareUuid']=$[_0x19c665(0x30d,'!jp^')],console[_0x19c665(0x20b,'3I5t')](_0x19c665(0x33d,'MUd*')+$[_0x19c665(0x2ae,'kmUm')])),await $['wait'](parseInt(Math[_0x19c665(0x284,'rOxA')]()*0x3e8+0x3e8,0xa));}else console[_0x19c665(0x325,'FS(I')](_0x19c665(0x26f,'Q*L)'));}}catch(_0x1a5d67){console[_0x19c665(0x2d4,'kfD$')](_0x1a5d67[_0x19c665(0x2f7,'2gdT')]);}}async function handleResponse(_0x48eeb9,_0x193cc8){const _0x43aebf=_0x42e6a5;try{switch(_0x48eeb9){case _0x43aebf(0x27e,'7&bG'):if(_0x193cc8[_0x43aebf(0x240,'E*7Q')]==='200'&&_0x193cc8['success']===!![])$[_0x43aebf(0x2bf,'GLda')]=_0x193cc8['data'];else _0x193cc8['message']?console[_0x43aebf(0x2c5,'2gdT')](''+(_0x193cc8[_0x43aebf(0x24f,'^QQK')]||'')):console[_0x43aebf(0x306,'oI#u')](''+_0x193cc8);break;case _0x43aebf(0x2fa,'kfD$'):if(_0x193cc8[_0x43aebf(0x2e1,'2gdT')]===_0x43aebf(0x319,'xzR^')&&_0x193cc8[_0x43aebf(0x219,')ECL')]===!![])$['active']=_0x193cc8['data'],$[_0x43aebf(0x216,'cU0L')]=$[_0x43aebf(0x2b7,'RQtx')][_0x43aebf(0x221,'u63%')][_0x43aebf(0x2c6,'E*7Q')],$[_0x43aebf(0x255,'g38R')]=$['active'][_0x43aebf(0x31a,'0e3B')][_0x43aebf(0x25a,'RTPI')],$[_0x43aebf(0x2b3,'rOxA')]=$[_0x43aebf(0x2b7,'RQtx')][_0x43aebf(0x2d7,'qIy9')][_0x43aebf(0x2c8,'Sf!a')],$['overTime']=$[_0x43aebf(0x336,'kmUm')][_0x43aebf(0x1ee,'3I5t')][_0x43aebf(0x26e,'iLb0')],$[_0x43aebf(0x326,'RTPI')]=$[_0x43aebf(0x251,'cU0L')][_0x43aebf(0x28b,'RQtx')][_0x43aebf(0x217,'EaUK')]||'',$[_0x43aebf(0x21c,'jkE)')]=$[_0x43aebf(0x227,'3I5t')][_0x43aebf(0x25d,'E*7Q')][_0x43aebf(0x33b,'xzR^')]||0x0,$[_0x43aebf(0x339,'KpW0')]=$['active']['userVO'][_0x43aebf(0x2eb,'#ZVm')]||0x0,$[_0x43aebf(0x1f4,'!jp^')]=$[_0x43aebf(0x2a8,'8X0U')][_0x43aebf(0x29f,'#ZVm')][_0x43aebf(0x1f7,'2gdT')]||0x0,$[_0x43aebf(0x249,'RTPI')][_0x43aebf(0x2f8,'FS(I')][_0x43aebf(0x1f9,'oI#u')]>0x0&&console['log'](_0x43aebf(0x268,'MUd*')+$[_0x43aebf(0x336,'kmUm')][_0x43aebf(0x2fe,'JYjK')][_0x43aebf(0x2de,'#ZVm')](_0x32ef13=>(_0x32ef13[_0x43aebf(0x291,'3I5t')]||0x0)+'京豆')['join'](',\x20'));else _0x193cc8[_0x43aebf(0x2f3,'oI#u')]?($['drawError']=_0x193cc8[_0x43aebf(0x2da,'jkE)')],console[_0x43aebf(0x2a3,'8X0U')](''+($[_0x43aebf(0x1f6,'fZ74')]||'')),[_0x43aebf(0x20e,'4zh4'),'结束',_0x43aebf(0x260,'cU0L'),'不在'][_0x43aebf(0x29c,'kfD$')](_0x412eed=>$[_0x43aebf(0x201,'iLb0')][_0x43aebf(0x1f3,'MUd*')](_0x412eed))&&($['runEnd']=!![],$[_0x43aebf(0x2da,'jkE)')][_0x43aebf(0x233,')ECL')](_0x43aebf(0x25c,')ECL')))):console[_0x43aebf(0x2f2,'GLda')]('❓'+_0x48eeb9+'\x20'+JSON['stringify'](_0x193cc8));break;case _0x43aebf(0x2ff,'JYjK'):if(_0x193cc8['code']==='200'&&_0x193cc8[_0x43aebf(0x22d,'AGx9')]===!![]){let {val:val='',awardName:awardName=''}=_0x193cc8[_0x43aebf(0x253,'h0ne')],_0x5e2a93=[];if(awardName)_0x5e2a93[_0x43aebf(0x307,'US!l')](awardName);if(val)_0x5e2a93[_0x43aebf(0x2f9,'EaUK')](val+_0x43aebf(0x2e8,'oI#u'));console['log'](_0x43aebf(0x202,'rc#q')+$[_0x43aebf(0x204,'FS(I')]+_0x43aebf(0x2c4,'#C%L')+_0x5e2a93[_0x43aebf(0x203,'4zh4')](','));}else _0x193cc8['message']?console[_0x43aebf(0x334,'!jp^')](''+(_0x193cc8[_0x43aebf(0x331,'7lqs')]||'')):console[_0x43aebf(0x2ce,'*ArY')]('❓'+_0x48eeb9+'\x20'+JSON[_0x43aebf(0x25e,')Z9U')](_0x193cc8));break;case'lottery':if(_0x193cc8[_0x43aebf(0x2b1,'GLda')]===_0x43aebf(0x327,'E*7Q')&&_0x193cc8[_0x43aebf(0x1ed,'^QQK')]===!![]){if(_0x193cc8[_0x43aebf(0x2f4,'0e3B')]!=null)switch(_0x193cc8[_0x43aebf(0x2e2,'iLb0')][_0x43aebf(0x296,'EaUK')]){case 0x0:$[_0x43aebf(0x247,'RQtx')][_0x43aebf(0x302,'FS(I')](_0x43aebf(0x231,'RTPI')+_0x193cc8[_0x43aebf(0x333,'#ZVm')]['awardName']);break;case 0x1:$[_0x43aebf(0x26d,'oI#u')][_0x43aebf(0x302,'FS(I')](_0x43aebf(0x294,'fZ74')+_0x193cc8[_0x43aebf(0x30e,'US!l')]['awardName']+'\x20🐶'),$[_0x43aebf(0x20a,'&Vld')][_0x43aebf(0x278,'RTPI')](_0x193cc8[_0x43aebf(0x20d,'4zh4')][_0x43aebf(0x230,'Q*L)')]+'🐶');break;case 0x2:$['prize']['push']('🗑️\x20优惠券');break;case 0x3:$[_0x43aebf(0x261,'cU0L')][_0x43aebf(0x252,'h0ne')](_0x43aebf(0x30b,'US!l')+_0x193cc8['data'][_0x43aebf(0x27f,'f)zN')]),$[_0x43aebf(0x2f3,'oI#u')][_0x43aebf(0x2a1,'cU0L')](_0x43aebf(0x22b,'0e3B')+_0x193cc8[_0x43aebf(0x211,'u63%')][_0x43aebf(0x2fd,'iXLV')]);break;default:$[_0x43aebf(0x261,'cU0L')][_0x43aebf(0x2ee,'0e3B')](_0x43aebf(0x304,'2gdT')+_0x193cc8[_0x43aebf(0x20d,'4zh4')]['awardName']+'-'+_0x193cc8[_0x43aebf(0x2af,'3I5t')]['awardType']);break;}else $[_0x43aebf(0x318,'#ZVm')][_0x43aebf(0x236,'*ArY')]('💨\x20空气');}else _0x193cc8[_0x43aebf(0x26c,'GLda')]?($[_0x43aebf(0x27c,'kmUm')][_0x43aebf(0x279,'oI#u')](''+(_0x193cc8[_0x43aebf(0x256,'g38R')]||'')),['开卡']['some'](_0x2e3c22=>_0x193cc8[_0x43aebf(0x25f,'E*7Q')][_0x43aebf(0x2ac,'&Vld')](_0x2e3c22))&&($[_0x43aebf(0x2e0,')Z9U')]=!![]),['结束']['some'](_0x5316fe=>_0x193cc8[_0x43aebf(0x25f,'E*7Q')][_0x43aebf(0x25b,'JYjK')](_0x5316fe))&&($[_0x43aebf(0x303,'vd[#')]=!![])):console[_0x43aebf(0x337,'vd[#')]('❓'+_0x48eeb9+'\x20'+JSON[_0x43aebf(0x270,'3I5t')](_0x193cc8));break;case _0x43aebf(0x228,'#ZVm'):if(_0x193cc8['code']===_0x43aebf(0x2b5,'3I5t')&&_0x193cc8[_0x43aebf(0x338,'FS(I')]===!![]){let _0x3fce81=_0x193cc8[_0x43aebf(0x207,'KpW0')][_0x43aebf(0x220,'Sf!a')]||0x0;switch(_0x3fce81){case'':case undefined:case 0x0:break;case 0x1:console[_0x43aebf(0x324,'qIy9')]('✅\x20助力成功');break;case 0x2:console[_0x43aebf(0x1f2,'fZ74')](_0x43aebf(0x32e,'g38R'));break;case 0x3:case 0xc:console['log']('没有助力次数了~');break;case 0x4:console['log'](_0x43aebf(0x33c,'8X0U'));break;case 0x5:console['log'](_0x43aebf(0x310,'cU0L'));break;case 0x7:console[_0x43aebf(0x23d,'TX6Y')](_0x43aebf(0x266,'2gdT'));break;case 0x24:console[_0x43aebf(0x314,'g38R')](_0x43aebf(0x2f0,')ECL'));break;case 0x25:console[_0x43aebf(0x23e,'EaUK')](_0x43aebf(0x31f,'g38R'));break;default:console[_0x43aebf(0x20b,'3I5t')](_0x43aebf(0x1fc,'#C%L'));break;}}else _0x193cc8[_0x43aebf(0x213,'JYjK')]?console[_0x43aebf(0x2ce,'*ArY')](''+(_0x193cc8['message']||'')):console[_0x43aebf(0x27b,'KpW0')]('❓'+_0x48eeb9+'\x20'+JSON[_0x43aebf(0x237,'O3^p')](_0x193cc8));break;case _0x43aebf(0x2a7,'O3^p'):if(_0x193cc8[_0x43aebf(0x322,'RTPI')]===_0x43aebf(0x2db,'h0ne')&&_0x193cc8[_0x43aebf(0x2bb,'#ZVm')]===!![]){}else{if(_0x193cc8[_0x43aebf(0x33e,'RQtx')]){}else{}}break;}}catch(_0x56caef){console[_0x43aebf(0x2d4,'kfD$')]('❌\x20未能正确处理\x20'+_0x48eeb9+_0x43aebf(0x200,')Z9U')+(_0x56caef[_0x43aebf(0x2fb,'#ZVm')]||_0x56caef));}}async function sendRequest(_0x31ccc3){const _0x254a00=_0x42e6a5;if($[_0x254a00(0x26b,'jkE)')])return;let _0x2c9550='',_0x72aab2=null,_0x22b9d=null,_0x5ba128=_0x254a00(0x23b,'E*7Q'),_0x2d8b0d={},_0x5b5205={};switch(_0x31ccc3){case _0x254a00(0x2a4,'iXLV'):_0x5b5205={'shopId':$['shopId'],'token':$[_0x254a00(0x305,'&Vld')],'source':'01'},_0x2c9550=domains+_0x254a00(0x289,'iLb0'),_0x72aab2=JSON[_0x254a00(0x262,'vd[#')](_0x5b5205);break;case _0x254a00(0x301,'qIy9'):_0x5b5205={'activeId':$[_0x254a00(0x2f1,'rc#q')],'shareId':$[_0x254a00(0x246,'kfD$')]||null},_0x2c9550=domains+_0x254a00(0x299,'rc#q'),_0x72aab2=JSON[_0x254a00(0x27a,'&Vld')](_0x5b5205);break;case'job':_0x5b5205={'activeId':$[_0x254a00(0x29b,'O3^p')],'jobForm':$[_0x254a00(0x309,'2gdT')][_0x254a00(0x293,'LQzO')],'jobDetail':$[_0x254a00(0x2f6,'*ArY')][_0x254a00(0x28a,'KpW0')][_0x254a00(0x239,'Sf!a')]()[_0x254a00(0x2b2,'3I5t')]||0x1,'joinId':$[_0x254a00(0x340,'qIy9')]},_0x2c9550=domains+_0x254a00(0x281,'EaUK'),_0x72aab2=JSON[_0x254a00(0x1f0,'rc#q')](_0x5b5205);break;case _0x254a00(0x2d3,'Qn^B'):_0x5b5205={'activeId':$[_0x254a00(0x31d,'E*7Q')],'joinId':$['joinId'],'lotteryForm':0x0},_0x2c9550=domains+_0x254a00(0x214,'&Vld'),_0x72aab2=JSON[_0x254a00(0x22e,'!jp^')](_0x5b5205);break;case _0x254a00(0x1fe,'TX6Y'):_0x5b5205={'activeId':$['activeId'],'joinId':$[_0x254a00(0x210,'^QQK')],'shareId':$[_0x254a00(0x246,'kfD$')]},_0x2c9550=domains+'/webc/unionOpen/share',_0x72aab2=JSON[_0x254a00(0x2e6,'xzR^')](_0x5b5205);break;case'myshare':_0x5b5205={'activeId':$[_0x254a00(0x24e,'kmUm')],'joinId':$[_0x254a00(0x2d6,'oI#u')],'shareId':$[_0x254a00(0x30a,'JYjK')]},_0x2c9550=domains+_0x254a00(0x32f,'iXLV'),_0x72aab2=JSON['stringify'](_0x5b5205);break;default:console[_0x254a00(0x308,'MUd*')]('❌\x20未知请求\x20'+_0x31ccc3);return;}const _0x211154={'url':_0x2c9550,'method':_0x5ba128,'headers':{'Accept':_0x254a00(0x2b9,'KpW0'),'Accept-Encoding':_0x254a00(0x2dc,'FS(I'),'Accept-Language':_0x254a00(0x223,'AGx9'),'Connection':'keep-alive','Content-Type':'application/json;charset=UTF-8','jd-fast-token':$[_0x254a00(0x2a6,'iXLV')]||null,'Host':_0x254a00(0x275,'RQtx'),'Cookie':cookie,'Referer':domains,'Origin':domains,'User-Agent':$['UA']},'data':_0x72aab2,'timeout':0x4e20};_0x5ba128===_0x254a00(0x1ff,'AGx9')&&(delete _0x211154[_0x254a00(0x24d,'jkE)')],delete _0x211154['headers'][_0x254a00(0x226,'^QQK')]);const _0x5f56fa=0x1;let _0xaa9244=0x0,_0xaba0cb=null,_0x16eb1d=![];while(_0xaa9244<_0x5f56fa){_0xaa9244>0x0&&await $[_0x254a00(0x2aa,'oI#u')](0x3e8);const _0x27a76b=await common[_0x254a00(0x287,'iXLV')](_0x211154);if(!_0x27a76b[_0x254a00(0x2c1,'MUd*')]){_0xaba0cb=_0x254a00(0x2c7,'rc#q')+_0x31ccc3+_0x254a00(0x2c9,'fZ74')+_0x27a76b[_0x254a00(0x2ef,'qIy9')],_0xaa9244++;continue;}if(!_0x27a76b[_0x254a00(0x225,'EaUK')]){_0xaba0cb=_0x254a00(0x313,'7lqs')+_0x31ccc3+_0x254a00(0x24b,'h0ne'),_0xaa9244++;continue;}handleResponse(_0x31ccc3,_0x27a76b[_0x254a00(0x29d,'&Vld')]),_0x16eb1d=![];break;}_0xaa9244>=_0x5f56fa&&(console[_0x254a00(0x23d,'TX6Y')](_0xaba0cb),_0x16eb1d&&($[_0x254a00(0x30c,'rOxA')]=!![],$['message']&&$['message'][_0x254a00(0x248,'qIy9')](_0xaba0cb)));}function _0x88ed(_0x47c9d0,_0x3cd39d){const _0x1033d1=_0x1033();return _0x88ed=function(_0x88edb4,_0x1ff9db){_0x88edb4=_0x88edb4-0x1ec;let _0x1722b1=_0x1033d1[_0x88edb4];if(_0x88ed['ObARFm']===undefined){var _0x5cc11c=function(_0x30b831){const _0x129b1d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x16ee2a='',_0x12d3e8='';for(let _0x227f8f=0x0,_0x18e073,_0x5ed317,_0x1bfe51=0x0;_0x5ed317=_0x30b831['charAt'](_0x1bfe51++);~_0x5ed317&&(_0x18e073=_0x227f8f%0x4?_0x18e073*0x40+_0x5ed317:_0x5ed317,_0x227f8f++%0x4)?_0x16ee2a+=String['fromCharCode'](0xff&_0x18e073>>(-0x2*_0x227f8f&0x6)):0x0){_0x5ed317=_0x129b1d['indexOf'](_0x5ed317);}for(let _0x1f8e50=0x0,_0x467ea8=_0x16ee2a['length'];_0x1f8e50<_0x467ea8;_0x1f8e50++){_0x12d3e8+='%'+('00'+_0x16ee2a['charCodeAt'](_0x1f8e50)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x12d3e8);};const _0x2c65eb=function(_0x4ca218,_0x125cc0){let _0x6a454=[],_0x8b80c2=0x0,_0x2a9545,_0x96a14e='';_0x4ca218=_0x5cc11c(_0x4ca218);let _0x1a5d67;for(_0x1a5d67=0x0;_0x1a5d67<0x100;_0x1a5d67++){_0x6a454[_0x1a5d67]=_0x1a5d67;}for(_0x1a5d67=0x0;_0x1a5d67<0x100;_0x1a5d67++){_0x8b80c2=(_0x8b80c2+_0x6a454[_0x1a5d67]+_0x125cc0['charCodeAt'](_0x1a5d67%_0x125cc0['length']))%0x100,_0x2a9545=_0x6a454[_0x1a5d67],_0x6a454[_0x1a5d67]=_0x6a454[_0x8b80c2],_0x6a454[_0x8b80c2]=_0x2a9545;}_0x1a5d67=0x0,_0x8b80c2=0x0;for(let _0x48eeb9=0x0;_0x48eeb9<_0x4ca218['length'];_0x48eeb9++){_0x1a5d67=(_0x1a5d67+0x1)%0x100,_0x8b80c2=(_0x8b80c2+_0x6a454[_0x1a5d67])%0x100,_0x2a9545=_0x6a454[_0x1a5d67],_0x6a454[_0x1a5d67]=_0x6a454[_0x8b80c2],_0x6a454[_0x8b80c2]=_0x2a9545,_0x96a14e+=String['fromCharCode'](_0x4ca218['charCodeAt'](_0x48eeb9)^_0x6a454[(_0x6a454[_0x1a5d67]+_0x6a454[_0x8b80c2])%0x100]);}return _0x96a14e;};_0x88ed['kyDVJG']=_0x2c65eb,_0x47c9d0=arguments,_0x88ed['ObARFm']=!![];}const _0x2693dc=_0x1033d1[0x0],_0x265034=_0x88edb4+_0x2693dc,_0x53c459=_0x47c9d0[_0x265034];return!_0x53c459?(_0x88ed['ATmBzo']===undefined&&(_0x88ed['ATmBzo']=!![]),_0x1722b1=_0x88ed['kyDVJG'](_0x1722b1,_0x1ff9db),_0x47c9d0[_0x265034]=_0x1722b1):_0x1722b1=_0x53c459,_0x1722b1;},_0x88ed(_0x47c9d0,_0x3cd39d);}async function getAuthorCodeList(_0x1b6e40){const _0x2b85ce=_0x42e6a5,_0x62558c=await common[_0x2b85ce(0x205,'*ArY')]({'url':_0x1b6e40,'method':_0x2b85ce(0x283,'Sf!a'),'headers':{'User-Agent':_0x2b85ce(0x23c,')ECL')},'proxy':null,'debug':![],'timeout':0x7530}),_0x15cb45=_0x62558c[_0x2b85ce(0x2cd,'Q*L)')];return _0x15cb45;}function random(_0x40ca18,_0x140da6){const _0x3ff2de=_0x42e6a5;return Math['floor'](Math[_0x3ff2de(0x2ea,'AGx9')]()*(_0x140da6-_0x40ca18))+_0x40ca18;}
// 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) }