UNPKG

hacxk-movie-scrapper

Version:

a

1 lines 7.45 kB
const _0x35046a=_0x527f;(function(_0x36b057,_0x47e8e3){const _0xbd1c3b=_0x527f,_0x46b04b=_0x36b057();while(!![]){try{const _0x5c40de=parseInt(_0xbd1c3b(0x131))/0x1+parseInt(_0xbd1c3b(0x142))/0x2+-parseInt(_0xbd1c3b(0x136))/0x3*(-parseInt(_0xbd1c3b(0x13e))/0x4)+parseInt(_0xbd1c3b(0x13f))/0x5+parseInt(_0xbd1c3b(0x13a))/0x6*(-parseInt(_0xbd1c3b(0x14a))/0x7)+parseInt(_0xbd1c3b(0x143))/0x8*(parseInt(_0xbd1c3b(0x11c))/0x9)+parseInt(_0xbd1c3b(0x12a))/0xa*(-parseInt(_0xbd1c3b(0x120))/0xb);if(_0x5c40de===_0x47e8e3)break;else _0x46b04b['push'](_0x46b04b['shift']());}catch(_0x4eff2c){_0x46b04b['push'](_0x46b04b['shift']());}}}(_0xaf14,0xd6ce4));const axios=require(_0x35046a(0x135)),cheerio=require('cheerio');async function hacxkTamilMovie(_0x6fa7e5,_0x641801){const _0x5c2423=_0x35046a;try{let _0x3ca1cc;if(_0x6fa7e5==='1')_0x3ca1cc=!_0x641801?_0x5c2423(0x121):_0x5c2423(0x138)+_0x641801+'/';else{if(_0x6fa7e5==='2')_0x3ca1cc=!_0x641801?_0x5c2423(0x139):_0x5c2423(0x12f)+_0x641801+'/';else{if(_0x6fa7e5==='3')_0x3ca1cc=!_0x641801?_0x5c2423(0x150):_0x5c2423(0x12d)+_0x641801+'/';else throw new Error('Please\x20provide\x20a\x20valid\x20option\x20number:\x201,\x202,\x20or\x203.');}}const {data:_0x3fe41a}=await axios[_0x5c2423(0x11a)](_0x3ca1cc),_0xe06614=cheerio[_0x5c2423(0x151)](_0x3fe41a),_0x32617=[];return _0xe06614(_0x5c2423(0x140))[_0x5c2423(0x122)]((_0x44a241,_0x2fa66c)=>{const _0x59e99f=_0x5c2423;let _0x1acc33=_0xe06614(_0x2fa66c)[_0x59e99f(0x127)]('h2\x20>\x20a')[_0x59e99f(0x12b)]()[_0x59e99f(0x133)]();_0x1acc33=_0x1acc33[_0x59e99f(0x149)](_0x59e99f(0x126),'');const _0x598df0=_0xe06614(_0x2fa66c)[_0x59e99f(0x127)](_0x59e99f(0x129))[_0x59e99f(0x155)](_0x59e99f(0x148)),_0x5c564d=_0xe06614(_0x2fa66c)[_0x59e99f(0x127)](_0x59e99f(0x13b))['attr'](_0x59e99f(0x11d));_0x1acc33&&_0x5c564d&&_0x598df0&&_0x32617[_0x59e99f(0x12c)]({'title':_0x1acc33,'thumbnail':_0x5c564d,'link':_0x598df0});}),{'author':_0x5c2423(0x144),'github':_0x5c2423(0x124),'status':!![],'results':_0x32617};}catch(_0x5d7560){return console[_0x5c2423(0x123)](_0x5c2423(0x132),_0x5d7560),{'author':_0x5c2423(0x144),'github':_0x5c2423(0x124),'status':![],'results':_0x5c2423(0x14d)};}}function formatDuration(_0xcc7997){const _0x40c58e=_0x35046a,_0x51893b=Math[_0x40c58e(0x128)](_0xcc7997/0xe10),_0x1df3ab=Math[_0x40c58e(0x128)](_0xcc7997%0xe10/0x3c),_0x3fc02f=Math[_0x40c58e(0x128)](_0xcc7997%0x3c);return _0x51893b+'h\x20'+_0x1df3ab+'m\x20'+_0x3fc02f+'s';}async function hacxkMoviedl(_0x2a9cbd){const _0x1e8c1f=_0x35046a;try{if(!_0x2a9cbd)throw new Error('Please\x20provide\x20a\x20movie\x20URL.');const _0x543609=_0x1e8c1f(0x13c),{data:_0xce1d1b}=await axios[_0x1e8c1f(0x11a)](_0x2a9cbd,{'headers':{'User-Agent':_0x543609}}),_0x565997=cheerio[_0x1e8c1f(0x151)](_0xce1d1b);let _0x13e6e6=_0x565997('title')[_0x1e8c1f(0x12b)]();_0x13e6e6=_0x13e6e6[_0x1e8c1f(0x149)](_0x1e8c1f(0x126),'');const _0x3ff0f2=_0x565997(_0x1e8c1f(0x134))[_0x1e8c1f(0x155)](_0x1e8c1f(0x11d));if(_0x3ff0f2){const {data:_0x441d97}=await axios[_0x1e8c1f(0x11a)](_0x3ff0f2,{'headers':{'User-Agent':_0x543609}}),_0x3e4a29=cheerio[_0x1e8c1f(0x151)](_0x441d97),_0x12cf36=_0x3e4a29(_0x1e8c1f(0x11e))['filter']((_0x10ca01,_0x3dfbae)=>{const _0xf558bc=_0x1e8c1f;return _0x3e4a29(_0x3dfbae)['html']()[_0xf558bc(0x12e)](_0xf558bc(0x13d));})[_0x1e8c1f(0x152)]();if(_0x12cf36){const _0x54248a=_0x12cf36[_0x1e8c1f(0x14c)](/jwplayer\("vplayer"\)\.setup\(([\s\S]*?)\}\);/);if(_0x54248a){const _0x3515cb=_0x54248a[0x1]+'}',_0x16b64e=eval('('+_0x3515cb+')'),_0x5ac689={'sources':_0x16b64e[_0x1e8c1f(0x14e)][_0x1e8c1f(0x137)](_0x1ed138=>({'downloadLink':_0x1ed138[_0x1e8c1f(0x130)],'quality':_0x1ed138[_0x1e8c1f(0x147)]})),'image':_0x16b64e[_0x1e8c1f(0x141)],'duration':formatDuration(parseFloat(_0x16b64e[_0x1e8c1f(0x11f)]))};return{'author':_0x1e8c1f(0x144),'github':_0x1e8c1f(0x124),'status':!![],'result':{'title':_0x13e6e6,..._0x5ac689}};}else throw new Error(_0x1e8c1f(0x154));}else throw new Error(_0x1e8c1f(0x146));}else throw new Error('Iframe\x20src\x20not\x20found.');}catch(_0x447238){return console['error'](_0x1e8c1f(0x14f),_0x447238),{'author':_0x1e8c1f(0x144),'github':_0x1e8c1f(0x124),'status':![],'result':'An\x20error\x20occurred\x20while\x20scraping\x20the\x20iframe\x20URL.'};}}async function hacxkMovieSearch(_0x587cc8){const _0x405acd=_0x35046a;try{if(!_0x587cc8)throw new Error(_0x405acd(0x14b));const _0xcbe334=_0x405acd(0x125)+_0x587cc8,{data:_0xfdb55a}=await axios[_0x405acd(0x11a)](_0xcbe334),_0x3ac141=cheerio[_0x405acd(0x151)](_0xfdb55a),_0x5164c7=[];_0x3ac141(_0x405acd(0x140))[_0x405acd(0x122)]((_0x2e218b,_0x3d5eaa)=>{const _0xfd8411=_0x405acd;try{let _0x2ea60a=_0x3ac141(_0x3d5eaa)[_0xfd8411(0x127)]('h2\x20>\x20a')['text']()['trim']();_0x2ea60a=_0x2ea60a[_0xfd8411(0x149)](_0xfd8411(0x126),'');const _0x41fc9d=_0x3ac141(_0x3d5eaa)[_0xfd8411(0x127)](_0xfd8411(0x129))[_0xfd8411(0x155)](_0xfd8411(0x148)),_0x3adc40=_0x3ac141(_0x3d5eaa)[_0xfd8411(0x127)](_0xfd8411(0x13b))[_0xfd8411(0x155)](_0xfd8411(0x11d));_0x2ea60a&&_0x3adc40&&_0x41fc9d&&_0x5164c7[_0xfd8411(0x12c)]({'title':_0x2ea60a,'thumbnail':_0x3adc40,'link':_0x41fc9d});}catch(_0x45423b){console[_0xfd8411(0x123)](_0xfd8411(0x153)+_0x2e218b+':',_0x45423b);}});const _0x178f04={'author':_0x405acd(0x144),'github':'https://github.com/hacxk','status':!![],'results':_0x5164c7};return _0x178f04;}catch(_0x1b57ae){return console[_0x405acd(0x123)]('Error\x20in\x20search:',_0x1b57ae),{'author':_0x405acd(0x144),'github':_0x405acd(0x124),'status':![],'results':_0x405acd(0x145)};}}function _0x527f(_0x1aa1e8,_0xe13df2){const _0xaf14d9=_0xaf14();return _0x527f=function(_0x527fb4,_0x504f55){_0x527fb4=_0x527fb4-0x11a;let _0xbb3c80=_0xaf14d9[_0x527fb4];return _0xbb3c80;},_0x527f(_0x1aa1e8,_0xe13df2);}function _0xaf14(){const _0x5bd013=['includes','https://tamilyogi.beer/category/tamilyogi-dubbed-movies-online/page/','file','1756170CsZTKz','Error\x20scraping\x20TamilYogi:','trim','div.rez\x20>\x20p\x20>\x20iframe','axios','3hobnZs','map','https://tamilyogi.beer/category/tamil-hd-movies/page/','https://tamilyogi.beer/category/tamilyogi-dubbed-movies-online/','804rcPqOE','div.cover\x20>\x20a\x20>\x20img','Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2013_5\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Version/13.1.1\x20Mobile/15E148\x20Safari/604.1','jwplayer','4946644GfCvBb','8637030cCOzlR','#loop\x20>\x20li','image','1868066kPzCgC','16wMVcZa','HACXK','An\x20error\x20occurred\x20while\x20searching\x20TamilYogi.','No\x20script\x20containing\x20jwplayer\x20setup\x20found.','label','href','replace','64463ayNjhX','Please\x20provide\x20a\x20keyword\x20to\x20search.','match','An\x20error\x20occurred\x20while\x20scraping\x20TamilYogi.','sources','Error\x20scraping\x20iframe\x20URL:','https://tamilyogi.beer/category/tamil-web-series/','load','html','Error\x20extracting\x20item\x20at\x20index\x20','Movie\x20information\x20not\x20found\x20in\x20the\x20script.','attr','get','exports','115794WGBmNm','src','script','duration','22aseEgG','https://tamilyogi.beer/category/tamil-hd-movies/','each','error','https://github.com/hacxk','https://tamilyogi.beer/?s=','\x20Watch\x20Online','find','floor','h2\x20>\x20a','17830760chfriv','text','push','https://tamilyogi.beer/category/tamil-web-series/page/'];_0xaf14=function(){return _0x5bd013;};return _0xaf14();}module[_0x35046a(0x11b)]={'hacxkTamilMovie':hacxkTamilMovie,'hacxkMoviedl':hacxkMoviedl,'hacxkMovieSearch':hacxkMovieSearch};