aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/brightcove.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-01-22 00:21:27 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-01-22 00:21:27 +0100
commit6562df768d6af708a5aab6ed4964b250925e42b4 (patch)
treee09935cd995654cb3864e819747f33ab0f518243 /youtube_dl/extractor/brightcove.py
parent06769acd717191ed61ce639314975816a8f7969c (diff)
parent47917f24c499f7949b04a23c35459ca69adae62d (diff)
Merge branch 'master' of github.com:rg3/youtube-dl
Conflicts: youtube_dl/extractor/mtv.py
Diffstat (limited to 'youtube_dl/extractor/brightcove.py')
-rw-r--r--youtube_dl/extractor/brightcove.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py
index b873dc0d4..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)<object
(?:
- :[^>]+?class=([\'"])[^>]*?BrightcoveExperience.*?\1 |
+ [^>]+?class=([\'"])[^>]*?BrightcoveExperience.*?\1 |
[^>]*?>\s*<param\s+name="movie"\s+value="https?://[^/]*brightcove\.com/
).+?</object>''',
webpage)
@@ -230,6 +233,6 @@ class BrightcoveIE(InfoExtractor):
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