diff options
author | Sergey M․ <dstftw@gmail.com> | 2017-02-04 18:51:33 +0700 |
---|---|---|
committer | Sergey M <dstftw@gmail.com> | 2017-02-19 05:10:08 +0800 |
commit | e633f21a96f37a96e8ef0fd4d6c1e4d3c0b41fbf (patch) | |
tree | f4eabc884cda905bbed4457af597ecee178a1b3a /youtube_dl/extractor/go.py | |
parent | d392005a795a6cf85fda3c0f982254f8a2731e94 (diff) |
[go] Improve geo restriction detection and use geo bypass mechanism
Diffstat (limited to 'youtube_dl/extractor/go.py')
-rw-r--r-- | youtube_dl/extractor/go.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube_dl/extractor/go.py b/youtube_dl/extractor/go.py index f28e6fbf5..ec902c670 100644 --- a/youtube_dl/extractor/go.py +++ b/youtube_dl/extractor/go.py @@ -101,6 +101,10 @@ class GoIE(AdobePassIE): video_id, data=urlencode_postdata(data), headers=self.geo_verification_headers()) errors = entitlement.get('errors', {}).get('errors', []) if errors: + for error in errors: + if error.get('code') == 1002: + self.raise_geo_restricted( + error['message'], countries=['US']) error_message = ', '.join([error['message'] for error in errors]) raise ExtractorError('%s said: %s' % (self.IE_NAME, error_message), expected=True) asset_url += '?' + entitlement['uplynkData']['sessionKey'] |