mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-11-30 05:15:14 +00:00
[formatsort] Remove misuse of 'preference'
'preference' is to be used only when the format is better that ALL qualities of a lower preference irrespective of ANY sorting order the user requests. See deezer.py for correct use of this In the older sorting method, `preference`, `quality` and `language_preference` were functionally almost equivalent. So these disparities doesn't really matter there Also, despite what the documentation says, the default for `preference` was actually 0 and not -1. I have tried to correct this and also account for it when converting `preference` to `quality`
This commit is contained in:
@@ -179,16 +179,9 @@ class VimeoBaseInfoExtractor(InfoExtractor):
|
||||
formats.append({
|
||||
'format_id': 'live-archive-source',
|
||||
'url': live_archive_source_url,
|
||||
'preference': 1,
|
||||
'quality': 10,
|
||||
})
|
||||
|
||||
# Reduntant code! This is already done in common.py
|
||||
# for f in formats:
|
||||
# if f.get('vcodec') == 'none':
|
||||
# f['preference'] = -50
|
||||
# elif f.get('acodec') == 'none':
|
||||
# f['preference'] = -40
|
||||
|
||||
subtitles = {}
|
||||
text_tracks = config['request'].get('text_tracks')
|
||||
if text_tracks:
|
||||
@@ -251,7 +244,7 @@ class VimeoBaseInfoExtractor(InfoExtractor):
|
||||
'height': int_or_none(source_file.get('height')),
|
||||
'filesize': parse_filesize(source_file.get('size')),
|
||||
'format_id': source_name,
|
||||
'preference': 1,
|
||||
'quality': 1,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user