From 4c6079482b19c100327696c5a6055570b47ec500 Mon Sep 17 00:00:00 2001 From: GNUSheep Date: Thu, 4 Jan 2024 18:02:07 +0100 Subject: [PATCH] Fix go lint errors --- downloader/downloader.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/downloader/downloader.go b/downloader/downloader.go index e1f4ddf5c..c70e71787 100644 --- a/downloader/downloader.go +++ b/downloader/downloader.go @@ -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 } }