Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
Properly return err on error
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Apr 9, 2020
1 parent 4a78111 commit 56d4949
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions download.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ func decodeVideoStream(videoUrl, format string) error {
res, err := goutubedl.New(context.Background(), videoUrl, goutubedl.Options{})
if err != nil {
logrus.Errorf("Unable to create goutube object %s: %v", videoUrl, err)
return err
}

file := removeWhiteSpace(res.Info.Title) + fixExtension(format)
videoStream, err := res.Download(context.Background(), "best")
if err != nil {
logrus.Errorf("Unable to download %s stream: %v", format, err)
return err
}
defer videoStream.Close()

Expand Down

0 comments on commit 56d4949

Please sign in to comment.