Fix for all-formats exception by Valentin Hilbig
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sun, 30 May 2010 15:50:56 +0000 (17:50 +0200)
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sun, 31 Oct 2010 10:28:10 +0000 (11:28 +0100)
youtube-dl

index b21e63b054bb33641e180e10504395f27f2ddadd..514f71aa643883a333694b561adae42118162db2 100755 (executable)
@@ -927,17 +927,18 @@ class YoutubeIE(InfoExtractor):
                                })
 
                                if all_formats:
+                                       quality_index += 1
                                        if quality_index == len(self._available_formats):
                                                # None left to get
                                                return
                                        else:
-                                               quality_index += 1
                                                format_param = self._available_formats[quality_index]
                                                continue
                                return
 
                        except UnavailableFormatError, err:
                                if best_quality or all_formats:
+                                       quality_index += 1
                                        if quality_index == len(self._available_formats):
                                                # I don't ever expect this to happen
                                                if not all_formats:
@@ -945,7 +946,6 @@ class YoutubeIE(InfoExtractor):
                                                return
                                        else:
                                                self.report_unavailable_format(video_id, format_param)
-                                               quality_index += 1
                                                format_param = self._available_formats[quality_index]
                                                continue
                                else: