Make "all-formats" and "best-quality" download the version without specific format too
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sat, 17 Apr 2010 15:54:37 +0000 (17:54 +0200)
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sun, 31 Oct 2010 10:27:01 +0000 (11:27 +0100)
youtube-dl

index 64f62e8a13d4b1cbf0266cdd45a72ab79da66212..d2bd0bf5f62d54ed9d394c22e9d939fb63480572 100755 (executable)
@@ -891,21 +891,18 @@ class YoutubeIE(InfoExtractor):
                                })
 
                                if all_formats:
-                                       if quality_index == len(self._available_formats) - 1:
+                                       if quality_index == len(self._available_formats):
                                                # None left to get
                                                return
                                        else:
                                                quality_index += 1
                                                format_param = self._available_formats[quality_index]
-                                               if format_param == None:
-                                                       return
                                                continue
-
                                return
 
                        except UnavailableFormatError, err:
                                if best_quality or all_formats:
-                                       if quality_index == len(self._available_formats) - 1:
+                                       if quality_index == len(self._available_formats):
                                                # I don't ever expect this to happen
                                                if not all_formats:
                                                        self._downloader.trouble(u'ERROR: no known formats available for video')
@@ -914,8 +911,6 @@ class YoutubeIE(InfoExtractor):
                                                self.report_unavailable_format(video_id, format_param)
                                                quality_index += 1
                                                format_param = self._available_formats[quality_index]
-                                               if format_param == None:
-                                                       return
                                                continue
                                else: 
                                        self._downloader.trouble('ERROR: format not available for video')