From 57f070e5acb7eca206a6d07569be2f8391bcf1a7 Mon Sep 17 00:00:00 2001 From: ckaotik Date: Sun, 21 Feb 2021 12:54:09 +0100 Subject: [PATCH] [mediathekviewweb] Added pretty playlist name if topic is common for all results --- youtube_dl/extractor/mediathekviewweb.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/mediathekviewweb.py b/youtube_dl/extractor/mediathekviewweb.py index abef1f115..59033ee2b 100644 --- a/youtube_dl/extractor/mediathekviewweb.py +++ b/youtube_dl/extractor/mediathekviewweb.py @@ -187,7 +187,13 @@ class MediathekViewWebSearchIE(SearchInfoExtractor): elif meta['resultCount'] == 0: break - return self.playlist_result(entries, playlist_title=query) + common_topic = None + if entries: + common_topic = entries[0]['series'] + for entry in entries: + common_topic = common_topic if entry['series'] == common_topic else None + + return self.playlist_result(entries, playlist_title=common_topic or query) class MediathekViewWebIE(InfoExtractor):