[nrk] Relax _VALID_URL (closes #10928)
[youtube-dl] / youtube_dl / extractor / radiojavan.py
index 73ab78d6d01fca181a11d86d11b85461bfb892a7..ec4fa6e602ea779dd6d3a530ea6cfb639eee3cf4 100644 (file)
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
 import re
 
 from .common import InfoExtractor
-from ..utils import(
+from ..utils import (
     unified_strdate,
     str_to_int,
 )
@@ -34,8 +34,9 @@ class RadioJavanIE(InfoExtractor):
         formats = [{
             'url': 'https://media.rdjavan.com/media/music_video/%s' % video_path,
             'format_id': '%sp' % height,
-            'height': height,
+            'height': int(height),
         } for height, video_path in re.findall(r"RJ\.video(\d+)p\s*=\s*'/?([^']+)'", webpage)]
+        self._sort_formats(formats)
 
         title = self._og_search_title(webpage)
         thumbnail = self._og_search_thumbnail(webpage)