1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-04 00:55:15 +00:00

[fragment] Print error message when skipping fragment

This commit is contained in:
pukkandan
2021-10-19 21:51:33 +05:30
parent 2cda6b401d
commit b4b855ebc7
2 changed files with 7 additions and 6 deletions

View File

@ -72,8 +72,9 @@ class FragmentFD(FileDownloader):
'\r[download] Got server HTTP error: %s. Retrying fragment %d (attempt %d of %s) ...'
% (error_to_compat_str(err), frag_index, count, self.format_retries(retries)))
def report_skip_fragment(self, frag_index):
self.to_screen('[download] Skipping fragment %d ...' % frag_index)
def report_skip_fragment(self, frag_index, err=None):
err = f' {err};' if err else ''
self.to_screen(f'[download]{err} Skipping fragment {frag_index:d} ...')
def _prepare_url(self, info_dict, url):
headers = info_dict.get('http_headers')
@ -443,7 +444,7 @@ class FragmentFD(FileDownloader):
def append_fragment(frag_content, frag_index, ctx):
if not frag_content:
if not is_fatal(frag_index - 1):
self.report_skip_fragment(frag_index)
self.report_skip_fragment(frag_index, 'fragment not found')
return True
else:
ctx['dest_stream'].close()