mywork / lib /bing-image.js
DeeCeeXxx's picture
Upload 199 files
6c07b9a verified
const _0x4b78f8=_0x4980;(function(_0x107614,_0x436136){const _0x7d74f4=_0x4980,_0x4b7296=_0x107614();while(!![]){try{const _0x3da8ef=parseInt(_0x7d74f4(0x20a))/0x1*(parseInt(_0x7d74f4(0x1f2))/0x2)+-parseInt(_0x7d74f4(0x216))/0x3*(-parseInt(_0x7d74f4(0x1db))/0x4)+parseInt(_0x7d74f4(0x217))/0x5+parseInt(_0x7d74f4(0x1da))/0x6+parseInt(_0x7d74f4(0x1e8))/0x7*(parseInt(_0x7d74f4(0x1f8))/0x8)+-parseInt(_0x7d74f4(0x1ee))/0x9+-parseInt(_0x7d74f4(0x202))/0xa;if(_0x3da8ef===_0x436136)break;else _0x4b7296['push'](_0x4b7296['shift']());}catch(_0x1328e8){_0x4b7296['push'](_0x4b7296['shift']());}}}(_0x16f3,0x26b86));function _0x4980(_0x59e04c,_0x412739){const _0x16f3f=_0x16f3();return _0x4980=function(_0x4980ce,_0x1d0f75){_0x4980ce=_0x4980ce-0x1d8;let _0x1b87b1=_0x16f3f[_0x4980ce];return _0x1b87b1;},_0x4980(_0x59e04c,_0x412739);}function hi(){const _0x2daa85=_0x4980;console[_0x2daa85(0x1f1)]('Hello\x20World!');}hi();function _0x16f3(){const _0x474260=['slice','260016ndRWOc','137536rYBjSX','load','Mozilla/5.0\x20(Windows\x20NT\x2010.0;\x20Win64;\x20x64;\x20rv:120.0)\x20Gecko/20100101\x20Firefox/120.0','1-8CNXA-k5mm0ruZAUfVI14pAtOvuHOVCTxWg3u6SsBeT4u9FCX5GLLNhFhMDFMEGoRkGPrhbwByZ9l-W5RpnCMVcXqv3d-eSkqB2jyOj7Ib2HnvF9qN1DeXNXVfrTp4um633acUvBwVDVBRBHDnVKRqfbcB_giDh_Yr3d0hIC5dgpM4sU-VgPk-h5F8R6Rlby5Qpdo4RGKeCtMpKlzyBDA','headers','includes','/images/create?','x-eventid','getCredits','_U=','Slow\x20mode\x20is\x20currently\x20unavailable\x20due\x20to\x20high\x20demand','getRandomNum','Error\x20occurred','4592berlzQ','1WdAN6NWWReTpe8bUwYzaxi1pd4ftHnVlnnW1cWoheoYgBA12UUrWG4BIi8ccOKMN3nWt1yZeDDJJugsje9Bw-k6i2yFNOHLuC9NlCjBtmZhxmcgYwIKypNCfFC2WWwWXHqbl5mLsdA-dIw9lHEXTBrF2sxPHPVBmnvZlAJKUiQ6WZrrbP28V4rSDdovN6otPA6VfLpVSwAJ7DYuLHwVIZg','src','error\x20is\x20','https://www.bing.com','createImages','2829123isefxS','text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8','length','log','12ljBoKO','/create','floor','push','www.bing.com','#token_bal','1304eFnRSu','retrieveImages','Error\x20in\x20sendRequest:','#gilen_son','text','application/x-www-form-urlencoded','cheerio','indexOf','get','hasClass','2058560KHefvM','en-US,en;q=0.5','status','&rt=','/images/create/async/results/1-','Prompt\x20has\x20been\x20blocked','attribs','\x22errorMessage\x22:\x22Pending\x22','31513GfZjwD','1ttZrlV0EfkbC3IXLYJrSExXotu4nothyxA6tFzP_N4Opx-bkeE3HckcDhJaN-Yl7hdAEm5hnvf9X52aT30ymsgefhXcEFCQCR15GZwumOZy3YXBTrjPwx0dqP8OC1hkU8PwVHFi3hNJfWy6KZ5fhQiTgs3wPL_1nIWRwEpFLJ1BFyOkLVC5SelRk4Msq0R5t1DP3HSAPLz7Pwc9o_iwmow','Error\x20in\x20retrieveImages:\x20','cors','navigate','node-fetch','manual','document','.gil_err_img.rms_img','POST','.mimg','cookie','21WdGBaw','493855EOUPUJ','show_n'];_0x16f3=function(){return _0x474260;};return _0x16f3();}const fetch=require(_0x4b78f8(0x20f)),cheerio=require(_0x4b78f8(0x1fe)),bingUrl=_0x4b78f8(0x1ec);class BingApi{constructor(_0x25601e){const _0x185cfb=_0x4b78f8;this[_0x185cfb(0x215)]=_0x25601e,this[_0x185cfb(0x1df)]={'User-Agent':_0x185cfb(0x1dd),'Accept':_0x185cfb(0x1ef),'Accept-Language':_0x185cfb(0x203),'Content-Type':_0x185cfb(0x1fd),'Alt-Used':_0x185cfb(0x1f6),'Upgrade-Insecure-Requests':'1','Sec-Fetch-Dest':_0x185cfb(0x211),'Sec-Fetch-Mode':_0x185cfb(0x20e),'Sec-Fetch-Site':'same-origin','Sec-Fetch-User':'?1','Cookie':_0x185cfb(0x1e4)+_0x25601e+';','X-Forwarded-For':'20.'+this[_0x185cfb(0x1e6)]()+'.'+this[_0x185cfb(0x1e6)]()+'.'+this['getRandomNum']()};}async[_0x4b78f8(0x1ed)](_0x399a64,_0x6daa4f){const _0x16a2cc=_0x4b78f8;try{const _0x3c1660='q='+encodeURIComponent(_0x399a64);let _0x1ed021=await this['getCredits']();!_0x1ed021&&(_0x1ed021=0x0);let _0x77d404=await this['sendRequest'](_0x1ed021>0x0?_0x6daa4f:!![],_0x3c1660);if(_0x77d404[_0x16a2cc(0x204)]===0xc8){const _0x2c7991=await _0x77d404['text'](),_0x2e0f23=cheerio['load'](_0x2c7991),_0x4d7077=_0x2e0f23(_0x16a2cc(0x212))[_0x16a2cc(0x1f0)];if(!_0x6daa4f&&_0x1ed021>0x0&&_0x2e0f23(_0x16a2cc(0x1fb))[_0x16a2cc(0x201)](_0x16a2cc(0x1d8)))throw'Dalle-3\x20is\x20currently\x20unavailable\x20due\x20to\x20high\x20demand';else{if(_0x2e0f23('#gilen_son')[_0x16a2cc(0x201)]('show_n')||_0x4d7077===0x2&&_0x1ed021>0x0&&_0x6daa4f)throw _0x16a2cc(0x1e5);else{if(_0x4d7077===0x2)throw'Invalid\x20cookie';else{if(_0x4d7077===0x4)throw _0x16a2cc(0x207);else throw'Unknown\x20error';}}}}const _0x3ed094=_0x77d404[_0x16a2cc(0x1df)][_0x16a2cc(0x200)](_0x16a2cc(0x1e2));return await this[_0x16a2cc(0x1f9)](_0x3ed094);}catch(_0x3d2c9c){console[_0x16a2cc(0x1f1)](_0x16a2cc(0x1eb)+_0x3d2c9c);}}async[_0x4b78f8(0x1e3)](){const _0x439ab2=_0x4b78f8,_0x15ca4e=await fetch(bingUrl+_0x439ab2(0x1f3),{'headers':this[_0x439ab2(0x1df)],'method':'GET','mode':_0x439ab2(0x20d)}),_0x24fbb5=await _0x15ca4e[_0x439ab2(0x1fc)](),_0x26b4da=cheerio['load'](_0x24fbb5);return _0x26b4da(_0x439ab2(0x1f7))[_0x439ab2(0x1fc)]();}[_0x4b78f8(0x1e6)](){const _0x5df610=_0x4b78f8;return Math[_0x5df610(0x1f4)](Math['random']()*0xfe)+0x1;}async['sendRequest'](_0x52f869,_0xd5f955){const _0x5d5064=_0x4b78f8;try{const _0x3bb287=await fetch(bingUrl+_0x5d5064(0x1e1)+_0xd5f955+_0x5d5064(0x205)+(_0x52f869?'3':'4'),{'headers':this[_0x5d5064(0x1df)],'method':_0x5d5064(0x213),'mode':'cors','redirect':_0x5d5064(0x210)});return _0x3bb287;}catch(_0x26f45c){console[_0x5d5064(0x1f1)](_0x5d5064(0x1fa),_0x26f45c);}}async['retrieveImages'](_0x29479f){const _0x41f43d=_0x4b78f8;try{while(!![]){const _0x340ade=await fetch(bingUrl+_0x41f43d(0x206)+_0x29479f,{'headers':this['headers'],'method':'GET','mode':'cors'}),_0x328737=await _0x340ade[_0x41f43d(0x1fc)]();if(_0x328737[_0x41f43d(0x1e0)](_0x41f43d(0x209)))throw _0x41f43d(0x1e7);let _0x3468ff=[];if(_0x328737===''){await new Promise(_0x2b1f75=>setTimeout(_0x2b1f75,0x1388));continue;}const _0x19e6a5=cheerio[_0x41f43d(0x1dc)](_0x328737);for(let _0x79ff02=0x0;_0x79ff02<_0x19e6a5(_0x41f43d(0x214))[_0x41f43d(0x1f0)];_0x79ff02++){const _0x44c0b5=_0x19e6a5(_0x41f43d(0x214))[_0x79ff02][_0x41f43d(0x208)][_0x41f43d(0x1ea)],_0x122457=_0x44c0b5[_0x41f43d(0x1d9)](0x0,_0x44c0b5[_0x41f43d(0x1ff)]('?'));_0x3468ff[_0x41f43d(0x1f5)](_0x122457);}return _0x3468ff;}}catch(_0x56efa3){console[_0x41f43d(0x1f1)](_0x41f43d(0x20c)+_0x56efa3);}}}const apikyst=[_0x4b78f8(0x1de),_0x4b78f8(0x1e9),_0x4b78f8(0x20b)],apikeybing=apikyst[Math[_0x4b78f8(0x1f4)](apikyst[_0x4b78f8(0x1f0)]*Math['random']())];module['exports']={'BingApi':BingApi,'apikeybing':apikeybing};