mirror of
https://github.com/yt-dlp/yt-dlp
synced 2024-12-27 21:59:17 +01:00
[fragment] Make sure first segment is not skipped
This commit is contained in:
parent
41d1cca328
commit
000ee7ef34
2 changed files with 6 additions and 4 deletions
|
@ -120,6 +120,7 @@ class DashSegmentsFD(FragmentFD):
|
||||||
return frag_content, frag_index
|
return frag_content, frag_index
|
||||||
|
|
||||||
def append_fragment(frag_content, frag_index):
|
def append_fragment(frag_content, frag_index):
|
||||||
|
fatal = frag_index == 1 or not skip_unavailable_fragments
|
||||||
if frag_content:
|
if frag_content:
|
||||||
fragment_filename = '%s-Frag%d' % (ctx['tmpfilename'], frag_index)
|
fragment_filename = '%s-Frag%d' % (ctx['tmpfilename'], frag_index)
|
||||||
try:
|
try:
|
||||||
|
@ -132,7 +133,7 @@ class DashSegmentsFD(FragmentFD):
|
||||||
if ose.errno != errno.ENOENT:
|
if ose.errno != errno.ENOENT:
|
||||||
raise
|
raise
|
||||||
# FileNotFoundError
|
# FileNotFoundError
|
||||||
if skip_unavailable_fragments:
|
if not fatal:
|
||||||
self.report_skip_fragment(frag_index)
|
self.report_skip_fragment(frag_index)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
@ -141,7 +142,7 @@ class DashSegmentsFD(FragmentFD):
|
||||||
'fragment %s not found, unable to continue' % frag_index)
|
'fragment %s not found, unable to continue' % frag_index)
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
if skip_unavailable_fragments:
|
if not fatal:
|
||||||
self.report_skip_fragment(frag_index)
|
self.report_skip_fragment(frag_index)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -387,6 +387,7 @@ class HlsFD(FragmentFD):
|
||||||
return output.getvalue().encode('utf-8')
|
return output.getvalue().encode('utf-8')
|
||||||
|
|
||||||
def append_fragment(frag_content, frag_index):
|
def append_fragment(frag_content, frag_index):
|
||||||
|
fatal = frag_index == 1 or not skip_unavailable_fragments
|
||||||
if frag_content:
|
if frag_content:
|
||||||
fragment_filename = '%s-Frag%d' % (ctx['tmpfilename'], frag_index)
|
fragment_filename = '%s-Frag%d' % (ctx['tmpfilename'], frag_index)
|
||||||
try:
|
try:
|
||||||
|
@ -400,7 +401,7 @@ class HlsFD(FragmentFD):
|
||||||
if ose.errno != errno.ENOENT:
|
if ose.errno != errno.ENOENT:
|
||||||
raise
|
raise
|
||||||
# FileNotFoundError
|
# FileNotFoundError
|
||||||
if skip_unavailable_fragments:
|
if not fatal:
|
||||||
self.report_skip_fragment(frag_index)
|
self.report_skip_fragment(frag_index)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
@ -409,7 +410,7 @@ class HlsFD(FragmentFD):
|
||||||
'fragment %s not found, unable to continue' % frag_index)
|
'fragment %s not found, unable to continue' % frag_index)
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
if skip_unavailable_fragments:
|
if not fatal:
|
||||||
self.report_skip_fragment(frag_index)
|
self.report_skip_fragment(frag_index)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue