aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/kaltura.py
diff options
context:
space:
mode:
Diffstat (limited to 'hypervideo_dl/extractor/kaltura.py')
-rw-r--r--hypervideo_dl/extractor/kaltura.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/hypervideo_dl/extractor/kaltura.py b/hypervideo_dl/extractor/kaltura.py
index c8f60ef..f6dfc9c 100644
--- a/hypervideo_dl/extractor/kaltura.py
+++ b/hypervideo_dl/extractor/kaltura.py
@@ -12,6 +12,7 @@ from ..compat import (
from ..utils import (
clean_html,
ExtractorError,
+ format_field,
int_or_none,
unsmuggle_url,
smuggle_url,
@@ -300,6 +301,7 @@ class KalturaIE(InfoExtractor):
data_url = re.sub(r'/flvclipper/.*', '/serveFlavor', data_url)
formats = []
+ subtitles = {}
for f in flavor_assets:
# Continue if asset is not ready
if f.get('status') != 2:
@@ -343,13 +345,14 @@ class KalturaIE(InfoExtractor):
if '/playManifest/' in data_url:
m3u8_url = sign_url(data_url.replace(
'format/url', 'format/applehttp'))
- formats.extend(self._extract_m3u8_formats(
+ fmts, subs = self._extract_m3u8_formats_and_subtitles(
m3u8_url, entry_id, 'mp4', 'm3u8_native',
- m3u8_id='hls', fatal=False))
+ m3u8_id='hls', fatal=False)
+ formats.extend(fmts)
+ self._merge_subtitles(subs, target=subtitles)
self._sort_formats(formats)
- subtitles = {}
if captions:
for caption in captions.get('objects', []):
# Continue if caption is not ready
@@ -372,6 +375,6 @@ class KalturaIE(InfoExtractor):
'thumbnail': info.get('thumbnailUrl'),
'duration': info.get('duration'),
'timestamp': info.get('createdAt'),
- 'uploader_id': info.get('userId') if info.get('userId') != 'None' else None,
+ 'uploader_id': format_field(info, 'userId', ignore=('None', None)),
'view_count': info.get('plays'),
}