mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 16:42:57 +01:00
[pbs] Improve geo restriction detection and use geo bypass mechanism
This commit is contained in:
parent
01b1aa9ff4
commit
8ab8066cf0
@ -489,11 +489,12 @@ def extract_redirect_urls(info):
|
|||||||
headers=self.geo_verification_headers())
|
headers=self.geo_verification_headers())
|
||||||
|
|
||||||
if redirect_info['status'] == 'error':
|
if redirect_info['status'] == 'error':
|
||||||
|
message = self._ERRORS.get(
|
||||||
|
redirect_info['http_code'], redirect_info['message'])
|
||||||
|
if redirect_info['http_code'] == 403:
|
||||||
|
self.raise_geo_restricted(msg=message, countries=['US'])
|
||||||
raise ExtractorError(
|
raise ExtractorError(
|
||||||
'%s said: %s' % (
|
'%s said: %s' % (self.IE_NAME, message), expected=True)
|
||||||
self.IE_NAME,
|
|
||||||
self._ERRORS.get(redirect_info['http_code'], redirect_info['message'])),
|
|
||||||
expected=True)
|
|
||||||
|
|
||||||
format_url = redirect_info.get('url')
|
format_url = redirect_info.get('url')
|
||||||
if not format_url:
|
if not format_url:
|
||||||
|
Loading…
Reference in New Issue
Block a user