diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-12-03 03:30:37 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-12-03 03:46:04 +0530 |
commit | d2b2fca53f635986918e364ee5b564d8e7d8af7e (patch) | |
tree | b477b50b64bb1500c2968aa43251ca3a8a701d60 | |
parent | 63ccf4ff1a953e1b2a9422406cf8ad3f8aae4cbc (diff) | |
download | hypervideo-pre-d2b2fca53f635986918e364ee5b564d8e7d8af7e.tar.lz hypervideo-pre-d2b2fca53f635986918e364ee5b564d8e7d8af7e.tar.xz hypervideo-pre-d2b2fca53f635986918e364ee5b564d8e7d8af7e.zip |
[extractor] Ignore errors in comment extraction when `-i` is given
Closes #1787
-rw-r--r-- | yt_dlp/extractor/common.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 597db63d1..2180f879c 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -3548,14 +3548,18 @@ class InfoExtractor(object): 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 { |