mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-10-02 06:18:37 +09:00
[FragmentFD] Respect --no-continue
* discard partial fragment on `--no-continue` * continue with correct progress display otherwise Resolves #21467
This commit is contained in:
@@ -38,8 +38,7 @@ class DashSegmentsFD(FragmentFD):
|
||||
# In DASH, the first segment contains necessary headers to
|
||||
# generate a valid MP4 file, so always abort for the first segment
|
||||
fatal = i == 0 or not skip_unavailable_fragments
|
||||
count = 0
|
||||
while count <= fragment_retries:
|
||||
for count in range(fragment_retries + 1):
|
||||
try:
|
||||
fragment_url = fragment.get('url')
|
||||
if not fragment_url:
|
||||
@@ -57,9 +56,8 @@ class DashSegmentsFD(FragmentFD):
|
||||
# is usually enough) thus allowing to download the whole file successfully.
|
||||
# To be future-proof we will retry all fragments that fail with any
|
||||
# HTTP error.
|
||||
count += 1
|
||||
if count <= fragment_retries:
|
||||
self.report_retry_fragment(err, frag_index, count, fragment_retries)
|
||||
if count < fragment_retries:
|
||||
self.report_retry_fragment(err, frag_index, count + 1, fragment_retries)
|
||||
except DownloadError:
|
||||
# Don't retry fragment if error occurred during HTTP downloading
|
||||
# itself since it has own retry settings
|
||||
@@ -68,7 +66,7 @@ class DashSegmentsFD(FragmentFD):
|
||||
break
|
||||
raise
|
||||
|
||||
if count > fragment_retries:
|
||||
if count >= fragment_retries:
|
||||
if not fatal:
|
||||
self.report_skip_fragment(frag_index)
|
||||
continue
|
||||
|
Reference in New Issue
Block a user