diff options
author | remitamine <remitamine@gmail.com> | 2015-09-08 15:58:32 +0100 |
---|---|---|
committer | remitamine <remitamine@gmail.com> | 2015-09-08 15:58:32 +0100 |
commit | 376e1ad081abbeb234419c08be121fe81eb9b51d (patch) | |
tree | 3e7b9000bfbe372d0109215a8e1201386eef5ef0 /youtube_dl | |
parent | b58a22b9632a226fc453bb52f195e7577476f35e (diff) |
[ndr] use utils.qualites
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/ndr.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube_dl/extractor/ndr.py b/youtube_dl/extractor/ndr.py index 2a73650d4..87f3edbbe 100644 --- a/youtube_dl/extractor/ndr.py +++ b/youtube_dl/extractor/ndr.py @@ -5,10 +5,11 @@ from .common import InfoExtractor 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 @@ class NDRBaseIE(InfoExtractor): 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 @@ class NDRBaseIE(InfoExtractor): 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 { |