fixed appending args

This commit is contained in:
Mark Beamer Jr 2020-07-30 13:05:49 -04:00 committed by Alex Grintsvayg
parent 140353097e
commit 4d56339756
No known key found for this signature in database
GPG key ID: AEB3F089F86A22B5

View file

@ -255,7 +255,7 @@ func run(use string, args []string, withStdErr, withStdOut bool, stopChan stop.C
defer pool.ReleaseIP(sourceAddress) defer pool.ReleaseIP(sourceAddress)
argsForCommand := append(args, "--source-address", sourceAddress) argsForCommand := append(args, "--source-address", sourceAddress)
cmd := exec.Command("youtube-dl", argsForCommand...) cmd := exec.Command("youtube-dl", argsForCommand...)
logrus.Printf("Running command youtube-dl %s", strings.Join(args, " ")) logrus.Printf("Running command youtube-dl %s", strings.Join(argsForCommand, " "))
var stderr io.ReadCloser var stderr io.ReadCloser
var errorLog []byte var errorLog []byte
@ -314,7 +314,7 @@ func run(use string, args []string, withStdErr, withStdOut bool, stopChan stop.C
continue continue
} }
logrus.Debug("Unkown error, returning failure") logrus.Debug("Unkown error, returning failure")
return nil, errors.Prefix("youtube-dl "+strings.Join(args, " "), err) return nil, errors.Prefix("youtube-dl "+strings.Join(argsForCommand, " "), err)
} }
return strings.Split(strings.Replace(string(outLog), "\r\n", "\n", -1), "\n"), nil return strings.Split(strings.Replace(string(outLog), "\r\n", "\n", -1), "\n"), nil
} }