aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-07-11 22:41:33 +0600
committerSergey M․ <dstftw@gmail.com>2015-07-11 22:41:33 +0600
commite35b23f54df83886dd14428b618aa9d0221968ad (patch)
treeecaa1b75f0a9aaf712c24f63cc4bb2c6d1362337
parentf72b0a603270dff0fdd72dd5218126790232199a (diff)
[postprocessor/common] Improve postprocessor args fetching and clarify doc
-rw-r--r--youtube_dl/postprocessor/common.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/youtube_dl/postprocessor/common.py b/youtube_dl/postprocessor/common.py
index bee64c457..4191d040b 100644
--- a/youtube_dl/postprocessor/common.py
+++ b/youtube_dl/postprocessor/common.py
@@ -22,14 +22,15 @@ class PostProcessor(object):
of the chain is reached.
PostProcessor objects follow a "mutual registration" process similar
- to InfoExtractor objects. And it can receive parameters from CLI trough
- --postprocessor-args.
+ to InfoExtractor objects.
+
+ Optionally PostProcessor can use a list of additional command-line arguments
+ with self._configuration_args.
"""
_downloader = None
def __init__(self, downloader=None):
- self._extra_cmd_args = downloader.params.get('postprocessor_args')
self._downloader = downloader
def set_downloader(self, downloader):
@@ -59,6 +60,13 @@ class PostProcessor(object):
except Exception:
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):
pass