]> jfr.im git - yt-dlp.git/commitdiff
[fragment] Return status of download correctly
authorpukkandan <redacted>
Thu, 24 Jun 2021 12:24:05 +0000 (17:54 +0530)
committerpukkandan <redacted>
Thu, 24 Jun 2021 16:34:23 +0000 (22:04 +0530)
yt_dlp/downloader/dash.py
yt_dlp/downloader/fragment.py
yt_dlp/downloader/hls.py

index 90c7a3ace25d9495f6ab2bc1103685147e5e7786..ce4001a09760070582a6633600591d9ef6793018 100644 (file)
@@ -57,9 +57,6 @@ def real_download(self, filename, info_dict):
             # 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)
index a530484b5643ee01d49e3b61038908bbb62bb28b..c8d4d33aae0e0ad724f99d6e225d6fd00011ed14 100644 (file)
@@ -428,3 +428,4 @@ def _download_fragment(fragment):
                     return False
 
         self._finish_frag_download(ctx)
+        return True
index a3cd18b77aac605f218988589b82828a93cda548..fdc4f7aa814d758f9abdf42e7746fdb2e4545698 100644 (file)
@@ -250,9 +250,7 @@ def is_ad_fragment_end(s):
             # 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 @@ def pack_fragment(frag_content, frag_index):
                     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)