From 1a04de439cd2025cc34b4a4e52039c3932a52e82 Mon Sep 17 00:00:00 2001 From: Khairul Hidayat Date: Fri, 11 Apr 2025 19:18:29 +0000 Subject: [PATCH] feat: set best audio quality --- lib/yt2mp3.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/yt2mp3.go b/lib/yt2mp3.go index 0133671..fde37ba 100644 --- a/lib/yt2mp3.go +++ b/lib/yt2mp3.go @@ -21,6 +21,7 @@ import ( func fetchAudio(video *goutubedl.Result, out string, ch chan error) { dl, err := video.DownloadWithOptions(context.Background(), goutubedl.DownloadOptions{ DownloadAudioOnly: true, + AudioFormats: "best", }) if err != nil { ch <- err @@ -115,6 +116,7 @@ func convertToMp3(data ConvertOptions, ch chan error) { input := []*ffmpeg.Stream{ffmpeg.Input(data.Video).Audio()} args := ffmpeg.KwArgs{ "format": "mp3", + "ab": "320k", "id3v2_version": "3", "write_id3v1": "1", "metadata": []string{