import re
import json
-from urllib import unquote
from .common import InfoExtractor
from ..utils import (
compat_urllib_request,
compat_urllib_parse,
- compat_urllib_parse_urlparse
+ compat_urllib_parse_urlparse,
+ ExtractorError,
)
webpage = self._download_webpage(url, video_id)
+ if '<p class="title">Chyba konfigurace prohlížeče.</p>' not in webpage:
+ msg = self._html_search_regex(r'<p class="title">(.+?)</p>', webpage, 'error-message')
+ raise ExtractorError(msg.replace('<br />', ' '))
+
typ = self._html_search_regex(r'getPlaylistUrl\(\[\{"type":"(.+?)","id":".+?"\}\],', webpage, 'type')
episode_id = self._html_search_regex(r'getPlaylistUrl\(\[\{"type":".+?","id":"(.+?)"\}\],', webpage, 'episode_id')
playlistpage = self._download_webpage(req, video_id)
- req = compat_urllib_request.Request(unquote(json.loads(playlistpage)['url']))
+ req = compat_urllib_request.Request(compat_urllib_parse.unquote(json.loads(playlistpage)['url']))
req.add_header('Referer', url)
playlist = self._download_xml(req, video_id)