Skip to content

Commit

Permalink
fix: no available formats doesn't crash the program
Browse files Browse the repository at this point in the history
  • Loading branch information
pspiagicw committed Jun 4, 2024
1 parent 4c66416 commit f652dc7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/tui/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ func selectFormat(video *youtube.Video) *youtube.Format {

formats.Sort()

if len(formats) == 0 {
goreland.LogFatal("No suitable formats found")
}

return &formats[0]
}
func getStream(client *youtube.Client, video *youtube.Video, format *youtube.Format) io.ReadCloser {
Expand Down

0 comments on commit f652dc7

Please sign in to comment.