mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-14 11:07:50 +01:00
[brightcove] Fix extraction of embedded videos
There was a leading ‘:’ in the regex. The ‘flashvars’ parameter is not always available.
This commit is contained in:
parent
d614aa40e3
commit
47917f24c4
@ -90,9 +90,12 @@ class BrightcoveIE(InfoExtractor):
|
|||||||
object_doc = xml.etree.ElementTree.fromstring(object_str)
|
object_doc = xml.etree.ElementTree.fromstring(object_str)
|
||||||
|
|
||||||
fv_el = find_xpath_attr(object_doc, './param', 'name', 'flashVars')
|
fv_el = find_xpath_attr(object_doc, './param', 'name', 'flashVars')
|
||||||
|
if fv_el is not None:
|
||||||
flashvars = dict(
|
flashvars = dict(
|
||||||
(k, v[0])
|
(k, v[0])
|
||||||
for k, v in compat_parse_qs(fv_el.attrib['value']).items())
|
for k, v in compat_parse_qs(fv_el.attrib['value']).items())
|
||||||
|
else:
|
||||||
|
flashvars = {}
|
||||||
|
|
||||||
def find_param(name):
|
def find_param(name):
|
||||||
if name in flashvars:
|
if name in flashvars:
|
||||||
@ -131,7 +134,7 @@ class BrightcoveIE(InfoExtractor):
|
|||||||
m_brightcove = re.search(
|
m_brightcove = re.search(
|
||||||
r'''(?sx)<object
|
r'''(?sx)<object
|
||||||
(?:
|
(?:
|
||||||
:[^>]+?class=([\'"])[^>]*?BrightcoveExperience.*?\1 |
|
[^>]+?class=([\'"])[^>]*?BrightcoveExperience.*?\1 |
|
||||||
[^>]*?>\s*<param\s+name="movie"\s+value="https?://[^/]*brightcove\.com/
|
[^>]*?>\s*<param\s+name="movie"\s+value="https?://[^/]*brightcove\.com/
|
||||||
).+?</object>''',
|
).+?</object>''',
|
||||||
webpage)
|
webpage)
|
||||||
|
Loading…
Reference in New Issue
Block a user