Skip to content

Commit

Permalink
[Player] Improves error handling for yt-dlp process
Browse files Browse the repository at this point in the history
Prevents errors from being ignored.
Instead, they are piped and logged.
  • Loading branch information
mikeyaworski committed Jun 18, 2024
1 parent 6b4aaa5 commit 005f5cd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/commands/player/track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,10 @@ export default class Track {
quiet: true,
format: 'bestaudio[ext=webm][acodec=opus][asr=48000]/bestaudio',
cookies: './.data/cookies.txt',
ignoreErrors: true,
// @ts-ignore We know this is valid
noAbortOnError: true,
}, {
// Pipe only stdout to the parent process
stdio: ['ignore', 'pipe', 'ignore'],
// Pipe stdout and stderr to the parent process. Ignore stdin.
// Obviously stdout is for the audio data, and stderr is for any error output.
stdio: ['ignore', 'pipe', 'pipe'],
});
if (!process.stdout) {
reject(new Error('No stdout'));
Expand Down

0 comments on commit 005f5cd

Please sign in to comment.