codealchemist / youtube-audio-server

Easily stream and download audio from YouTube.
74 stars 32 forks source link

Fix Server Crash with "Output file #0 does not contain any stream" Error for Certain Videos #47

Open DavidBerdik opened 2 years ago

DavidBerdik commented 2 years ago

The current release of YouTube Audio Server has an issue that causes it to crash with the following error when attempting to play certain videos:

node:events:505
      throw er; // Unhandled 'error' event
      ^

Error: ffmpeg exited with code 1: Output #0, mp3, to 'pipe:1':
Output file #0 does not contain any stream

    at ChildProcess.<anonymous> (C:\youtube-audio-server\node_modules\fluent-ffmpeg\lib\processor.js:182:22)
    at ChildProcess.emit (node:events:527:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
Emitted 'error' event on FfmpegCommand instance at:
    at emitEnd (C:\youtube-audio-server\node_modules\fluent-ffmpeg\lib\processor.js:424:16)
    at endCB (C:\youtube-audio-server\node_modules\fluent-ffmpeg\lib\processor.js:544:13)
    at handleExit (C:\youtube-audio-server\node_modules\fluent-ffmpeg\lib\processor.js:170:11)
    at ChildProcess.<anonymous> (C:\youtube-audio-server\node_modules\fluent-ffmpeg\lib\processor.js:182:11)
    at ChildProcess.emit (node:events:527:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)

To reproduce this issue, try testing with this video: https://www.youtube.com/watch?v=awjBLm41xJI

This pull request fixes the issue. Additionally, the ytdl-core version in package.json has been updated from 4.9.1 to 4.11.0.

phatblinkie commented 9 months ago

thank you, wish they would merge this

DavidBerdik commented 9 months ago

thank you, wish they would merge this

You're welcome! 😁 If you are willing to try an alternative project that has the same purpose, I would suggest checking this out.