diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-11-23 23:26:06 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-11-23 23:27:15 +0100 |
commit | 36de0a0e1a49f6324616f9b508920ff7d06136c2 (patch) | |
tree | 7d553b05bb055ddb2d59dcda0744cfdab1297044 /youtube_dl/extractor/brightcove.py | |
parent | e5c146d58682dbdda2b46fc71a16ddc5b1fcc9fc (diff) | |
download | youtube-dl-36de0a0e1a49f6324616f9b508920ff7d06136c2.zip youtube-dl-36de0a0e1a49f6324616f9b508920ff7d06136c2.tar.gz youtube-dl-36de0a0e1a49f6324616f9b508920ff7d06136c2.tar.bz2 |
[brightcove] Set the 'videoPlayer' value to the 'videoId' if it's missing in the parameters (fixes #1815)
Diffstat (limited to 'youtube_dl/extractor/brightcove.py')
-rw-r--r-- | youtube_dl/extractor/brightcove.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py index d8c3546..74a7d13 100644 --- a/youtube_dl/extractor/brightcove.py +++ b/youtube_dl/extractor/brightcove.py @@ -75,14 +75,17 @@ class BrightcoveIE(InfoExtractor): params = {'flashID': object_doc.attrib['id'], 'playerID': find_xpath_attr(object_doc, './param', 'name', 'playerID').attrib['value'], } - playerKey = find_xpath_attr(object_doc, './param', 'name', 'playerKey') + def find_param(name): + return find_xpath_attr(object_doc, './param', 'name', name) + playerKey = find_param('playerKey') # Not all pages define this value if playerKey is not None: params['playerKey'] = playerKey.attrib['value'] - videoPlayer = find_xpath_attr(object_doc, './param', 'name', '@videoPlayer') + # The three fields hold the id of the video + videoPlayer = find_param('@videoPlayer') or find_param('videoId') or find_param('videoID') if videoPlayer is not None: params['@videoPlayer'] = videoPlayer.attrib['value'] - linkBase = find_xpath_attr(object_doc, './param', 'name', 'linkBaseURL') + linkBase = find_param('linkBaseURL') if linkBase is not None: params['linkBaseURL'] = linkBase.attrib['value'] data = compat_urllib_parse.urlencode(params) |