From a53b4004cff69bca0f206bbd0b4a3003038568c7 Mon Sep 17 00:00:00 2001 From: memo Date: Sat, 13 Mar 2021 22:17:51 +0100 Subject: [PATCH] [tagesschau] remove duplicates from playlists --- youtube_dl/extractor/tagesschau.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/tagesschau.py b/youtube_dl/extractor/tagesschau.py index 28e4b7164..e415c1fca 100644 --- a/youtube_dl/extractor/tagesschau.py +++ b/youtube_dl/extractor/tagesschau.py @@ -135,7 +135,7 @@ class TagesschauIE(InfoExtractor): 'id': 'impfungen-coronavirus-usa-101', 'title': 'Kampf gegen das Coronavirus: Impfwunder USA?', }, - 'playlist_count': 3, + 'playlist_count': 2, }, { # article without videos 'url': 'https://www.tagesschau.de/wirtschaft/ukraine-russland-kredit-101.html', @@ -351,8 +351,13 @@ class TagesschauIE(InfoExtractor): and not self._downloader.params.get('noplaylist') and (webpage_type == 'website' or not mobj.group('id'))): # article or playlist - entries = [self._extract_from_player(s, video_id, title) - for s in players] + entries = [] + seen = set() + for player in players: + entry = self._extract_from_player(player, video_id, title) + if entry['id'] not in seen: + entries.append(entry) + seen.add(entry['id']) return self.playlist_result(entries, display_id, title) else: # single video/audio