1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-12-01 20:57:54 +01:00

[downloader/dash] Abort download immediately after giving up on some fragment

This commit is contained in:
Sergey M․ 2016-08-30 22:28:14 +07:00
parent 2e99cd30c3
commit 4a69fa04e0
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -66,14 +66,17 @@ class DashSegmentsFD(FragmentFD):
if count > fragment_retries: if count > fragment_retries:
if skip_unavailable_fragments: if skip_unavailable_fragments:
self.report_skip_fragment(segment_name) self.report_skip_fragment(segment_name)
return return True
self.report_error('giving up after %s fragment retries' % fragment_retries) self.report_error('giving up after %s fragment retries' % fragment_retries)
return False return False
return True
if initialization_url: if initialization_url:
append_url_to_file(initialization_url, ctx['tmpfilename'], 'Init') if not append_url_to_file(initialization_url, ctx['tmpfilename'], 'Init'):
return False
for i, segment_url in enumerate(segment_urls): for i, segment_url in enumerate(segment_urls):
append_url_to_file(segment_url, ctx['tmpfilename'], 'Seg%d' % i) if not append_url_to_file(segment_url, ctx['tmpfilename'], 'Seg%d' % i):
return False
self._finish_frag_download(ctx) self._finish_frag_download(ctx)