[brightcove] Extract m3u8 formats (#3541)
authorNaglis Jonaitis <njonaitis@gmail.com>
Wed, 5 Nov 2014 22:14:33 +0000 (00:14 +0200)
committerNaglis Jonaitis <njonaitis@gmail.com>
Wed, 5 Nov 2014 22:14:33 +0000 (00:14 +0200)
youtube_dl/extractor/brightcove.py
youtube_dl/extractor/generic.py

index cc94e596c06d870ca322e11325d87c1e34fee530..a6920685e1ff93aeaecb0e551215a8343a50e8b0 100644 (file)
@@ -14,6 +14,7 @@ from ..utils import (
     compat_str,
     compat_urllib_request,
     compat_parse_qs,
+    compat_urllib_parse_urlparse,
 
     determine_ext,
     ExtractorError,
@@ -263,10 +264,16 @@ class BrightcoveIE(InfoExtractor):
                 if not url:
                     continue
                 if rend['remote']:
-                    # This type of renditions are served through akamaihd.net,
-                    # but they don't use f4m manifests
-                    url = url.replace('control/', '') + '?&v=3.3.0&fp=13&r=FEEFJ&g=RTSJIMBMPFPB'
-                    ext = 'flv'
+                    url_comp = compat_urllib_parse_urlparse(url)
+                    if url_comp.path.endswith('.m3u8'):
+                        formats.extend(
+                            self._extract_m3u8_formats(url, info['id'], 'mp4'))
+                        continue
+                    elif 'akamaihd.net' in url_comp.netloc:
+                        # This type of renditions are served through
+                        # akamaihd.net, but they don't use f4m manifests
+                        url = url.replace('control/', '') + '?&v=3.3.0&fp=13&r=FEEFJ&g=RTSJIMBMPFPB'
+                        ext = 'flv'
                 else:
                     ext = determine_ext(url)
                 size = rend.get('size')
index 286f95b18cbef124be514b65eddeb5f7b4ecfa08..8dd11e202bd9288057ebf74f0b74d233439593d8 100644 (file)
@@ -101,17 +101,19 @@ class GenericIE(InfoExtractor):
             },
         },
         {
+            # https://github.com/rg3/youtube-dl/issues/3541
             'add_ie': ['Brightcove'],
             'url': 'http://www.kijk.nl/sbs6/leermijvrouwenkennen/videos/jqMiXKAYan2S/aflevering-1',
             'info_dict': {
                 'id': '3866516442001',
-                'ext': 'flv',
+                'ext': 'mp4',
                 'title': 'Leer mij vrouwen kennen: Aflevering 1',
                 'description': 'Leer mij vrouwen kennen: Aflevering 1',
                 'uploader': 'SBS Broadcasting',
             },
+            'skip': 'Restricted to Netherlands',
             'params': {
-                'skip_download': True,
+                'skip_download': True,  # m3u8 download
             },
         },
         # Direct link to a video