Fix PostProcessor hooks not registered for some PPs

Closes #1993
This commit is contained in:
pukkandan 2021-12-14 21:08:24 +05:30
parent 19188702ef
commit 5bfc8bee5a
No known key found for this signature in database
GPG key ID: 0F00D95A001F4698

View file

@ -634,13 +634,6 @@ def check_deprecated(param, option, suggestion):
self.print_debug_header()
self.add_default_info_extractors()
for pp_def_raw in self.params.get('postprocessors', []):
pp_def = dict(pp_def_raw)
when = pp_def.pop('when', 'post_process')
pp_class = get_postprocessor(pp_def.pop('key'))
pp = pp_class(self, **compat_kwargs(pp_def))
self.add_post_processor(pp, when=when)
hooks = {
'post_hooks': self.add_post_hook,
'progress_hooks': self.add_progress_hook,
@ -650,6 +643,13 @@ def check_deprecated(param, option, suggestion):
for ph in self.params.get(opt, []):
fn(ph)
for pp_def_raw in self.params.get('postprocessors', []):
pp_def = dict(pp_def_raw)
when = pp_def.pop('when', 'post_process')
self.add_post_processor(
get_postprocessor(pp_def.pop('key'))(self, **compat_kwargs(pp_def)),
when=when)
register_socks_protocols()
def preload_download_archive(fn):
@ -736,6 +736,9 @@ def add_progress_hook(self, ph):
def add_postprocessor_hook(self, ph):
"""Add the postprocessing progress hook"""
self._postprocessor_hooks.append(ph)
for pps in self._pps.values():
for pp in pps:
pp.add_progress_hook(ph)
def _bidi_workaround(self, message):
if not hasattr(self, '_output_channel'):