Checking output of youtube-dl when downloading[ci skip]
This commit is contained in:
parent
a5bebd06c8
commit
d0f06f7543
|
@ -40,7 +40,7 @@ func (dl *YouTubeDLSong) Download() error {
|
||||||
|
|
||||||
// Checks to see if song is already downloaded
|
// 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) {
|
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()
|
err = cmd.Run()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if dj.conf.Cache.Enabled {
|
if dj.conf.Cache.Enabled {
|
||||||
|
@ -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])
|
||||||
}
|
}
|
||||||
output, _ := cmd.CombinedOutput()
|
output, _ := cmd.Output()
|
||||||
Verbose(string(output))
|
Verbose(string(output))
|
||||||
return errors.New("Song download failed.")
|
return errors.New("Song download failed.")
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue