diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 3009dd39b..f268bd901 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -2831,13 +2831,13 @@ def _extract_sequence_from_mpd(refresh_sequence, immediate): continue else: should_continue = _extract_sequence_from_mpd(True, no_fragment_score > 15) - last_seq = int(re.search(r'(?:/|^)sq/(\d+)', fragments[-1]['path']).group(1)) - no_fragment_score += 2 if not should_continue: continue last_fragment = fragments[-1] + last_seq = int(re.search(r'(?:/|^)sq/(\d+)', fragments[-1]['path']).group(1)) + known_fragment = next( (fragment for fragment in fragments if f'sq/{known_idx}' in fragment['path']), None) if known_fragment and known_fragment['end'] > section_end: