[brightcove] Support alternative BrightcoveExperience layout
authorYen Chi Hsuan <yan12125@gmail.com>
Fri, 25 Mar 2016 08:17:54 +0000 (16:17 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sat, 26 Mar 2016 09:47:32 +0000 (17:47 +0800)
The full URL lays in the `data` attribute of <object> (#8862)

youtube_dl/extractor/brightcove.py

index 59e8008f96877573aad2acc26fe8bfcb42f9e69c..afe081d82c93c100b6ccc45643d6f8b9afbc36c3 100644 (file)
@@ -136,13 +136,16 @@ class BrightcoveLegacyIE(InfoExtractor):
         else:
             flashvars = {}
 
+        data_url = object_doc.attrib.get('data', '')
+        data_url_params = compat_parse_qs(compat_urllib_parse_urlparse(data_url).query)
+
         def find_param(name):
             if name in flashvars:
                 return flashvars[name]
             node = find_xpath_attr(object_doc, './param', 'name', name)
             if node is not None:
                 return node.attrib['value']
-            return None
+            return data_url_params.get(name)
 
         params = {}