distubejs / ytdl-core

YouTube video downloader in javascript.
MIT License
206 stars 43 forks source link

Cannot handle stream events #98

Open minjaes opened 3 weeks ago

minjaes commented 3 weeks ago

Describe the bug

I'm trying to listen to error event something like following:

 const audioStream = ytdl(url, {});
 audioStream.pipe(fs.createWriteStream(outputFilePath)).on('error', (error: Error) => ...)

When an error occurs, it doesn't get caught by .on and causes the backend to crash instead. It also looks like other events emitted by stream.emit is not being handled correctly.