]> jfr.im git - yt-dlp.git/commitdiff
[extractor] Ignore errors in comment extraction when `-i` is given
authorpukkandan <redacted>
Thu, 2 Dec 2021 22:00:37 +0000 (03:30 +0530)
committerpukkandan <redacted>
Thu, 2 Dec 2021 22:16:04 +0000 (03:46 +0530)
Closes #1787

yt_dlp/extractor/common.py

index 597db63d1b90332685421854b2dfacecf0d1c850..2180f879ceef031a9e63beefa83a32823aa8e4f9 100644 (file)
@@ -3548,14 +3548,18 @@ def extract_comments(self, *args, **kwargs):
 
         def extractor():
             comments = []
+            interrupted = True
             try:
                 while True:
                     comments.append(next(generator))
-            except KeyboardInterrupt:
-                interrupted = True
-                self.to_screen('Interrupted by user')
             except StopIteration:
                 interrupted = False
+            except KeyboardInterrupt:
+                self.to_screen('Interrupted by user')
+            except Exception as e:
+                if self.get_param('ignoreerrors') is not True:
+                    raise
+                self._downloader.report_error(e)
             comment_count = len(comments)
             self.to_screen(f'Extracted {comment_count} comments')
             return {