projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
01b1aa9
)
[pbs] Improve geo restriction detection and use geo bypass mechanism
author
Sergey M․
<dstftw@gmail.com>
Sat, 4 Feb 2017 11:52:20 +0000
(18:52 +0700)
committer
Sergey M
<dstftw@gmail.com>
Sat, 18 Feb 2017 21:10:08 +0000
(
05:10
+0800)
youtube_dl/extractor/pbs.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/pbs.py
b/youtube_dl/extractor/pbs.py
index 6baed773fc6bf741a69f1baf222148065ef169c4..64f47bae303addd16573a36348d61aa08c133dd7 100644
(file)
--- a/
youtube_dl/extractor/pbs.py
+++ b/
youtube_dl/extractor/pbs.py
@@
-489,11
+489,12
@@
class PBSIE(InfoExtractor):
headers=self.geo_verification_headers())
if redirect_info['status'] == 'error':
headers=self.geo_verification_headers())
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' % (
- self.IE_NAME,
- self._ERRORS.get(redirect_info['http_code'], redirect_info['message'])),
- expected=True)
+ '%s said: %s' % (self.IE_NAME, message), expected=True)
format_url = redirect_info.get('url')
if not format_url:
format_url = redirect_info.get('url')
if not format_url: