1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-06-26 00:59:20 +02:00

[downloader] Pass same status object to all progress_hooks

This commit is contained in:
pukkandan 2021-07-23 09:44:28 +05:30
parent 3944e7af92
commit f45e6c1126
No known key found for this signature in database
GPG Key ID: 0F00D95A001F4698

View File

@ -395,8 +395,12 @@ def _hook_progress(self, status, info_dict):
info_dict = dict(info_dict)
for key in ('__original_infodict', '__postprocessors'):
info_dict.pop(key, None)
# youtube-dl passes the same status object to all the hooks.
# Some third party scripts seems to be relying on this.
# So keep this behavior if possible
status['info_dict'] = copy.deepcopy(info_dict)
for ph in self._progress_hooks:
ph({**status, 'info_dict': copy.deepcopy(info_dict)})
ph(status)
def add_progress_hook(self, ph):
# See YoutubeDl.py (search for progress_hooks) for a description of