mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-12 14:26:49 +01:00
[postprocessor/common] Improve postprocessor args fetching and clarify doc
This commit is contained in:
parent
f72b0a6032
commit
e35b23f54d
@ -22,14 +22,15 @@ class PostProcessor(object):
|
|||||||
of the chain is reached.
|
of the chain is reached.
|
||||||
|
|
||||||
PostProcessor objects follow a "mutual registration" process similar
|
PostProcessor objects follow a "mutual registration" process similar
|
||||||
to InfoExtractor objects. And it can receive parameters from CLI trough
|
to InfoExtractor objects.
|
||||||
--postprocessor-args.
|
|
||||||
|
Optionally PostProcessor can use a list of additional command-line arguments
|
||||||
|
with self._configuration_args.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_downloader = None
|
_downloader = None
|
||||||
|
|
||||||
def __init__(self, downloader=None):
|
def __init__(self, downloader=None):
|
||||||
self._extra_cmd_args = downloader.params.get('postprocessor_args')
|
|
||||||
self._downloader = downloader
|
self._downloader = downloader
|
||||||
|
|
||||||
def set_downloader(self, downloader):
|
def set_downloader(self, downloader):
|
||||||
@ -59,6 +60,13 @@ def try_utime(self, path, atime, mtime, errnote='Cannot update utime of file'):
|
|||||||
except Exception:
|
except Exception:
|
||||||
self._downloader.report_warning(errnote)
|
self._downloader.report_warning(errnote)
|
||||||
|
|
||||||
|
def _configuration_args(self, default=[]):
|
||||||
|
pp_args = self._downloader.params.get('postprocessor_args')
|
||||||
|
if pp_args is None:
|
||||||
|
return default
|
||||||
|
assert isinstance(pp_args, list)
|
||||||
|
return pp_args
|
||||||
|
|
||||||
|
|
||||||
class AudioConversionError(PostProcessingError):
|
class AudioConversionError(PostProcessingError):
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user