projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[instagram] Add support for user profiles (Fixes #2606)
[youtube-dl]
/
youtube_dl
/
extractor
/
brightcove.py
diff --git
a/youtube_dl/extractor/brightcove.py
b/youtube_dl/extractor/brightcove.py
index 9ccf923a63fbd59b098f2e0edb15c025c5d0b602..83eec84d3cd446b75854accd8dd8c2c754ba4349 100644
(file)
--- a/
youtube_dl/extractor/brightcove.py
+++ b/
youtube_dl/extractor/brightcove.py
@@
-17,6
+17,7
@@
from ..utils import (
ExtractorError,
unsmuggle_url,
ExtractorError,
unsmuggle_url,
+ unescapeHTML,
)
)
@@
-127,25
+128,28
@@
class BrightcoveIE(InfoExtractor):
@classmethod
def _extract_brightcove_url(cls, webpage):
@classmethod
def _extract_brightcove_url(cls, webpage):
- """Try to extract the brightcove url from the we
pb
age, returns None
+ """Try to extract the brightcove url from the we
bp
age, returns None
if it can't be found
"""
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'<meta\s+property="og:video"\s+content="(http://c.brightcove.com/[^"]+)"', webpage)
if url_m:
url_m = re.search(r'<meta\s+property="og:video"\s+content="(http://c.brightcove.com/[^"]+)"', webpage)
if url_m:
- return
url_m.group(1)
+ return
[unescapeHTML(url_m.group(1))]
- m
_brightcove = re.search
(
+ m
atches = re.findall
(
r'''(?sx)<object
(?:
r'''(?sx)<object
(?:
- [^>]+?class=
([\'"])[^>]*?BrightcoveExperience.*?\1
|
+ [^>]+?class=
[\'"][^>]*?BrightcoveExperience.*?[\'"]
|
[^>]*?>\s*<param\s+name="movie"\s+value="https?://[^/]*brightcove\.com/
).+?</object>''',
webpage)
[^>]*?>\s*<param\s+name="movie"\s+value="https?://[^/]*brightcove\.com/
).+?</object>''',
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, {})
def _real_extract(self, url):
url, smuggled_data = unsmuggle_url(url, {})