diff options
author | Sergey M․ <dstftw@gmail.com> | 2014-03-15 01:38:44 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2014-03-15 01:38:44 +0700 |
commit | 826422351152e0e0840bca737bdaccc238d423fd (patch) | |
tree | a401588bd0d3c846419001768bf82f4d8d972c5a /youtube_dl/extractor | |
parent | bc6d5978284599fdc9a3ea5cc2c3d30883a8fdc0 (diff) |
[iprima] Add access permission check
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/iprima.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/youtube_dl/extractor/iprima.py b/youtube_dl/extractor/iprima.py index 7956e7624..6ca0e9122 100644 --- a/youtube_dl/extractor/iprima.py +++ b/youtube_dl/extractor/iprima.py @@ -6,7 +6,10 @@ from random import random from math import floor from .common import InfoExtractor -from ..utils import compat_urllib_request +from ..utils import ( + compat_urllib_request, + ExtractorError, +) class IPrimaIE(InfoExtractor): @@ -44,6 +47,10 @@ class IPrimaIE(InfoExtractor): webpage = self._download_webpage(url, video_id) + if re.search(r'Nemáte oprávnění přistupovat na tuto stránku.\s*</div>', webpage): + raise ExtractorError( + '%s said: You do not have permission to access this page' % self.IE_NAME, expected=True) + player_url = ( 'http://embed.livebox.cz/iprimaplay/player-embed-v2.js?__tok%s__=%s' % (floor(random()*1073741824), floor(random()*1073741824)) |