[eagleplatform] return the code to handle errors in all _download_json requests
authorremitamine <remitamine@gmail.com>
Sat, 26 Sep 2015 16:37:30 +0000 (17:37 +0100)
committerSergey M․ <dstftw@gmail.com>
Sat, 26 Sep 2015 19:08:26 +0000 (01:08 +0600)
youtube_dl/extractor/eagleplatform.py

index 2987d52723a8f3f14812800fed1ea3717c1b8c3f..75cf73b256622cca62f28fd3bc9da2e9f74f98b8 100644 (file)
@@ -53,10 +53,13 @@ class EaglePlatformIE(InfoExtractor):
         if status != 200:
             raise ExtractorError(' '.join(response['errors']), expected=True)
 
-    def _get_video_url(self, url_or_request, video_id, note='Downloading JSON metadata'):
-        response = self._download_json(url_or_request, video_id, note)
+    def _download_json(self, url_or_request, video_id, note='Downloading JSON metadata'):
+        response = super(EaglePlatformIE, self)._download_json(url_or_request, video_id, note)
         self._handle_error(response)
-        return response['data'][0]
+        return response
+
+    def _get_video_url(self, url_or_request, video_id, note='Downloading JSON metadata'):
+        return self._download_json(url_or_request, video_id, note)['data'][0]
 
     def _real_extract(self, url):
         mobj = re.match(self._VALID_URL, url)