Fix imports and general cleanup
[youtube-dl] / youtube_dl / extractor / ceskatelevize.py
index 5311602fb74a31bc1674d48b18f92c86bb916713..2f866f3ef925c8402f00a3c0f922cf530eaa2010 100644 (file)
@@ -2,13 +2,14 @@
 from __future__ import unicode_literals
 
 import re
-import json
 
 from .common import InfoExtractor
-from ..utils import (
+from ..compat import (
     compat_urllib_request,
     compat_urllib_parse,
     compat_urllib_parse_urlparse,
+)
+from ..utils import (
     ExtractorError,
 )
 
@@ -87,13 +88,13 @@ class CeskaTelevizeIE(InfoExtractor):
         req.add_header('X-Requested-With', 'XMLHttpRequest')
         req.add_header('Referer', url)
 
-        playlistpage = self._download_webpage(req, video_id)
+        playlistpage = self._download_json(req, video_id)
 
-        req = compat_urllib_request.Request(compat_urllib_parse.unquote(json.loads(playlistpage)['url']))
+        req = compat_urllib_request.Request(compat_urllib_parse.unquote(playlistpage['url']))
         req.add_header('Referer', url)
 
         playlist = self._download_xml(req, video_id)
-        
+
         formats = []
         for i in playlist.find('smilRoot/body'):
             if 'AD' not in i.attrib['id']: