diff options
author | fnord <fnord@fnord.mobi> | 2015-06-13 06:09:44 -0500 |
---|---|---|
committer | fnord <fnord@fnord.mobi> | 2015-06-13 06:20:30 -0500 |
commit | b4e1576aee7cf18f5842714c87985ae0b72f1546 (patch) | |
tree | 4d61dcc07699725fc44898130a58d90d2f72c90a /youtube_dl/extractor | |
parent | 78e2b74bb945dc7f1724f7486405dd523486d634 (diff) | |
download | youtube-dl-b4e1576aee7cf18f5842714c87985ae0b72f1546.tar.xz |
Brightcove extractor: support customBC.createVideo(...); method
found in http://www.americanbar.org/groups/family_law.html and
http://america.aljazeera.com/watch/shows/america-tonight/2015/6/exclusive-hunting-isil-with-the-pkk.html
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/brightcove.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py index c1d4320e1..20a6ed965 100644 --- a/youtube_dl/extractor/brightcove.py +++ b/youtube_dl/extractor/brightcove.py @@ -188,7 +188,19 @@ class BrightcoveIE(InfoExtractor): [^>]*?>\s*<param\s+name="movie"\s+value="https?://[^/]*brightcove\.com/ ).+?>\s*</object>''', webpage) - return list(filter(None, [cls._build_brighcove_url(m) for m in matches])) + if matches: + return list(filter(None, [cls._build_brighcove_url(m) for m in matches])) + + custombcs = re.findall(r'customBC.\createVideo\((.+?)\);',webpage) + if custombcs: + urls = [] + for match in custombcs: + # brightcove playerkey begins with AQ and is 50 characters in length, + # however it's appended to itself in places, so truncate. + f = re.search(r'["\'](AQ[^"\']{48}).*?["\'](\d+)["\']', match) + if f: + urls.append('brightcove:playerKey='+f.group(1)+'&%40videoPlayer='+f.group(2)) + return urls def _real_extract(self, url): url, smuggled_data = unsmuggle_url(url, {}) |