Update index.js
Browse files378 unmodified lines379380381382383384385189 unmodified lines575576577578579580581378 unmodified lines};// Fungsi untuk mendownload video dari YouTubeconst youtubedl = async (url) => {let html = await (await fetch('https://yt5s.com/en32', {headers: {'User-Agent': generateRandomUserAgent(),'X-Forwarded-For': generateRandomIP(),189 unmodified lines});}if (!type || !/audio|video/i.test(type)) type = 'video';let data = await youtubedl(url).catch(e => console.log(e));if (!data) return res.json({ message: 'Error: link download not found' });type = type.toLowerCase();let result = quality ? Object.values(data[type]).find(x => x.quality == quality) : Object.values(data[type])[0];378 unmodified lines379380381382383384385189 unmodified lines575576577578579580581378 unmodified lines};// Fungsi untuk mendownload video dari YouTubeconst youtubedl_2 = async (url) => {let html = await (await fetch('https://yt5s.com/en32', {headers: {'User-Agent': generateRandomUserAgent(),'X-Forwarded-For': generateRandomIP(),189 unmodified lines});}if (!type || !/audio|video/i.test(type)) type = 'video';let data = await youtubedl_2(url).catch(e => console.log(e));if (!data) return res.json({ message: 'Error: link download not found' });type = type.toLowerCase();let result = quality ? Object.values(data[type]).find(x => x.quality == quality) : Object.values(data[type])[0];
index.js+2-2