Shows CombinedOutput of command to allow for debugging

testing
Justin Reichardt 2022-11-10 16:27:47 -06:00
parent ba1bf0afde
commit df57d7a57e
1 changed files with 6 additions and 1 deletions

View File

@ -137,8 +137,13 @@ func operationHandler() {
cmd := exec.Command("youtube-dl", o.URL)
cmd.Dir = dir + "/"
currentWork[i] = o.URL // Adds the URL to list of current work
cmd.Run()
output, err := cmd.CombinedOutput()
log.Print("Finished: " + o.URL)
if err != nil {
log.Print("Failed to download")
log.Print(err)
}
log.Print(string(output))
delete(currentWork, i) // Remove the URL from list of current work
// Clean up directory