]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/youtube.py
[ie/youtube] Fix bug with `--extractor-retries inf` (#8328)
[yt-dlp.git] / yt_dlp / extractor / youtube.py
index b7ac3e9cc1cedd43c03bde250e158942c8ce584c..c5be366362eefa6ab723c3ef85d5e1fdc779f356 100644 (file)
@@ -947,7 +947,10 @@ def _extract_response(self, item_id, query, note='Downloading API JSON', headers
         icd_rm = next(icd_retries)
         main_retries = iter(self.RetryManager())
         main_rm = next(main_retries)
-        for _ in range(main_rm.retries + icd_rm.retries + 1):
+        # Manual retry loop for multiple RetryManagers
+        # The proper RetryManager MUST be advanced after an error
+        # and it's result MUST be checked if the manager is non fatal
+        while True:
             try:
                 response = self._call_api(
                     ep=ep, fatal=True, headers=headers,