aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2016-07-14 14:13:57 +0100
committerRemita Amine <remitamine@gmail.com>2016-07-14 14:13:57 +0100
commite910fe2fe439df9aa9cf8ca1253fe6db5839024a (patch)
treeebc1f5896a9b4d0ec49f6f6e3affe981cf59c53a
parent233b58dec736205d9bf8c652063b5dba6073631f (diff)
downloadyoutube-dl-e910fe2fe439df9aa9cf8ca1253fe6db5839024a.tar.xz
[brightcove] skip ism manifests
-rw-r--r--youtube_dl/extractor/brightcove.py11
-rw-r--r--youtube_dl/utils.py1
2 files changed, 8 insertions, 4 deletions
diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py
index c172bad2d..aeb22be16 100644
--- a/youtube_dl/extractor/brightcove.py
+++ b/youtube_dl/extractor/brightcove.py
@@ -27,6 +27,7 @@ from ..utils import (
unsmuggle_url,
update_url_query,
clean_html,
+ mimetype2ext,
)
@@ -545,14 +546,16 @@ class BrightcoveNewIE(InfoExtractor):
formats = []
for source in json_data.get('sources', []):
container = source.get('container')
- source_type = source.get('type')
+ ext = mimetype2ext(source.get('type'))
src = source.get('src')
- if source_type == 'application/x-mpegURL' or container == 'M2TS':
+ if ext == 'ism':
+ continue
+ elif ext == 'm3u8' or container == 'M2TS':
if not src:
continue
formats.extend(self._extract_m3u8_formats(
src, video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False))
- elif source_type == 'application/dash+xml':
+ elif ext == 'mpd':
if not src:
continue
formats.extend(self._extract_mpd_formats(src, video_id, 'dash', fatal=False))
@@ -568,7 +571,7 @@ class BrightcoveNewIE(InfoExtractor):
'tbr': tbr,
'filesize': int_or_none(source.get('size')),
'container': container,
- 'ext': container.lower(),
+ 'ext': ext or container.lower(),
}
if width == 0 and height == 0:
f.update({
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 4c1d0d526..e6e0155b4 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -2123,6 +2123,7 @@ def mimetype2ext(mt):
'dash+xml': 'mpd',
'f4m': 'f4m',
'f4m+xml': 'f4m',
+ 'vnd.ms-sstr+xml': 'ism',
}.get(res, res)