mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 09:20:36 +00:00
[brightcove:new] Raise GeoRestrictedError
This commit is contained in:
parent
692fa200ca
commit
d02d4fa0a9
@ -544,8 +544,10 @@ def _real_extract(self, url):
|
|||||||
except ExtractorError as e:
|
except ExtractorError as e:
|
||||||
if isinstance(e.cause, compat_HTTPError) and e.cause.code == 403:
|
if isinstance(e.cause, compat_HTTPError) and e.cause.code == 403:
|
||||||
json_data = self._parse_json(e.cause.read().decode(), video_id)[0]
|
json_data = self._parse_json(e.cause.read().decode(), video_id)[0]
|
||||||
raise ExtractorError(
|
message = json_data.get('message') or json_data['error_code']
|
||||||
json_data.get('message') or json_data['error_code'], expected=True)
|
if json_data.get('error_subcode') == 'CLIENT_GEO':
|
||||||
|
self.raise_geo_restricted(msg=message)
|
||||||
|
raise ExtractorError(message, expected=True)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
title = json_data['name'].strip()
|
title = json_data['name'].strip()
|
||||||
|
Loading…
Reference in New Issue
Block a user