From 92918e2ba1e5c745aff2dcf046c82a3c1f9529af Mon Sep 17 00:00:00 2001 From: garret1317 Date: Thu, 6 Nov 2025 21:26:59 +0000 Subject: Implement lazy chunk downloading using `http_dash_segments_generator` as seen in youtube live-from-start this way it only goes through the chunks etc one a format has actually been selected so we don't have it downloading eg 20 chunks of every stream only for most to be discarded closes #29 --- yt_dlp_plugins/extractor/radiko.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'yt_dlp_plugins/extractor/radiko.py') diff --git a/yt_dlp_plugins/extractor/radiko.py b/yt_dlp_plugins/extractor/radiko.py index 6718201..2ec363a 100644 --- a/yt_dlp_plugins/extractor/radiko.py +++ b/yt_dlp_plugins/extractor/radiko.py @@ -310,13 +310,15 @@ class _RadikoBaseIE(InfoExtractor): if delivered_live and timefree and do_as_live_chunks: - chunks_playlist = hacks._generate_as_live_playlist( - self, playlist_url, start_at, end_at, domain, auth_headers - ) + def fragments_generator(_): + return hacks._generate_as_live_fragments( + self, playlist_url, start_at, end_at, domain, auth_headers + ) m3u8_formats = [{ "format_id": join_nonempty(domain, "chunked"), - "hls_media_playlist_data": chunks_playlist, + "fragments": fragments_generator, + "protocol": "http_dash_segments_generator", "preference": preference, "ext": "m4a", "vcodec": "none", @@ -324,6 +326,7 @@ class _RadikoBaseIE(InfoExtractor): # fallback to live for ffmpeg etc "url": playlist_url, "http_headers": auth_headers, + "is_live": "yesn't", }] format_note.append("Chunked") else: -- cgit v1.2.3-70-g09d2