Throw an error if no video formats are found
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 27 Jan 2014 06:31:54 +0000 (07:31 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 27 Jan 2014 06:31:54 +0000 (07:31 +0100)
youtube_dl/extractor/common.py

index db1ca9edb446568479d3770604b42ae66c2ddd75..f7478d4598e8f15ea802ec9451aff53ce452fe7a 100644 (file)
@@ -466,6 +466,9 @@ class InfoExtractor(object):
         return RATING_TABLE.get(rating.lower(), None)
 
     def _sort_formats(self, formats):
+        if not formats:
+            raise ExtractorError(u'No video formats found')
+
         def _formats_key(f):
             # TODO remove the following workaround
             from ..utils import determine_ext