]> jfr.im git - yt-dlp.git/commitdiff
[downloader] Pass same status object to all `progress_hooks`
authorpukkandan <redacted>
Fri, 23 Jul 2021 04:14:28 +0000 (09:44 +0530)
committerpukkandan <redacted>
Fri, 23 Jul 2021 04:16:55 +0000 (09:46 +0530)
yt_dlp/downloader/common.py

index 9f0d3c7bf33ae5b65217e84db4f4ac2cfd544f8d..038e32f9505bacdbe0866cc6002bd2d7eb877c1a 100644 (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