aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/extractor/ooyala.py
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2016-05-24 11:24:29 +0100
committerremitamine <remitamine@gmail.com>2016-05-24 11:24:29 +0100
commit277c7465f58e0ac50de0dd9ebc2083f6142e9a94 (patch)
tree887ca3330f6f548293cd570fd793a80528f9c3e4 /youtube_dl/extractor/ooyala.py
parenta4760d204fe4cd7592bdfc91cbf550eb985374ac (diff)
downloadyoutube-dl-277c7465f58e0ac50de0dd9ebc2083f6142e9a94.zip
youtube-dl-277c7465f58e0ac50de0dd9ebc2083f6142e9a94.tar.gz
youtube-dl-277c7465f58e0ac50de0dd9ebc2083f6142e9a94.tar.bz2
[ooyala] check manifest ext with determine_ext and update tests for related extractors
Diffstat (limited to 'youtube_dl/extractor/ooyala.py')
-rw-r--r--youtube_dl/extractor/ooyala.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/youtube_dl/extractor/ooyala.py b/youtube_dl/extractor/ooyala.py
index 09bc291..2038a6b 100644
--- a/youtube_dl/extractor/ooyala.py
+++ b/youtube_dl/extractor/ooyala.py
@@ -8,6 +8,7 @@ from ..utils import (
float_or_none,
ExtractorError,
unsmuggle_url,
+ determine_ext,
)
from ..compat import compat_urllib_parse_urlencode
@@ -37,26 +38,27 @@ class OoyalaBaseIE(InfoExtractor):
formats = []
if cur_auth_data['authorized']:
for stream in cur_auth_data['streams']:
- url = base64.b64decode(
+ s_url = base64.b64decode(
stream['url']['data'].encode('ascii')).decode('utf-8')
- if url in urls:
+ if s_url in urls:
continue
- urls.append(url)
+ urls.append(s_url)
+ ext = determine_ext(s_url, None)
delivery_type = stream['delivery_type']
- if delivery_type == 'hls' or '.m3u8' in url:
+ if delivery_type == 'hls' or ext == 'm3u8':
formats.extend(self._extract_m3u8_formats(
- url, embed_code, 'mp4', 'm3u8_native',
+ s_url, embed_code, 'mp4', 'm3u8_native',
m3u8_id='hls', fatal=False))
- elif delivery_type == 'hds' or '.f4m' in url:
+ elif delivery_type == 'hds' or ext == 'f4m':
formats.extend(self._extract_f4m_formats(
- url + '?hdcore=3.7.0', embed_code, f4m_id='hds', fatal=False))
- elif '.smil' in url:
+ s_url + '?hdcore=3.7.0', embed_code, f4m_id='hds', fatal=False))
+ elif ext == 'smil':
formats.extend(self._extract_smil_formats(
- url, embed_code, fatal=False))
+ s_url, embed_code, fatal=False))
else:
formats.append({
- 'url': url,
- 'ext': stream.get('delivery_type'),
+ 'url': s_url,
+ 'ext': ext or stream.get('delivery_type'),
'vcodec': stream.get('video_codec'),
'format_id': delivery_type,
'width': int_or_none(stream.get('width')),