]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
raise ExtractorError instead of calling back
authorPhilipp Hagemeister <phihag@phihag.de>
Sat, 4 May 2013 06:38:28 +0000 (08:38 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Sat, 4 May 2013 06:38:28 +0000 (08:38 +0200)
youtube_dl/InfoExtractors.py

index 79182208df55bc51a9388c843d5a0b68b577e077..568bca70200b89bc6268a2adc505a0243924c743 100755 (executable)
@@ -3322,8 +3322,7 @@ class JustinTVIE(InfoExtractor):
         response = json.loads(webpage)
         if type(response) != list:
             error_text = response.get('error', 'unknown error')
-            self._downloader.report_error(u'Justin.tv API: %s' % error_text)
-            return
+            raise ExtractorError(u'Justin.tv API: %s' % error_text)
         info = []
         for clip in response:
             video_url = clip['video_file_url']
@@ -3382,8 +3381,7 @@ class FunnyOrDieIE(InfoExtractor):
     def _real_extract(self, url):
         mobj = re.match(self._VALID_URL, url)
         if mobj is None:
-            self._downloader.report_error(u'invalid URL: %s' % url)
-            return
+            raise ExtractorError(u'invalid URL: %s' % url)
 
         video_id = mobj.group('id')
         webpage = self._download_webpage(url, video_id)