From: Jaime Marquínez Ferrándiz Date: Tue, 21 Jan 2014 21:04:46 +0000 (+0100) Subject: [brightcove] Fix extraction of embedded videos X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=47917f24c499f7949b04a23c35459ca69adae62d;p=youtube-dl.git [brightcove] Fix extraction of embedded videos There was a leading ‘:’ in the regex. The ‘flashvars’ parameter is not always available. --- diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py index e13c040f8..e1c45d1f0 100644 --- a/youtube_dl/extractor/brightcove.py +++ b/youtube_dl/extractor/brightcove.py @@ -90,9 +90,12 @@ class BrightcoveIE(InfoExtractor): object_doc = xml.etree.ElementTree.fromstring(object_str) fv_el = find_xpath_attr(object_doc, './param', 'name', 'flashVars') - flashvars = dict( - (k, v[0]) - for k, v in compat_parse_qs(fv_el.attrib['value']).items()) + if fv_el is not None: + flashvars = dict( + (k, v[0]) + for k, v in compat_parse_qs(fv_el.attrib['value']).items()) + else: + flashvars = {} def find_param(name): if name in flashvars: @@ -131,7 +134,7 @@ class BrightcoveIE(InfoExtractor): m_brightcove = re.search( r'''(?sx)]+?class=([\'"])[^>]*?BrightcoveExperience.*?\1 | + [^>]+?class=([\'"])[^>]*?BrightcoveExperience.*?\1 | [^>]*?>\s*''', webpage)