aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2018-10-15 17:54:38 +0100
committerRemita Amine <remitamine@gmail.com>2018-10-15 17:54:38 +0100
commitee5fe42e442f04e1c9a388a46e0b4552be4a56d7 (patch)
treea2384f40e200b41e7826c81a5c239090b0f9e52d
parentf0ee386851bb0d53801a27dafbe4e8fee5b43d88 (diff)
downloadyoutube-dl-ee5fe42e442f04e1c9a388a46e0b4552be4a56d7.tar.xz
[brightcove:legacy] fall back to brightcove:new(#13912)
-rw-r--r--youtube_dl/extractor/brightcove.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py
index 14f9a14ed..5dbd71e12 100644
--- a/youtube_dl/extractor/brightcove.py
+++ b/youtube_dl/extractor/brightcove.py
@@ -356,7 +356,9 @@ class BrightcoveLegacyIE(InfoExtractor):
def _extract_video_info(self, video_info):
video_id = compat_str(video_info['id'])
+
publisher_id = video_info.get('publisherId')
+
info = {
'id': video_id,
'title': video_info['displayName'].strip(),
@@ -444,8 +446,16 @@ class BrightcoveLegacyIE(InfoExtractor):
else:
return ad_info
- if 'url' not in info and not info.get('formats'):
- raise ExtractorError('Unable to extract video url for %s' % video_id)
+ 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)
return info