aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-06-24 17:54:05 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-06-24 22:04:23 +0530
commit8e897ed283be889dc293522eca6435f081d3a307 (patch)
tree9466f3549aa5ad6c3e7a8f437d73b49caf23c895
parent412cce82b06b3eb9788ac31b569d16316f79b03e (diff)
downloadhypervideo-pre-8e897ed283be889dc293522eca6435f081d3a307.tar.lz
hypervideo-pre-8e897ed283be889dc293522eca6435f081d3a307.tar.xz
hypervideo-pre-8e897ed283be889dc293522eca6435f081d3a307.zip
[fragment] Return status of download correctly
-rw-r--r--yt_dlp/downloader/dash.py7
-rw-r--r--yt_dlp/downloader/fragment.py1
-rw-r--r--yt_dlp/downloader/hls.py7
3 files changed, 5 insertions, 10 deletions
diff --git a/yt_dlp/downloader/dash.py b/yt_dlp/downloader/dash.py
index 90c7a3ace..ce4001a09 100644
--- a/yt_dlp/downloader/dash.py
+++ b/yt_dlp/downloader/dash.py
@@ -57,9 +57,6 @@ class DashSegmentsFD(FragmentFD):
# TODO: Make progress updates work without hooking twice
# for ph in self._progress_hooks:
# fd.add_progress_hook(ph)
- success = fd.real_download(filename, info_copy)
- if not success:
- return False
+ return fd.real_download(filename, info_copy)
else:
- self.download_and_append_fragments(ctx, fragments_to_download, info_dict)
- return True
+ return self.download_and_append_fragments(ctx, fragments_to_download, info_dict)
diff --git a/yt_dlp/downloader/fragment.py b/yt_dlp/downloader/fragment.py
index a530484b5..c8d4d33aa 100644
--- a/yt_dlp/downloader/fragment.py
+++ b/yt_dlp/downloader/fragment.py
@@ -428,3 +428,4 @@ class FragmentFD(FileDownloader):
return False
self._finish_frag_download(ctx)
+ return True
diff --git a/yt_dlp/downloader/hls.py b/yt_dlp/downloader/hls.py
index a3cd18b77..fdc4f7aa8 100644
--- a/yt_dlp/downloader/hls.py
+++ b/yt_dlp/downloader/hls.py
@@ -250,9 +250,7 @@ class HlsFD(FragmentFD):
# TODO: Make progress updates work without hooking twice
# for ph in self._progress_hooks:
# fd.add_progress_hook(ph)
- success = fd.real_download(filename, info_copy)
- if not success:
- return False
+ return fd.real_download(filename, info_copy)
else:
if is_webvtt:
def pack_fragment(frag_content, frag_index):
@@ -323,5 +321,4 @@ class HlsFD(FragmentFD):
return output.getvalue().encode('utf-8')
else:
pack_fragment = None
- self.download_and_append_fragments(ctx, fragments, info_dict, pack_fragment)
- return True
+ return self.download_and_append_fragments(ctx, fragments, info_dict, pack_fragment)