Fix 'postprocessor_hooks`

Closes #1650
This commit is contained in:
pukkandan 2021-11-15 04:50:11 +05:30
parent dac5df5a98
commit 013b50b794
No known key found for this signature in database
GPG key ID: 0F00D95A001F4698

View file

@ -633,11 +633,14 @@ class YoutubeDL(object):
pp = pp_class(self, **compat_kwargs(pp_def))
self.add_post_processor(pp, when=when)
for ph in self.params.get('post_hooks', []):
self.add_post_hook(ph)
for ph in self.params.get('progress_hooks', []):
self.add_progress_hook(ph)
hooks = {
'post_hooks': self.add_post_hook,
'progress_hooks': self.add_progress_hook,
'postprocessor_hooks': self.add_postprocessor_hook,
}
for opt, fn in hooks.items():
for ph in self.params.get(opt, []):
fn(ph)
register_socks_protocols()