Browse Source

[brightcove:new] Raise GeoRestrictedError

master-ytdl-org
Sergey M․ 8 years ago
parent
commit
d02d4fa0a9
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      youtube_dl/extractor/brightcove.py

+ 4
- 2
youtube_dl/extractor/brightcove.py View File

@ -544,8 +544,10 @@ class BrightcoveNewIE(InfoExtractor):
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(
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 raise
title = json_data['name'].strip() title = json_data['name'].strip()


Loading…
Cancel
Save