aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-07-23 09:44:28 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-07-23 09:46:55 +0530
commitf45e6c11264434ef7bace0b6badfd45df8dd874a (patch)
treef06069c4cbf2496336c5b4f8370847674715fda8
parent3944e7af92a2cf60838d407a0c6cd72e49c4d254 (diff)
downloadhypervideo-pre-f45e6c11264434ef7bace0b6badfd45df8dd874a.tar.lz
hypervideo-pre-f45e6c11264434ef7bace0b6badfd45df8dd874a.tar.xz
hypervideo-pre-f45e6c11264434ef7bace0b6badfd45df8dd874a.zip
[downloader] Pass same status object to all `progress_hooks`
-rw-r--r--yt_dlp/downloader/common.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/yt_dlp/downloader/common.py b/yt_dlp/downloader/common.py
index 9f0d3c7bf..038e32f95 100644
--- a/yt_dlp/downloader/common.py
+++ b/yt_dlp/downloader/common.py
@@ -395,8 +395,12 @@ class FileDownloader(object):
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