projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
692fa20
)
[brightcove:new] Raise GeoRestrictedError
author
Sergey M․
<dstftw@gmail.com>
Fri, 3 Mar 2017 15:49:48 +0000
(22:49 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Fri, 3 Mar 2017 15:49:48 +0000
(22:49 +0700)
youtube_dl/extractor/brightcove.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/brightcove.py
b/youtube_dl/extractor/brightcove.py
index 27685eed0188312154463066293018496e875e5c..f8605be82f0ab5453836ec9497ef9b8700be0e97 100644
(file)
--- 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]
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()
raise
title = json_data['name'].strip()