From 3abe5ae66a3654ceae6963e0517bdbab2ee28cbe Mon Sep 17 00:00:00 2001 From: Gamers_indo1223 <76719536+gamersindo1223@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:13:41 +0000 Subject: [PATCH] Added Download Audio Only --- goutubedl.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/goutubedl.go b/goutubedl.go index 610cbea..42a0660 100644 --- a/goutubedl.go +++ b/goutubedl.go @@ -224,6 +224,7 @@ type Options struct { DownloadThumbnail bool DownloadSubtitles bool DownloadSections string // --download-sections + DownloadAudioOnly bool // -x Download audio only from video ProxyUrl string // --proxy URL http://host:port or socks5://host:port UseIPV4 bool // -4 Make all connections via IPv4 CookiesFromBrowser string // --cookies-from-browser BROWSER[:FOLDER] @@ -638,7 +639,9 @@ func (result Result) DownloadWithOptions( if result.Options.CookiesFromBrowser != "" { cmd.Args = append(cmd.Args, "--cookies-from-browser", result.Options.CookiesFromBrowser) } - + if result.Options.DownloadAudioOnly { + cmd.Args = append(cmd.Args, "-x") + } if result.Options.MergeOutputFormat != "" { cmd.Args = append(cmd.Args, "--merge-output-format", result.Options.MergeOutputFormat,