node-ytdl-core: Error on stream close before end

This error is being thrown when I close the stream prior to the video being completed, every time. The stream is being piped into FFMpeg, then into Opus which then gets transmitted through a web socket on a voice chat. The end stream function is from the library which is handling FFMpeg and Opus. It’s not having an issue with any other media types, though other youtube downloaders haven’t been tried. This happens on NodeJS 4.2.x and 5.5.0.

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at exports._errnoException (util.js:860:11)
    at Pipe.onread (net.js:544:26)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 30 (9 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve also had the issue with the same setup, and I wanted to share my workaround: https://github.com/meew0/Lethe/blob/master/lethe.js#L564

It’s really hacky but it works.