mirror of
https://github.com/blackjack4494/yt-dlc.git
synced 2024-12-26 01:37:27 +00:00
[brightcove] Detect geoblocking
This commit is contained in:
parent
10eaeb20c5
commit
a5ed3e571e
1 changed files with 7 additions and 0 deletions
|
@ -206,6 +206,13 @@ class BrightcoveIE(InfoExtractor):
|
||||||
req.add_header('Referer', referer)
|
req.add_header('Referer', referer)
|
||||||
webpage = self._download_webpage(req, video_id)
|
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)
|
self.report_extraction(video_id)
|
||||||
info = self._search_regex(r'var experienceJSON = ({.*});', webpage, 'json')
|
info = self._search_regex(r'var experienceJSON = ({.*});', webpage, 'json')
|
||||||
info = json.loads(info)['data']
|
info = json.loads(info)['data']
|
||||||
|
|
Loading…
Reference in a new issue