Separate the options --ignore-errors and --no-abort-on-error

In youtube-dl, `-i` ignores both download and post-processing error, and
treats the download as successful even if the post-processor fails.

yt-dlp used to skip the entire video on either error and there was no
option to ignore the post-processing errors like youtube-dl does.

By splitting the option into two, now either just the download errors
(--no-abort-on-error, default on CLI) or all errors (--ignore-errors)
can be ignored as per the users' needs

Closes #893
This commit is contained in:
pukkandan
2021-09-24 05:51:54 +05:30
parent 1f8471e22c
commit b19404591a
7 changed files with 32 additions and 19 deletions

View File

@@ -52,6 +52,7 @@ class PostProcessor(object):
return self._downloader.report_warning(text, *args, **kwargs)
def report_error(self, text, *args, **kwargs):
# Exists only for compatibility. Do not use
if self._downloader:
return self._downloader.report_error(text, *args, **kwargs)

View File

@@ -288,8 +288,7 @@ class FFmpegPostProcessor(PostProcessor):
stdout, stderr = process_communicate_or_kill(p)
if p.returncode not in variadic(expected_retcodes):
stderr = stderr.decode('utf-8', 'replace').strip()
if self.get_param('verbose', False):
self.report_error(stderr)
self.write_debug(stderr)
raise FFmpegPostProcessorError(stderr.split('\n')[-1])
for out_path, _ in output_path_opts:
if out_path:

View File

@@ -57,8 +57,7 @@ class XAttrMetadataPP(PostProcessor):
return [], info
except XAttrUnavailableError as e:
self.report_error(str(e))
return [], info
raise PostProcessingError(str(e))
except XAttrMetadataError as e:
if e.reason == 'NO_SPACE':
@@ -74,5 +73,5 @@ class XAttrMetadataPP(PostProcessor):
msg += 'You need to use NTFS.'
else:
msg += '(You may have to enable them in your /etc/fstab)'
self.report_error(msg)
raise PostProcessingError(str(e))
return [], info