From 98ccaf8e11e3bd442d1000e7d687d2d899e7403b Mon Sep 17 00:00:00 2001 From: Markus Kuuse Date: Mon, 2 Dec 2024 18:47:29 +0200 Subject: [PATCH] fix ffmpeg conversion --- src/youtube.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/youtube.go b/src/youtube.go index 390487b..d9e725e 100644 --- a/src/youtube.go +++ b/src/youtube.go @@ -106,11 +106,11 @@ func saveVideo(cfg Youtube, track Track, stream *goutubedl.DownloadResult) bool return false // If the download fails (downloads a few bytes) then it will get triggered here: "tls: bad record MAC" } - cmd := ffmpeg.Input(input, ffmpeg.KwArgs{ - "c": "copy", - "metadata": []string{"artist="+track.Artist,"title="+track.Title,"album="+track.Album}, - "loglevel": "error", - }).OverWriteOutput().ErrorToStdOut() + cmd := ffmpeg.Input(input).Output(fmt.Sprintf("%s%s.mp3", cfg.DownloadDir, track.File), ffmpeg.KwArgs{ + "map": "0:a", + "metadata": []string{"artist="+track.Artist,"title="+track.Title,"album="+track.Album}, + "loglevel": "error", + }).OverWriteOutput().ErrorToStdOut() if cfg.FfmpegPath != "" { cmd.SetFfmpegPath(cfg.FfmpegPath)