mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-17 05:43:21 +00:00
[ndr] use utils.qualites
This commit is contained in:
parent
b58a22b963
commit
376e1ad081
|
@ -5,10 +5,11 @@
|
|||
from ..utils import (
|
||||
ExtractorError,
|
||||
int_or_none,
|
||||
qualities,
|
||||
)
|
||||
|
||||
|
||||
preferences = {'xl': 4, 'l': 3, 'm': 2, 's': 1, 'xs': 0,}
|
||||
preference = qualities(['xs', 's', 'm','l', 'xl'])
|
||||
|
||||
|
||||
class NDRBaseIE(InfoExtractor):
|
||||
|
@ -29,7 +30,7 @@ def extract_video_info(self, playlist, video_id):
|
|||
formats.append({
|
||||
'url': src,
|
||||
'format_id': quality,
|
||||
'preference': preferences.get(quality),
|
||||
'preference': preference(quality),
|
||||
})
|
||||
elif streamType == 'httpAudio':
|
||||
for key, f in playlist.items():
|
||||
|
@ -51,7 +52,7 @@ def extract_video_info(self, playlist, video_id):
|
|||
thumbnails = [{
|
||||
'id': thumbnail.get('quality'),
|
||||
'url': thumbnail.get('src'),
|
||||
'preference': preferences.get(thumbnail.get('quality'))
|
||||
'preference': preference(thumbnail.get('quality'))
|
||||
} for thumbnail in config.get('poster').values()]
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue