From 0846732ece76c585977a41b7df35fd64802c04ec Mon Sep 17 00:00:00 2001 From: Gamers_indo1223 <76719536+gamersindo1223@users.noreply.github.com> Date: Sun, 7 Jul 2024 12:20:23 +0000 Subject: [PATCH] Add force IPV4 support --- goutubedl.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/goutubedl.go b/goutubedl.go index 8f10792..fe80bba 100644 --- a/goutubedl.go +++ b/goutubedl.go @@ -225,6 +225,7 @@ type Options struct { DownloadSubtitles bool DownloadSections string // --download-sections ProxyUrl string // --proxy URL http://host:port or socks5://host:port + UseIPV4 bool CookiesFromBrowser string // --cookies-from-browser BROWSER[:FOLDER] DebugLog Printer StderrFn func(cmd *exec.Cmd) io.Writer // if not nil, function to get Writer for stderr @@ -321,6 +322,10 @@ func infoFromURL( cmd.Args = append(cmd.Args, "--proxy", options.ProxyUrl) } + if options.UseIPV4 { + cmd.Args = append(cmd.Args, "-4") + } + if options.Downloader != "" { cmd.Args = append(cmd.Args, "--downloader", options.Downloader) } @@ -328,7 +333,7 @@ func infoFromURL( if options.CookiesFromBrowser != "" { cmd.Args = append(cmd.Args, "--cookies-from-browser", options.CookiesFromBrowser) } - + switch options.Type { case TypePlaylist, TypeChannel: cmd.Args = append(cmd.Args, "--yes-playlist")