瀏覽代碼

Fix for all-formats exception by Valentin Hilbig

Ricardo Garcia 15 年之前
父節點
當前提交
896a6ea9e2
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      youtube-dl

+ 2 - 2
youtube-dl

@@ -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: