[cleanup] Misc fixes

Closes #3565, https://github.com/yt-dlp/yt-dlp/issues/3514#issuecomment-1105944364
This commit is contained in:
pukkandan
2022-04-29 07:18:36 +05:30
parent 0a41f331cc
commit 1d485a1a79
19 changed files with 75 additions and 42 deletions

View File

@@ -1922,8 +1922,7 @@ class InfoExtractor:
def _sort_formats(self, formats, field_preference=[]):
if not formats:
return
format_sort = self.FormatSort(self, field_preference)
formats.sort(key=lambda f: format_sort.calculate_preference(f))
formats.sort(key=self.FormatSort(self, field_preference).calculate_preference)
def _check_formats(self, formats, video_id):
if formats: