diff --git a/youtube_dl/extractor/jwplatform.py b/youtube_dl/extractor/jwplatform.py index 5d56e0a28..ff7097160 100644 --- a/youtube_dl/extractor/jwplatform.py +++ b/youtube_dl/extractor/jwplatform.py @@ -50,7 +50,11 @@ class JWPlatformBaseIE(InfoExtractor): # JWPlayer backward compatibility: flattened sources # https://github.com/jwplayer/jwplayer/blob/v7.4.3/src/js/playlist/item.js#L29-L35 if 'sources' not in video_data: - video_data['sources'] = [video_data] + if isinstance(video_data, list): + video_data = {'sources': video_data } + video_data['tracks'] = video_data['sources'][0].get('tracks') + else: + video_data['sources'] = [video_data] this_video_id = video_id or video_data['mediaid'] @@ -78,9 +82,10 @@ class JWPlatformBaseIE(InfoExtractor): height = int_or_none(source.get('height')) if height is None: # Often no height is provided but there is a label in - # format like 1080p. + # format like 1080p or 'SD 480' height = int_or_none(self._search_regex( - r'^(\d{3,})[pP]$', source.get('label') or '', + [r'^(\d{3,})[pP]$', r'^[SH]D (\d{3,})$'], + source.get('label') or '', 'height', default=None)) a_format = { 'url': source_url,