diff options
author | Sergey M․ <dstftw@gmail.com> | 2020-02-15 02:00:26 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2020-02-15 02:00:58 +0700 |
commit | b68a6e32fb01717b24fd2201c3e1a5611fd1c963 (patch) | |
tree | 920f4222180fc93e9999794590579a8d016acc28 | |
parent | 8cd809fb3dc446ec06afa2c1d398c9fe31a435cc (diff) |
[nova:embed] Improve (closes #23690)
-rw-r--r-- | youtube_dl/extractor/nova.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/youtube_dl/extractor/nova.py b/youtube_dl/extractor/nova.py index aefd8eab1..62d0552e9 100644 --- a/youtube_dl/extractor/nova.py +++ b/youtube_dl/extractor/nova.py @@ -18,7 +18,7 @@ class NovaEmbedIE(InfoExtractor): _VALID_URL = r'https?://media\.cms\.nova\.cz/embed/(?P<id>[^/?#&]+)' _TEST = { 'url': 'https://media.cms.nova.cz/embed/8o0n0r?autoplay=1', - 'md5': 'b3834f6de5401baabf31ed57456463f7', + 'md5': 'ee009bafcc794541570edd44b71cbea3', 'info_dict': { 'id': '8o0n0r', 'ext': 'mp4', @@ -43,19 +43,18 @@ class NovaEmbedIE(InfoExtractor): formats = [] for format_id, format_list in bitrates.items(): - if format_id == 'hls': - m3u8_url = url_or_none(format_list) - if not m3u8_url: - continue - formats.extend(self._extract_m3u8_formats( - m3u8_url, video_id, ext='mp4', m3u8_id='hls', fatal=False)) - if not isinstance(format_list, list): - continue + format_list = [format_list] for format_url in format_list: format_url = url_or_none(format_url) if not format_url: continue + if format_id == 'hls': + formats.extend(self._extract_m3u8_formats( + format_url, video_id, ext='mp4', + entry_protocol='m3u8_native', m3u8_id='hls', + fatal=False)) + continue f = { 'url': format_url, } |