From a8a9c1f231a9c8d4bee7d60c8c146cdfb3a5ee6f Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Thu, 13 Aug 2015 13:51:51 +0100 Subject: [PATCH] Checking output of youtube-dl when downloading[ci skip] --- youtube_dl.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/youtube_dl.go b/youtube_dl.go index 5198680..cd17f8f 100644 --- a/youtube_dl.go +++ b/youtube_dl.go @@ -52,8 +52,7 @@ func (dl *YouTubeDLSong) Download() error { for s := range cmd.Args { Verbose("youtube-dl args: " + cmd.Args[s]) } - b, _ := ioutil.ReadAll(cmd.Stdout) - Verbose(string(b)) + Verbose(string(cmd.Output())) return errors.New("Song download failed.") } } @@ -137,7 +136,7 @@ func (dl *YouTubeDLSong) SkipReached(channelUsers int) bool { // Submitter returns the name of the submitter of the Song. func (dl *YouTubeDLSong) Submitter() string { - return dl.submitter + return dl.submitter.Name } // Title returns the title of the Song. @@ -156,7 +155,7 @@ func (dl *YouTubeDLSong) Filename() string { } // Duration returns the duration of the Song. -func (dl *YouTubeDLSong) Duration() string { +func (dl *YouTubeDLSong) Duration() int { return dl.duration }