mirror of
https://github.com/yt-dlp/yt-dlp
synced 2024-12-28 22:24:34 +01:00
[extractor] Ignore errors in comment extraction when -i
is given
Closes #1787
This commit is contained in:
parent
63ccf4ff1a
commit
d2b2fca53f
1 changed files with 7 additions and 3 deletions
|
@ -3548,14 +3548,18 @@ class InfoExtractor(object):
|
||||||
|
|
||||||
def extractor():
|
def extractor():
|
||||||
comments = []
|
comments = []
|
||||||
|
interrupted = True
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
comments.append(next(generator))
|
comments.append(next(generator))
|
||||||
except KeyboardInterrupt:
|
|
||||||
interrupted = True
|
|
||||||
self.to_screen('Interrupted by user')
|
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
interrupted = False
|
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)
|
comment_count = len(comments)
|
||||||
self.to_screen(f'Extracted {comment_count} comments')
|
self.to_screen(f'Extracted {comment_count} comments')
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue