summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPhilipp Hagemeister <[email protected]>2014-08-24 02:40:26 +0200
committerPhilipp Hagemeister <[email protected]>2014-08-24 02:40:26 +0200
commita5ed3e571eea337b012dd5770472197c1cb6894b (patch)
treefbb7f565185eccb805b003ab7e61e5cf1988fd34
parent10eaeb20c5bff78444b4f38098dd8ef89e29cba4 (diff)
downloadyoutube-dl-a5ed3e571eea337b012dd5770472197c1cb6894b.tar.gz
youtube-dl-a5ed3e571eea337b012dd5770472197c1cb6894b.zip
[brightcove] Detect geoblocking
-rw-r--r--youtube_dl/extractor/brightcove.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py
index eb102244a..7aa8a7654 100644
--- 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']