X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fiprima.py;h=8529bedfc0ab283790e74144bc9d570df19dc4b3;hb=ca57a598838f7d945a09a1df569e1c29fdd0732b;hp=7956e7624db36d74cd4120c1764d0190f8d1dff5;hpb=3cfe79147359c2e9ecbb20caf1e77655dfcf75d1;p=youtube-dl diff --git a/youtube_dl/extractor/iprima.py b/youtube_dl/extractor/iprima.py index 7956e7624..8529bedfc 100644 --- a/youtube_dl/extractor/iprima.py +++ b/youtube_dl/extractor/iprima.py @@ -6,7 +6,12 @@ from random import random from math import floor from .common import InfoExtractor -from ..utils import compat_urllib_request +from ..compat import ( + compat_urllib_request, +) +from ..utils import ( + ExtractorError, +) class IPrimaIE(InfoExtractor): @@ -36,6 +41,7 @@ class IPrimaIE(InfoExtractor): 'params': { 'skip_download': True, # requires rtmpdump }, + 'skip': 'Do not have permission to access this page', }] def _real_extract(self, url): @@ -44,9 +50,13 @@ 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*', 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)) + (floor(random() * 1073741824), floor(random() * 1073741824)) ) req = compat_urllib_request.Request(player_url)