aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/extractor/srgssr.py
diff options
context:
space:
mode:
authorRogério Brito <rbrito@ime.usp.br>2017-02-24 21:07:40 -0300
committerRogério Brito <rbrito@ime.usp.br>2017-02-24 21:07:40 -0300
commit4e090bc3ceacc4e3cd464d12ea97700e3acad37d (patch)
tree899b82420538d865e697fb071a03db254653e7c6 /youtube_dl/extractor/srgssr.py
parent575f75429e2e479957d006a26940f4a5a51347ce (diff)
downloadyoutube-dl-4e090bc3ceacc4e3cd464d12ea97700e3acad37d.zip
youtube-dl-4e090bc3ceacc4e3cd464d12ea97700e3acad37d.tar.gz
youtube-dl-4e090bc3ceacc4e3cd464d12ea97700e3acad37d.tar.bz2
New upstream version 2017.02.24.1
Diffstat (limited to 'youtube_dl/extractor/srgssr.py')
-rw-r--r--youtube_dl/extractor/srgssr.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/youtube_dl/extractor/srgssr.py b/youtube_dl/extractor/srgssr.py
index 319a48a..bb73eb1 100644
--- a/youtube_dl/extractor/srgssr.py
+++ b/youtube_dl/extractor/srgssr.py
@@ -14,6 +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+)'
+ _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.',
@@ -40,8 +42,12 @@ class SRGSSRIE(InfoExtractor):
media_id)[media_type.capitalize()]
if media_data.get('block') and media_data['block'] in self._ERRORS:
- raise ExtractorError('%s said: %s' % (
- self.IE_NAME, self._ERRORS[media_data['block']]), expected=True)
+ message = self._ERRORS[media_data['block']]
+ if media_data['block'] == 'GEOBLOCK':
+ self.raise_geo_restricted(
+ msg=message, countries=self._GEO_COUNTRIES)
+ raise ExtractorError(
+ '%s said: %s' % (self.IE_NAME, message), expected=True)
return media_data