softie-api
Version:
A module with api collection. Written with only Javascript and a node-friendly streaming interface.
1 lines • 5.1 kB
JavaScript
function _0x3aef(){const _0x55b052=['#channel-name\x20a','#tabVideo\x20tr:nth-child(3)\x20td\x20.btn\x20a','#tabs\x20button:nth-child(2)','src','type','#tabAudio\x20tr:nth-child(2)\x20td\x20.btn\x20a','exports','63077eJjupi','648551acABHQ','1720jbRems','lazyData','trim','1219898fIMGVF','evaluate','split','1405IKzgUY','11hniJeV','sources','3zTDVrO','#txtUrl','goto','#btnSubmit','href','push','querySelector','Duration:','error','8jmrqmw','close','url','https://www.youtube.com/results?search_query=','forEach','#video-title','2740968EMWMRG','#divThumbnail\x20#thumbnail','$eval','20529240PlukMo','1946570DjGQDJ','#contents','#tabVideo\x20tr:nth-child(2)\x20td\x20.btn\x20a','#metadata-line\x20>\x20span:nth-child(3)','newPage','#tabVideo\x20tr:nth-child(3)\x20td\x20.btn','30nIkeqm','click','waitForSelector','#videoTitle\x20b','textContent'];_0x3aef=function(){return _0x55b052;};return _0x3aef();}const _0xdc7320=_0x52cc;(function(_0x76bb7b,_0x4d1a66){const _0xbb125f=_0x52cc,_0x34530d=_0x76bb7b();while(!![]){try{const _0x3ab2a5=-parseInt(_0xbb125f(0x90))/0x1+-parseInt(_0xbb125f(0x94))/0x2*(parseInt(_0xbb125f(0x9a))/0x3)+parseInt(_0xbb125f(0x91))/0x4*(-parseInt(_0xbb125f(0x97))/0x5)+parseInt(_0xbb125f(0x83))/0x6*(-parseInt(_0xbb125f(0x8f))/0x7)+-parseInt(_0xbb125f(0xa3))/0x8*(-parseInt(_0xbb125f(0x79))/0x9)+-parseInt(_0xbb125f(0x7d))/0xa*(parseInt(_0xbb125f(0x98))/0xb)+parseInt(_0xbb125f(0x7c))/0xc;if(_0x3ab2a5===_0x4d1a66)break;else _0x34530d['push'](_0x34530d['shift']());}catch(_0x5c5eb9){_0x34530d['push'](_0x34530d['shift']());}}}(_0x3aef,0x60bf8));const puppeteer=require('puppeteer');async function youtubeDown(_0x2a324c){const _0x41f344=_0x52cc;try{const _0x5f078d=await puppeteer['launch'](),_0xf48cb6=await _0x5f078d[_0x41f344(0x81)]();await _0xf48cb6[_0x41f344(0x9c)]('https://en.y2mate.is/'),await _0xf48cb6['waitForSelector'](_0x41f344(0x9b)),await _0xf48cb6[_0x41f344(0x8c)](_0x41f344(0x9b),_0x2a324c),(await _0xf48cb6[_0x41f344(0x84)](_0x41f344(0x9d)),await _0xf48cb6[_0x41f344(0x85)]('#tabVideo\x20.tableVideo'));let _0x29be76=await _0xf48cb6['$eval'](_0x41f344(0x86),_0x31305a=>_0x31305a[_0x41f344(0x87)][_0x41f344(0x93)]());const _0x383836=_0x29be76[_0x41f344(0x96)](_0x41f344(0xa1));_0x29be76=_0x383836[0x0][_0x41f344(0x93)]();const _0x262d10=_0x383836[0x1][_0x41f344(0x93)](),_0x583a32=await _0xf48cb6[_0x41f344(0x7b)](_0x41f344(0x7a),_0x1b3a63=>_0x1b3a63[_0x41f344(0x8b)]);await _0xf48cb6['click']('#tabVideo\x20tr:nth-child(2)\x20td\x20.btn'),await _0xf48cb6[_0x41f344(0x85)]('#tabVideo\x20tr:nth-child(2)\x20td\x20.btn\x20a');const _0x10936d=await _0xf48cb6['$eval'](_0x41f344(0x7f),_0x2aac5a=>_0x2aac5a[_0x41f344(0x9e)]);await _0xf48cb6['click'](_0x41f344(0x82)),await _0xf48cb6[_0x41f344(0x85)](_0x41f344(0x89));const _0x13c4ff=await _0xf48cb6[_0x41f344(0x7b)]('#tabVideo\x20tr:nth-child(3)\x20td\x20.btn\x20a',_0x571e88=>_0x571e88[_0x41f344(0x9e)]);await _0xf48cb6[_0x41f344(0x84)](_0x41f344(0x8a)),await _0xf48cb6[_0x41f344(0x84)]('#tabAudio\x20tr:nth-child(2)\x20td\x20.btn'),await _0xf48cb6[_0x41f344(0x85)](_0x41f344(0x8d));const _0x49e5b3=await _0xf48cb6[_0x41f344(0x7b)]('#tabAudio\x20tr:nth-child(2)\x20td\x20.btn\x20a',_0x247c53=>_0x247c53['href']);return await _0x5f078d['close'](),{'title':_0x29be76,'duration':_0x262d10,'thumbnail':_0x583a32,'videos':{'p360':_0x10936d,'p720':_0x13c4ff},'audio':_0x49e5b3};}catch(_0x41f40a){return console[_0x41f344(0xa2)]('Error\x20occurred:',_0x41f40a),null;}}function _0x52cc(_0x2a0898,_0x5f48c8){const _0x3aefd2=_0x3aef();return _0x52cc=function(_0x52cc21,_0x1fd9f2){_0x52cc21=_0x52cc21-0x76;let _0x327a35=_0x3aefd2[_0x52cc21];return _0x327a35;},_0x52cc(_0x2a0898,_0x5f48c8);}async function youtubeSearch(_0x3ca7f0){const _0x477cb2=_0x52cc;try{const _0x3f4737=await puppeteer['launch'](),_0x1008a8=await _0x3f4737['newPage']();await _0x1008a8[_0x477cb2(0x9c)](_0x477cb2(0x76)+_0x3ca7f0),await _0x1008a8[_0x477cb2(0x85)](_0x477cb2(0x7e));const _0x442061=await _0x1008a8[_0x477cb2(0x95)](()=>{const _0x4a1922=_0x477cb2,_0x333c08=document['querySelectorAll']('#contents\x20ytd-video-renderer'),_0x5c5c63=[];return _0x333c08[_0x4a1922(0x77)](_0x407bba=>{const _0x103bfb=_0x4a1922,_0x40d33c=_0x407bba[_0x103bfb(0xa0)](_0x103bfb(0x78)),_0x50b1e4=_0x40d33c[_0x103bfb(0x87)][_0x103bfb(0x93)](),_0x406704=_0x40d33c['href'],_0x129665=_0x407bba['querySelector'](_0x103bfb(0x88))[_0x103bfb(0x87)][_0x103bfb(0x93)](),_0x3f2814=_0x407bba['querySelector']('#thumbnail\x20>\x20yt-image\x20>\x20img')[_0x103bfb(0x92)][_0x103bfb(0x99)][0x0][_0x103bfb(0xa5)],_0x3c6ad0=_0x407bba[_0x103bfb(0xa0)](_0x103bfb(0x80))['textContent'][_0x103bfb(0x93)](),_0x6ccb79=_0x407bba[_0x103bfb(0xa0)]('#metadata-line\x20>\x20span:nth-child(4)')[_0x103bfb(0x87)]['trim']();_0x5c5c63[_0x103bfb(0x9f)]({'title':_0x50b1e4,'url':_0x406704,'author':_0x129665,'thumbnail':_0x3f2814,'views':_0x3c6ad0,'upload':_0x6ccb79});}),_0x5c5c63;});return await _0x3f4737[_0x477cb2(0xa4)](),_0x442061;}catch(_0x8dd523){return console[_0x477cb2(0xa2)]('Error\x20occurred:',_0x8dd523),null;}}module[_0xdc7320(0x8e)]={'youtubeDown':youtubeDown,'youtubeSearch':youtubeSearch};