get_executable_path,
OUTTMPL_TYPES,
preferredencoding,
+ remove_end,
write_string,
)
from .cookies import SUPPORTED_BROWSERS
'--no-force-keyframes-at-cuts',
action='store_false', dest='force_keyframes_at_cuts',
help='Do not force keyframes around the chapters when cutting/splitting (default)')
+ _postprocessor_opts_parser = lambda key, val='': (
+ *(item.split('=', 1) for item in (val.split(';') if val else [])),
+ ('key', remove_end(key, 'PP')))
+ postproc.add_option(
+ '--use-postprocessor',
+ metavar='NAME[:ARGS]', dest='add_postprocessors', default=[], type='str',
+ action='callback', callback=_list_from_options_callback,
+ callback_kwargs={
+ 'delim': None,
+ 'process': lambda val: dict(_postprocessor_opts_parser(*val.split(':', 1)))
+ }, help=(
+ 'The (case sensitive) name of plugin postprocessors to be enabled, '
+ 'and (optionally) arguments to be passed to it, seperated by a colon ":". '
+ 'ARGS are a semicolon ";" delimited list of NAME=VALUE. '
+ 'The "when" argument determines when the postprocessor is invoked. '
+ 'It can be one of "pre_process" (after extraction), '
+ '"before_dl" (before video download), "post_process" (after video download; default) '
+ 'or "after_move" (after moving file to their final locations). '
+ 'This option can be used multiple times to add different postprocessors'))
sponsorblock = optparse.OptionGroup(parser, 'SponsorBlock Options', description=(
'Make chapter entries for, or remove various segments (sponsor, introductions, etc.) '