aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2017-02-10 19:45:48 +0100
committerRemita Amine <remitamine@gmail.com>2017-02-10 19:46:15 +0100
commit97eb9bd2acffd352558b626f923862d039efbcb7 (patch)
tree283c36cc1cdab25253e846cc108f293f3a6d52da /youtube_dl/extractor
parent71cdd75628f851975eef551a96b1a24f94066d74 (diff)
[bbc] extract m3u8 formats with 320k audio
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/bbc.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/youtube_dl/extractor/bbc.py b/youtube_dl/extractor/bbc.py
index b17916137..8a2ed0ab6 100644
--- a/youtube_dl/extractor/bbc.py
+++ b/youtube_dl/extractor/bbc.py
@@ -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))