projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
10eaeb2
)
[brightcove] Detect geoblocking
author
Philipp Hagemeister
<phihag@phihag.de>
Sun, 24 Aug 2014 00:40:26 +0000
(
02:40
+0200)
committer
Philipp Hagemeister
<phihag@phihag.de>
Sun, 24 Aug 2014 00:40:26 +0000
(
02:40
+0200)
youtube_dl/extractor/brightcove.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/brightcove.py
b/youtube_dl/extractor/brightcove.py
index eb102244a6cf15e52f9553dbfda4db413a799c58..7aa8a7654ddd439e85fecdd687d672c2877ed9c3 100644
(file)
--- a/
youtube_dl/extractor/brightcove.py
+++ b/
youtube_dl/extractor/brightcove.py
@@
-206,6
+206,13
@@
class BrightcoveIE(InfoExtractor):
req.add_header('Referer', referer)
webpage = self._download_webpage(req, video_id)
+ error_msg = self._html_search_regex(
+ r"<h1>We're sorry.</h1>\s*<p>(.*?)</p>", webpage,
+ 'error message', default=None)
+ if error_msg is not None:
+ raise ExtractorError(
+ 'brightcove said: %s' % error_msg, expected=True)
+
self.report_extraction(video_id)
info = self._search_regex(r'var experienceJSON = ({.*});', webpage, 'json')
info = json.loads(info)['data']