]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[bbc] extract m3u8 formats with 320k audio
authorRemita Amine <remitamine@gmail.com>
Fri, 10 Feb 2017 18:45:48 +0000 (19:45 +0100)
committerRemita Amine <remitamine@gmail.com>
Fri, 10 Feb 2017 18:46:15 +0000 (19:46 +0100)
youtube_dl/extractor/bbc.py

index b17916137ec51808e8c0c869142d37bf083c90e0..8a2ed0ab6851e3ee128aea4fbb1254c0d37cdd7b 100644 (file)
@@ -225,6 +225,8 @@ class BBCCoUkIE(InfoExtractor):
         }
     ]
 
+    _USP_RE = r'/([^/]+?)\.ism(?:\.hlsv2\.ism)?/[^/]+\.m3u8'
+
     class MediaSelectionError(Exception):
         def __init__(self, id):
             self.id = id
@@ -336,6 +338,15 @@ class BBCCoUkIE(InfoExtractor):
                         formats.extend(self._extract_m3u8_formats(
                             href, programme_id, ext='mp4', entry_protocol='m3u8_native',
                             m3u8_id=format_id, fatal=False))
+                        if re.search(self._USP_RE, href):
+                            usp_formats = self._extract_m3u8_formats(
+                                re.sub(self._USP_RE, r'/\1.ism/\1.m3u8', href),
+                                programme_id, ext='mp4', entry_protocol='m3u8_native',
+                                m3u8_id=format_id, fatal=False)
+                            for f in usp_formats:
+                                if f.get('height') and f['height'] > 720:
+                                    continue
+                                formats.append(f)
                     elif transfer_format == 'hds':
                         formats.extend(self._extract_f4m_formats(
                             href, programme_id, f4m_id=format_id, fatal=False))