From f4705a0b7f7d0133ecbd5ddf86d906a460395993 Mon Sep 17 00:00:00 2001 From: Logan Gartner Date: Fri, 16 Sep 2022 18:32:22 -0600 Subject: [PATCH] Added file extension check to YT download --- helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers.go b/helpers.go index e34aeab..7535f7d 100644 --- a/helpers.go +++ b/helpers.go @@ -97,7 +97,7 @@ func getLargestDashFormat(input goutubedl.Result, sizeLimit float64) (videoForma func getLargestYTFormat(input goutubedl.Result, sizeLimit float64) (format goutubedl.Format, err error) { for i := len(input.Formats())-1; i >= 0; i-- { - if input.Formats()[i].VBR > 0 && input.Formats()[i].ASR > 0 { + if input.Formats()[i].VBR > 0 && input.Formats()[i].ASR > 0 && slices.Contains(FileExtensions, input.Formats()[i].Ext) { var size float64 if input.Formats()[i].FilesizeApprox > 0 { size = input.Formats()[i].FilesizeApprox