X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fbrightcove.py;h=83eec84d3cd446b75854accd8dd8c2c754ba4349;hb=2d73b4580583dfefd80cfd39c0c8de11b1bb30ee;hp=9ccf923a63fbd59b098f2e0edb15c025c5d0b602;hpb=c0c2ddddcdbc524c04437e73b5b3f8220393aaa4;p=youtube-dl.git
diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py
index 9ccf923a6..83eec84d3 100644
--- a/youtube_dl/extractor/brightcove.py
+++ b/youtube_dl/extractor/brightcove.py
@@ -17,6 +17,7 @@ from ..utils import (
ExtractorError,
unsmuggle_url,
+ unescapeHTML,
)
@@ -127,25 +128,28 @@ class BrightcoveIE(InfoExtractor):
@classmethod
def _extract_brightcove_url(cls, webpage):
- """Try to extract the brightcove url from the wepbage, returns None
+ """Try to extract the brightcove url from the webpage, returns None
if it can't be found
"""
+ urls = cls._extract_brightcove_urls(webpage)
+ return urls[0] if urls else None
+
+ @classmethod
+ def _extract_brightcove_urls(cls, webpage):
+ """Return a list of all Brightcove URLs from the webpage """
url_m = re.search(r']+?class=([\'"])[^>]*?BrightcoveExperience.*?\1 |
+ [^>]+?class=[\'"][^>]*?BrightcoveExperience.*?[\'"] |
[^>]*?>\s*''',
webpage)
- if m_brightcove is not None:
- return cls._build_brighcove_url(m_brightcove.group())
- else:
- return None
+ return [cls._build_brighcove_url(m) for m in matches]
def _real_extract(self, url):
url, smuggled_data = unsmuggle_url(url, {})