mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 21:26:55 +01:00
[fragment] Return status of download correctly
This commit is contained in:
parent
412cce82b0
commit
8e897ed283
@ -57,9 +57,6 @@ def real_download(self, filename, info_dict):
|
|||||||
# TODO: Make progress updates work without hooking twice
|
# TODO: Make progress updates work without hooking twice
|
||||||
# for ph in self._progress_hooks:
|
# for ph in self._progress_hooks:
|
||||||
# fd.add_progress_hook(ph)
|
# fd.add_progress_hook(ph)
|
||||||
success = fd.real_download(filename, info_copy)
|
return fd.real_download(filename, info_copy)
|
||||||
if not success:
|
|
||||||
return False
|
|
||||||
else:
|
else:
|
||||||
self.download_and_append_fragments(ctx, fragments_to_download, info_dict)
|
return self.download_and_append_fragments(ctx, fragments_to_download, info_dict)
|
||||||
return True
|
|
||||||
|
@ -428,3 +428,4 @@ def _download_fragment(fragment):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
self._finish_frag_download(ctx)
|
self._finish_frag_download(ctx)
|
||||||
|
return True
|
||||||
|
@ -250,9 +250,7 @@ def is_ad_fragment_end(s):
|
|||||||
# TODO: Make progress updates work without hooking twice
|
# TODO: Make progress updates work without hooking twice
|
||||||
# for ph in self._progress_hooks:
|
# for ph in self._progress_hooks:
|
||||||
# fd.add_progress_hook(ph)
|
# fd.add_progress_hook(ph)
|
||||||
success = fd.real_download(filename, info_copy)
|
return fd.real_download(filename, info_copy)
|
||||||
if not success:
|
|
||||||
return False
|
|
||||||
else:
|
else:
|
||||||
if is_webvtt:
|
if is_webvtt:
|
||||||
def pack_fragment(frag_content, frag_index):
|
def pack_fragment(frag_content, frag_index):
|
||||||
@ -323,5 +321,4 @@ def pack_fragment(frag_content, frag_index):
|
|||||||
return output.getvalue().encode('utf-8')
|
return output.getvalue().encode('utf-8')
|
||||||
else:
|
else:
|
||||||
pack_fragment = None
|
pack_fragment = None
|
||||||
self.download_and_append_fragments(ctx, fragments, info_dict, pack_fragment)
|
return self.download_and_append_fragments(ctx, fragments, info_dict, pack_fragment)
|
||||||
return True
|
|
||||||
|
Loading…
Reference in New Issue
Block a user