diff options
author | Sergey M․ <dstftw@gmail.com> | 2017-03-03 22:49:48 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2017-03-03 22:49:48 +0700 |
commit | d02d4fa0a90f3182d65504508105e8d86886c6ec (patch) | |
tree | b18b85ef11ebf40b5bdc59bb45b80cd850491392 /youtube_dl/extractor | |
parent | 692fa200cae38a7e37f646118a268ad408c8ab95 (diff) |
[brightcove:new] Raise GeoRestrictedError
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/brightcove.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py index 27685eed0..f8605be82 100644 --- a/youtube_dl/extractor/brightcove.py +++ b/youtube_dl/extractor/brightcove.py @@ -544,8 +544,10 @@ class BrightcoveNewIE(InfoExtractor): except ExtractorError as e: if isinstance(e.cause, compat_HTTPError) and e.cause.code == 403: json_data = self._parse_json(e.cause.read().decode(), video_id)[0] - raise ExtractorError( - json_data.get('message') or json_data['error_code'], expected=True) + message = json_data.get('message') or json_data['error_code'] + if json_data.get('error_subcode') == 'CLIENT_GEO': + self.raise_geo_restricted(msg=message) + raise ExtractorError(message, expected=True) raise title = json_data['name'].strip() |