Throw an error if no video formats are found
[youtube-dl] / 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