Update index.js
Browse files104 unmodified lines1051061071081081091101101111121138 unmodified lines122123124125125126127128165 unmodified lines294295296297297104 unmodified lines try { const ID = ytdl.getVideoID(url), data = await ytdl.getInfo('https://www.youtube.com/watch?v=' + ID) const videoStream = await ytdl(ID, { quality: 'highestvideo' }); /*const videoStream = await ytdl(ID, { quality: 'highestvideo' }); let buffer = await streamToBuffer(videoStream) let upload = await uploadBuffer(buffer) let upload = await uploadBuffer(buffer)*/ let format = ytdl.chooseFormat(data.formats, { quality: quality });
if (format) {8 unmodified lines quality: format.qualityLabel, thumb: data.videoDetails.thumbnails[0].url, dl_url: format.url, url_v2: upload, //url_v2: upload, } } else { throw new Error('No suitable format found');165 unmodified lines res.json({ message: e }); } }) .listen(7860, () => console.log('App running on port 7860')); .listen(7860, () => console.log('App running on port 7860'));index.js+4-4