Fixed YouTube support

This commit is contained in:
Logan G 2023-08-11 02:18:22 -06:00
parent 5f6809c867
commit 62df01c898
Signed by: logan
GPG key ID: E328528C921E7A7A

View file

@ -97,7 +97,7 @@ func getLargestDashFormat(input goutubedl.Result, sizeLimit float64) (videoForma
func getLargestYTFormat(input goutubedl.Result, sizeLimit float64) (format goutubedl.Format, err error) { func getLargestYTFormat(input goutubedl.Result, sizeLimit float64) (format goutubedl.Format, err error) {
for i := len(input.Formats())-1; i >= 0; i-- { for i := len(input.Formats())-1; i >= 0; i-- {
if input.Formats()[i].VBR > 0 && input.Formats()[i].ASR > 0 && slices.Contains(FileExtensions, input.Formats()[i].Ext) { if input.Formats()[i].FPS > 0 && input.Formats()[i].ASR > 0 && slices.Contains(FileExtensions, input.Formats()[i].Ext) {
var size float64 var size float64
if input.Formats()[i].FilesizeApprox > 0 { if input.Formats()[i].FilesizeApprox > 0 {
size = input.Formats()[i].FilesizeApprox size = input.Formats()[i].FilesizeApprox