mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-24 21:56:53 +01:00
[pladform] Fix format quality sorting
This commit is contained in:
parent
f838875726
commit
11101076a1
@ -6,6 +6,7 @@
|
|||||||
ExtractorError,
|
ExtractorError,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
xpath_text,
|
xpath_text,
|
||||||
|
qualities,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -55,9 +56,12 @@ def _real_extract(self, url):
|
|||||||
'%s returned error: %s' % (self.IE_NAME, video.text),
|
'%s returned error: %s' % (self.IE_NAME, video.text),
|
||||||
expected=True)
|
expected=True)
|
||||||
|
|
||||||
|
quality = qualities(('ld', 'sd', 'hd'))
|
||||||
|
|
||||||
formats = [{
|
formats = [{
|
||||||
'url': src.text,
|
'url': src.text,
|
||||||
'format_id': src.get('quality'),
|
'format_id': src.get('quality'),
|
||||||
|
'quality': quality(src.get('quality')),
|
||||||
} for src in video.findall('./src')]
|
} for src in video.findall('./src')]
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user