Explorar o código

[brightcove] skip ism manifests

Remita Amine %!s(int64=9) %!d(string=hai) anos
pai
achega
e910fe2fe4
Modificáronse 2 ficheiros con 8 adicións e 4 borrados
  1. 7 4
      youtube_dl/extractor/brightcove.py
  2. 1 0
      youtube_dl/utils.py

+ 7 - 4
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({

+ 1 - 0
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)