From 24cc3575e4befa1942d6346d706388067c3aafe8 Mon Sep 17 00:00:00 2001 From: dilap54 Date: Wed, 22 Jan 2025 22:51:12 +0300 Subject: [PATCH] info args --- goutubedl.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/goutubedl.go b/goutubedl.go index 1b85c49..df21d78 100644 --- a/goutubedl.go +++ b/goutubedl.go @@ -236,6 +236,8 @@ type Options struct { MergeOutputFormat string // --merge-output-format SortingFormat string // --format-sort ExtractorArgs string // --extractor-args + InfoArgs []string + DownloadArgs []string // Set to true if you don't want to use the result.Info structure after the goutubedl.New() call, // so the given URL will be downloaded in a single pass in the DownloadResult.Download() call. @@ -352,6 +354,8 @@ func infoFromURL( ) } + cmd.Args = append(cmd.Args, options.InfoArgs...) + switch options.Type { case TypePlaylist, TypeChannel: cmd.Args = append(cmd.Args, "--yes-playlist") @@ -685,6 +689,8 @@ func (result Result) DownloadWithOptions( ) } + cmd.Args = append(cmd.Args, result.Options.DownloadArgs...) + cmd.Dir = tempPath var stdoutW io.WriteCloser var stderrW io.WriteCloser