[nfb] Add support for videos with captions (#2866)

This commit is contained in:
Sergey M․ 2014-05-08 22:07:14 +07:00
parent 5c9f3b8b16
commit f71959fcf5
1 changed files with 10 additions and 8 deletions

View File

@ -73,14 +73,16 @@ class NFBIE(InfoExtractor):
title = media.find('title').text
description = media.find('description').text
# It seems assets always go from lower to better quality, so no need to sort
formats = [{
'url': x.find('default/streamerURI').text,
'app': x.find('default/streamerURI').text.split('/', 3)[3],
'play_path': x.find('default/url').text,
'rtmp_live': False,
'ext': 'mp4',
'format_id': x.get('quality'),
} for x in media.findall('assets/asset')]
for asset in media.findall('assets/asset'):
for x in asset:
formats.append({
'url': x.find('streamerURI').text,
'app': x.find('streamerURI').text.split('/', 3)[3],
'play_path': x.find('url').text,
'rtmp_live': False,
'ext': 'mp4',
'format_id': '%s-%s' % (x.tag, asset.get('quality')),
})
return {
'id': video_id,