[brightcove:legacy] fall back to brightcove:new(#13912)

This commit is contained in:
Remita Amine 2018-10-15 17:54:38 +01:00
parent f0ee386851
commit ee5fe42e44

View file

@ -356,7 +356,9 @@ class BrightcoveLegacyIE(InfoExtractor):
def _extract_video_info(self, video_info): def _extract_video_info(self, video_info):
video_id = compat_str(video_info['id']) video_id = compat_str(video_info['id'])
publisher_id = video_info.get('publisherId') publisher_id = video_info.get('publisherId')
info = { info = {
'id': video_id, 'id': video_id,
'title': video_info['displayName'].strip(), 'title': video_info['displayName'].strip(),
@ -444,7 +446,15 @@ class BrightcoveLegacyIE(InfoExtractor):
else: else:
return ad_info return ad_info
if 'url' not in info and not info.get('formats'): if not info.get('url') and not info.get('formats'):
uploader_id = info.get('uploader_id')
if uploader_id:
info.update({
'_type': 'url',
'url': 'http://players.brightcove.net/%s/default_default/index.html?videoId=%s' % (uploader_id, video_id),
'ie_key': BrightcoveNewIE.ie_key(),
})
else:
raise ExtractorError('Unable to extract video url for %s' % video_id) raise ExtractorError('Unable to extract video url for %s' % video_id)
return info return info