diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-09-22 21:52:41 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-09-22 21:52:41 +0600 |
commit | cccedc1aa43f94ce4f8fa6f807a5301250c2213c (patch) | |
tree | 78108226079de1c497e2e19d296423e1ba4f7035 /youtube_dl | |
parent | c430802e32932868e24a6e43d0845df963320829 (diff) |
[voewster] Detect series geo restriction
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/viewster.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/youtube_dl/extractor/viewster.py b/youtube_dl/extractor/viewster.py index 8defc1800..f8f4143c6 100644 --- a/youtube_dl/extractor/viewster.py +++ b/youtube_dl/extractor/viewster.py @@ -3,12 +3,14 @@ from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( + compat_HTTPError, compat_urllib_request, compat_urllib_parse, compat_urllib_parse_unquote, ) from ..utils import ( determine_ext, + ExtractorError, int_or_none, parse_iso8601, HEADRequest, @@ -86,9 +88,15 @@ class ViewsterIE(InfoExtractor): # unfinished serie has no Type if info.get('Type') in ['Serie', None]: - episodes = self._download_json( - 'https://public-api.viewster.com/series/%s/episodes' % entry_id, - video_id, 'Downloading series JSON') + try: + episodes = self._download_json( + 'https://public-api.viewster.com/series/%s/episodes' % entry_id, + video_id, 'Downloading series JSON') + except ExtractorError as e: + if isinstance(e.cause, compat_HTTPError) and e.cause.code == 404: + self.raise_geo_restricted() + else: + raise entries = [ self.url_result( 'http://www.viewster.com/movie/%s' % episode['OriginId'], 'Viewster') |