projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6b097cf
)
[ivi] Raise GeoRestrictedError
author
Sergey M․
<dstftw@gmail.com>
Fri, 24 Feb 2017 03:52:41 +0000
(10:52 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Fri, 24 Feb 2017 03:54:39 +0000
(10:54 +0700)
youtube_dl/extractor/ivi.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/ivi.py
b/youtube_dl/extractor/ivi.py
index 3d3c15024457e30d2002a3ee19e6eeab8a29ee4d..cb51cef2d45f9096a50a4716874219abaae63642 100644
(file)
--- a/
youtube_dl/extractor/ivi.py
+++ b/
youtube_dl/extractor/ivi.py
@@
-16,6
+16,8
@@
class IviIE(InfoExtractor):
IE_DESC = 'ivi.ru'
IE_NAME = 'ivi'
_VALID_URL = r'https?://(?:www\.)?ivi\.ru/(?:watch/(?:[^/]+/)?|video/player\?.*?videoId=)(?P<id>\d+)'
IE_DESC = 'ivi.ru'
IE_NAME = 'ivi'
_VALID_URL = r'https?://(?:www\.)?ivi\.ru/(?:watch/(?:[^/]+/)?|video/player\?.*?videoId=)(?P<id>\d+)'
+ _GEO_BYPASS = False
+ _GEO_COUNTRIES = ['RU']
_TESTS = [
# Single movie
_TESTS = [
# Single movie
@@
-91,7
+93,11
@@
class IviIE(InfoExtractor):
if 'error' in video_json:
error = video_json['error']
if 'error' in video_json:
error = video_json['error']
- if error['origin'] == 'NoRedisValidData':
+ origin = error['origin']
+ if origin == 'NotAllowedForLocation':
+ self.raise_geo_restricted(
+ msg=error['message'], countries=self._GEO_COUNTRIES)
+ elif origin == 'NoRedisValidData':
raise ExtractorError('Video %s does not exist' % video_id, expected=True)
raise ExtractorError(
'Unable to download video %s: %s' % (video_id, error['message']),
raise ExtractorError('Video %s does not exist' % video_id, expected=True)
raise ExtractorError(
'Unable to download video %s: %s' % (video_id, error['message']),