aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/downloader
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-10-16 18:31:00 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-10-16 20:02:40 +0530
commit03b4de722a6cf86dbcc6d17a63145ec59a573bf6 (patch)
tree76850c608171efbb8ab010bc39d404039231bc1c /yt_dlp/downloader
parent48ee10ee8adcf61e1136a252462670ec230e9439 (diff)
downloadhypervideo-pre-03b4de722a6cf86dbcc6d17a63145ec59a573bf6.tar.lz
hypervideo-pre-03b4de722a6cf86dbcc6d17a63145ec59a573bf6.tar.xz
hypervideo-pre-03b4de722a6cf86dbcc6d17a63145ec59a573bf6.zip
[downloader] Fix slow progress hooks
Closes #1301
Diffstat (limited to 'yt_dlp/downloader')
-rw-r--r--yt_dlp/downloader/common.py5
-rw-r--r--yt_dlp/downloader/dash.py5
-rw-r--r--yt_dlp/downloader/hls.py5
3 files changed, 5 insertions, 10 deletions
diff --git a/yt_dlp/downloader/common.py b/yt_dlp/downloader/common.py
index 89cdffd24..96b78a968 100644
--- a/yt_dlp/downloader/common.py
+++ b/yt_dlp/downloader/common.py
@@ -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)
diff --git a/yt_dlp/downloader/dash.py b/yt_dlp/downloader/dash.py
index 734eab3ef..6444ad692 100644
--- a/yt_dlp/downloader/dash.py
+++ b/yt_dlp/downloader/dash.py
@@ -55,9 +55,8 @@ class DashSegmentsFD(FragmentFD):
if real_downloader:
self.to_screen(
'[%s] Fragment downloads will be delegated to %s' % (self.FD_NAME, real_downloader.get_basename()))
- info_copy = info_dict.copy()
- info_copy['fragments'] = fragments_to_download
+ info_dict['fragments'] = fragments_to_download
fd = real_downloader(self.ydl, self.params)
- return fd.real_download(filename, info_copy)
+ return fd.real_download(filename, info_dict)
return self.download_and_append_fragments(ctx, fragments_to_download, info_dict)
diff --git a/yt_dlp/downloader/hls.py b/yt_dlp/downloader/hls.py
index 3c5a2617d..61312c5ba 100644
--- a/yt_dlp/downloader/hls.py
+++ b/yt_dlp/downloader/hls.py
@@ -245,13 +245,12 @@ class HlsFD(FragmentFD):
fragments = [fragments[0] if fragments else None]
if real_downloader:
- info_copy = info_dict.copy()
- info_copy['fragments'] = fragments
+ info_dict['fragments'] = fragments
fd = real_downloader(self.ydl, self.params)
# TODO: Make progress updates work without hooking twice
# for ph in self._progress_hooks:
# fd.add_progress_hook(ph)
- return fd.real_download(filename, info_copy)
+ return fd.real_download(filename, info_dict)
if is_webvtt:
def pack_fragment(frag_content, frag_index):