Checking output of youtube-dl when downloading[ci skip]

This commit is contained in:
MichaelOultram 2015-08-13 13:57:45 +01:00
parent 255c516967
commit fa0dd24677
3 changed files with 5 additions and 5 deletions

View file

@ -34,7 +34,7 @@ type Song interface {
Title() string Title() string
ID() string ID() string
Filename() string Filename() string
Duration() int Duration() string
Thumbnail() string Thumbnail() string
Playlist() Playlist Playlist() Playlist
DontSkip() bool DontSkip() bool

View file

@ -102,7 +102,7 @@ func (sc SoundCloud) NewSong(user *gumble.User, trackData *jsonq.JsonQuery, play
url: url, url: url,
thumbnail: thumbnail, thumbnail: thumbnail,
submitter: user, submitter: user,
duration: duration, duration: string(duration),
playlist: playlist, playlist: playlist,
skippers: make([]string, 0), skippers: make([]string, 0),
dontSkip: false, dontSkip: false,

View file

@ -17,7 +17,7 @@ type YouTubeDLSong struct {
title string title string
thumbnail string thumbnail string
submitter *gumble.User submitter *gumble.User
duration int duration string
url string url string
offset int offset int
playlist Playlist playlist Playlist
@ -52,7 +52,7 @@ func (dl *YouTubeDLSong) Download() error {
for s := range cmd.Args { for s := range cmd.Args {
Verbose("youtube-dl args: " + cmd.Args[s]) Verbose("youtube-dl args: " + cmd.Args[s])
} }
Verbose(string(cmd.Output())) Verbose(string(cmd.CombinedOutput()))
return errors.New("Song download failed.") return errors.New("Song download failed.")
} }
} }
@ -155,7 +155,7 @@ func (dl *YouTubeDLSong) Filename() string {
} }
// Duration returns the duration of the Song. // Duration returns the duration of the Song.
func (dl *YouTubeDLSong) Duration() int { func (dl *YouTubeDLSong) Duration() string {
return dl.duration return dl.duration
} }