X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fbrightcove.py;h=443294e6f0550f67ca1802a52d012ca9b7ecfecf;hb=5ab772f09c65d258780a88ef44980619d67cd9ca;hp=e13c040f8bc24768d68ae13fa185ceaf0224d41d;hpb=d614aa40e35825e1cde7c92fc6092d226afe4898;p=youtube-dl diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py index e13c040f8..443294e6f 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) @@ -195,7 +198,7 @@ class BrightcoveIE(InfoExtractor): def _extract_video_info(self, video_info): info = { 'id': compat_str(video_info['id']), - 'title': video_info['displayName'], + 'title': video_info['displayName'].strip(), 'description': video_info.get('shortDescription'), 'thumbnail': video_info.get('videoStillURL') or video_info.get('thumbnailURL'), 'uploader': video_info.get('publisherName'),