diff options
| author | Sergey M․ <dstftw@gmail.com> | 2017-02-19 03:53:23 +0700 | 
|---|---|---|
| committer | Sergey M <dstftw@gmail.com> | 2017-02-19 05:10:08 +0800 | 
| commit | 4248dad92bd87650c791194276296b148f668e68 (patch) | |
| tree | e4c26e41802f4119b67830a61976c39c494b377e /youtube_dl/extractor/srgssr.py | |
| parent | 0a840f584c3f1fedb6957c05587dec697143f2d5 (diff) | |
Improve geo bypass mechanism
* Rename options to preffixly match with --geo-verification-proxy
* Introduce _GEO_COUNTRIES for extractors
* Implement faking IP right away for sites with known geo restriction
Diffstat (limited to 'youtube_dl/extractor/srgssr.py')
| -rw-r--r-- | youtube_dl/extractor/srgssr.py | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/youtube_dl/extractor/srgssr.py b/youtube_dl/extractor/srgssr.py index a35a0a538..bb73eb1d5 100644 --- a/youtube_dl/extractor/srgssr.py +++ b/youtube_dl/extractor/srgssr.py @@ -14,7 +14,8 @@ from ..utils import (  class SRGSSRIE(InfoExtractor):      _VALID_URL = r'(?:https?://tp\.srgssr\.ch/p(?:/[^/]+)+\?urn=urn|srgssr):(?P<bu>srf|rts|rsi|rtr|swi):(?:[^:]+:)?(?P<type>video|audio):(?P<id>[0-9a-f\-]{36}|\d+)' -    _BYPASS_GEO = False +    _GEO_BYPASS = False +    _GEO_COUNTRIES = ['CH']      _ERRORS = {          'AGERATING12': 'To protect children under the age of 12, this video is only available between 8 p.m. and 6 a.m.', @@ -43,7 +44,8 @@ class SRGSSRIE(InfoExtractor):          if media_data.get('block') and media_data['block'] in self._ERRORS:              message = self._ERRORS[media_data['block']]              if media_data['block'] == 'GEOBLOCK': -                self.raise_geo_restricted(msg=message, countries=['CH']) +                self.raise_geo_restricted( +                    msg=message, countries=self._GEO_COUNTRIES)              raise ExtractorError(                  '%s said: %s' % (self.IE_NAME, message), expected=True) | 
