From d0f06f7543403bb213b772d41fd302a4bca0f5c5 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Thu, 13 Aug 2015 14:08:59 +0100 Subject: [PATCH] Checking output of youtube-dl when downloading[ci skip] --- youtube_dl.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl.go b/youtube_dl.go index 7546fa4..7ba5e73 100644 --- a/youtube_dl.go +++ b/youtube_dl.go @@ -40,7 +40,7 @@ func (dl *YouTubeDLSong) Download() error { // Checks to see if song is already downloaded if _, err := os.Stat(fmt.Sprintf("%s/.mumbledj/songs/%s", dj.homeDir, dl.Filename())); os.IsNotExist(err) { - cmd := exec.Command("youtube-dl", "--no-mtime", "--output", fmt.Sprintf("%s/.mumbledj/songs/%s", dj.homeDir, dl.Filename()), "--format m4a", "--prefer-ffmpeg", "--", dl.url) + cmd := exec.Command("youtube-dl", "--no-mtime", "--output", fmt.Sprintf("%s/.mumbledj/songs/%s", dj.homeDir, dl.Filename()), "--format m4a", "--prefer-ffmpeg", dl.url) err = cmd.Run() if err == nil { if dj.conf.Cache.Enabled { @@ -52,7 +52,7 @@ func (dl *YouTubeDLSong) Download() error { for s := range cmd.Args { Verbose("youtube-dl args: " + cmd.Args[s]) } - output, _ := cmd.CombinedOutput() + output, _ := cmd.Output() Verbose(string(output)) return errors.New("Song download failed.") }