From aefce1eea4d0b6bab1ec2bd3beff09bff91a39c8 Mon Sep 17 00:00:00 2001 From: doe1080 <98906116+doe1080@users.noreply.github.com> Date: Tue, 14 Jul 2026 23:14:20 +0900 Subject: [PATCH] [fd/hls] Fix crash on empty fragment lists in tests (#17218) Authored by: doe1080 --- yt_dlp/downloader/hls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/downloader/hls.py b/yt_dlp/downloader/hls.py index 58cfbbf163..ad49e3f56f 100644 --- a/yt_dlp/downloader/hls.py +++ b/yt_dlp/downloader/hls.py @@ -300,7 +300,7 @@ class HlsFD(FragmentFD): # We only download the first fragment during the test if self.params.get('test', False): - fragments = [fragments[0] if fragments else None] + fragments = fragments[:1] if real_downloader: info_dict['fragments'] = fragments