mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 19:33:59 +01:00
[dreisat] Use centralized format sorting
This commit is contained in:
parent
2c62dc26c8
commit
55e663a8d7
|
@ -52,18 +52,12 @@ def _real_extract(self, url):
|
||||||
'width': int(fe.find('./width').text),
|
'width': int(fe.find('./width').text),
|
||||||
'height': int(fe.find('./height').text),
|
'height': int(fe.find('./height').text),
|
||||||
'url': fe.find('./url').text,
|
'url': fe.find('./url').text,
|
||||||
'ext': determine_ext(fe.find('./url').text),
|
|
||||||
'filesize': int(fe.find('./filesize').text),
|
'filesize': int(fe.find('./filesize').text),
|
||||||
'video_bitrate': int(fe.find('./videoBitrate').text),
|
'video_bitrate': int(fe.find('./videoBitrate').text),
|
||||||
'3sat_qualityname': fe.find('./quality').text,
|
|
||||||
} for fe in format_els
|
} for fe in format_els
|
||||||
if not fe.find('./url').text.startswith('http://www.metafilegenerator.de/')]
|
if not fe.find('./url').text.startswith('http://www.metafilegenerator.de/')]
|
||||||
|
|
||||||
def _sortkey(format):
|
self._sort_formats(formats)
|
||||||
qidx = ['low', 'med', 'high', 'veryhigh'].index(format['3sat_qualityname'])
|
|
||||||
prefer_http = 1 if 'rtmp' in format['url'] else 0
|
|
||||||
return (qidx, prefer_http, format['video_bitrate'])
|
|
||||||
formats.sort(key=_sortkey)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'_type': 'video',
|
'_type': 'video',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user