1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-08-25 13:58:28 +00:00

[fd/hls] Suggest --hls-split-discontinuity on duplicate init data

When discontinuities are merged (the default), well-formed m3u8 files
can produce this error. Help the user out by informing them of that.
This commit is contained in:
Thomas Hebb 2025-05-27 18:20:16 -04:00
parent 2685654a37
commit 5b69cf3019

View File

@ -227,8 +227,10 @@ def is_ad_fragment_end(s):
if format_index and discontinuity_count != format_index:
continue
if frag_index > 0:
self.report_error(
'Initialization fragment found after media fragments, unable to download')
msg = 'Initialization fragment found after media fragments, unable to download'
if format_index is None:
msg += '; if due to discontinuities, try --hls-split-discontinuity'
self.report_error(msg)
return False
frag_index += 1
map_info = parse_m3u8_attributes(line[11:])