Closed adize2000 closed 1 month ago
Youtube separates the audio and video streams for efficient media streaming.
If you want a high quality video with audio, you should use FFmpeg to combine them: https://github.com/fent/node-ytdl-core/blob/master/example/ffmpeg.js
Describe the bug
In my download.js file below i define an API to save a YT file locally, however the file has no sound each time:
async function handler(req, res) { if (req.method === 'GET') { const videoId = req.query.videoId; //Video ID of the video to download
} else { res.status(405).json({ error: 'Method not allowed' }); // Handle unsupported methods } }
export default handler;
Debug File
Saving: 5O...cI (node:22532) [DEP0040] DeprecationWarning: The
punycode
module is deprecated. Please use a userland alternative instead. (Usenode --trace-deprecation ...
to show where the warning was created) GET /api/download?videoId=5O...cI 200 in 234msEnvironment