Skip to content

Commit

Permalink
Fix go lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
GNUSheep committed Jan 4, 2024
1 parent 31d3adf commit 4c60794
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,15 +571,16 @@ func (downloader *Downloader) Download(data *extractors.Data) error {

if downloader.option.AudioOnly {
var isFound bool
reg, err := regexp.Compile("audio+")
if err != nil {
return err
}

for _, s := range sortedStreams {
// Looking for the best quality
matches, err := regexp.MatchString("audio", s.Quality)
if err != nil {
return err
}
if matches {
if reg.MatchString(s.Quality) {
isFound = true
stream, _ = data.Streams[s.ID]
stream = data.Streams[s.ID]
break
}
}
Expand Down

0 comments on commit 4c60794

Please sign in to comment.