From a427f0fa6c1b7c80b5fb230adbad751fd40d6ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20Sola?= Date: Mon, 4 Oct 2021 12:16:09 +0200 Subject: [PATCH] [atresplayer] fix formats and subtitles being overwritten for every source --- yt_dlp/extractor/atresplayer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/atresplayer.py b/yt_dlp/extractor/atresplayer.py index 937bce037..a3c16280b 100644 --- a/yt_dlp/extractor/atresplayer.py +++ b/yt_dlp/extractor/atresplayer.py @@ -98,12 +98,16 @@ class AtresPlayerIE(InfoExtractor): continue src_type = source.get('type') if src_type == 'application/vnd.apple.mpegurl': - formats, subtitles = self._extract_m3u8_formats_and_subtitles( + new_formats, new_subtitles = self._extract_m3u8_formats_and_subtitles( src, video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False) elif src_type == 'application/dash+xml': - formats, subtitles = self._extract_mpd_formats_and_subtitles( + new_formats, new_subtitles = self._extract_mpd_formats_and_subtitles( src, video_id, mpd_id='dash', fatal=False) + if new_formats: + formats.extend(new_formats) + if new_subtitles: + subtitles = self._merge_subtitles(subtitles, new_subtitles) self._sort_formats(formats) heartbeat = episode.get('heartbeat') or {}