]> gitweb @ CieloNegro.org - youtube-dl.git/blobdiff - youtube_dl/extractor/escapist.py
[bbccouk] Mute thumbnail
[youtube-dl.git] / youtube_dl / extractor / escapist.py
index a01a05b0644ea455b38efd5fcbafb1acea495511..8facf11858fefe48490f4b40e1129c0c45d36b06 100644 (file)
@@ -65,7 +65,10 @@ class EscapistIE(InfoExtractor):
         video_id = self._match_id(url)
         webpage = self._download_webpage(url, video_id)
 
-        imsVideo = json.loads(self._search_regex(r'imsVideo\.play\(([^\)]+)\);', webpage, 'imsVideo'))
+        imsVideo = self._parse_json(
+            self._search_regex(
+                r'imsVideo\.play\(({.+?})\);', webpage, 'imsVideo'),
+            video_id)
         video_id = imsVideo['videoID']
         key = imsVideo['hash']
 
@@ -73,7 +76,8 @@ class EscapistIE(InfoExtractor):
 
         formats = []
         for q in ['lq', 'hq', 'hd']:
-            config_req = compat_urllib_request.Request('http://www.escapistmagazine.com/videos/'
+            config_req = compat_urllib_request.Request(
+                'http://www.escapistmagazine.com/videos/'
                 'vidconfig.php?videoID=%s&hash=%s&quality=%s' % (video_id, key, 'mp4_' + q))
             config_req.add_header('Referer', url)
             config = self._download_webpage(config_req, video_id, 'Downloading video config ' + q.upper())
@@ -89,8 +93,7 @@ class EscapistIE(InfoExtractor):
                     'url': v,
                     'format_id': determine_ext(v) + '_' + q + str(i),
                     'quality': quality(q),
-                    })
-
+                })
 
         return {
             'id': video_id,