fix quality tag

This commit is contained in:
zhaarey 2025-02-12 23:41:53 +08:00
parent 38d4ea4f31
commit 41959d1ae7

View File

@ -1752,6 +1752,9 @@ func extractMediaQuality(b string) (string, error) {
return "", errors.New("m3u8 not of master type") return "", errors.New("m3u8 not of master type")
} }
master := from.(*m3u8.MasterPlaylist) master := from.(*m3u8.MasterPlaylist)
sort.Slice(master.Variants, func(i, j int) bool {
return master.Variants[i].AverageBandwidth > master.Variants[j].AverageBandwidth
})
if debug_mode { if debug_mode {
fmt.Println("\nDebug: All Available Variants:") fmt.Println("\nDebug: All Available Variants:")
fmt.Println("-----------------------------") fmt.Println("-----------------------------")