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:
m_brightcove = re.search(
r'''(?sx)<object
(?:
- :[^>]+?class=([\'"])[^>]*?BrightcoveExperience.*?\1 |
+ [^>]+?class=([\'"])[^>]*?BrightcoveExperience.*?\1 |
[^>]*?>\s*<param\s+name="movie"\s+value="https?://[^/]*brightcove\.com/
).+?</object>''',
webpage)
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'),
else:
return ad_info
- if 'url' not in info:
+ if 'url' not in info and not info.get('formats'):
raise ExtractorError('Unable to extract video url for %s' % info['id'])
return info