Merge branch 'lecture2go' of https://github.com/nichdu/youtube-dl into nichdu-lecture2go
[youtube-dl] / youtube_dl / extractor / pladform.py
index 926e368a27a60f6b9cbe93c8e49885ebf81d3d46..551c8c9f0fef4566afd5691628b2c216c157fd0c 100644 (file)
@@ -6,6 +6,7 @@ from ..utils import (
     ExtractorError,
     int_or_none,
     xpath_text,
+    qualities,
 )
 
 
@@ -29,7 +30,7 @@ class PladformIE(InfoExtractor):
         'info_dict': {
             'id': '100183293',
             'ext': 'mp4',
-            'title': 'Тайны перевала Дятлова • Тайна перевала Дятлова 1 серия 2 часть',
+            'title': 'Тайны перевала Дятлова • 1 серия 2 часть',
             'description': 'Документальный сериал-расследование одной из самых жутких тайн ХХ века',
             'thumbnail': 're:^https?://.*\.jpg$',
             'duration': 694,
@@ -55,9 +56,12 @@ class PladformIE(InfoExtractor):
                 '%s returned error: %s' % (self.IE_NAME, video.text),
                 expected=True)
 
+        quality = qualities(('ld', 'sd', 'hd'))
+
         formats = [{
             'url': src.text,
             'format_id': src.get('quality'),
+            'quality': quality(src.get('quality')),
         } for src in video.findall('./src')]
         self._sort_formats(formats)