1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-07-08 06:45:11 -05:00

[downloader] Fix slow progress hooks

Closes #1301
This commit is contained in:
pukkandan
2021-10-16 18:31:00 +05:30
parent 48ee10ee8a
commit 03b4de722a
5 changed files with 23 additions and 21 deletions

View File

@ -405,13 +405,10 @@ class FileDownloader(object):
def _hook_progress(self, status, info_dict):
if not self._progress_hooks:
return
info_dict = dict(info_dict)
for key in ('__original_infodict', '__postprocessors'):
info_dict.pop(key, None)
status['info_dict'] = info_dict
# 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)