From 32ddc9f03df0e6c1a9e8565da9774dbca0b0806b Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Sat, 24 May 2025 12:12:15 +0200 Subject: [PATCH] extractors/media/youtube: improve thumbnail selection --- server/entertainment_decider/extractors/media/youtube.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/entertainment_decider/extractors/media/youtube.py b/server/entertainment_decider/extractors/media/youtube.py index a99b101..2caaf23 100644 --- a/server/entertainment_decider/extractors/media/youtube.py +++ b/server/entertainment_decider/extractors/media/youtube.py @@ -140,13 +140,14 @@ class YoutubeMediaExtractor(MediaExtractor[YoutubeVideoData]): # TODO keep as int "duration": {"secondsText": str(ytdlp_info["duration"])}, "viewCount": {"text": str(ytdlp_info["view_count"])}, - # only supply best thumbnail available "thumbnails": [ { - "url": ytdlp_info["thumbnail"], - "height": 1, - "width": 1, + "url": thumb["url"], + "height": thumb["height"], + "width": thumb["width"], } + for thumb in ytdlp_info["thumbnails"] + if "width" in thumb and "height" in thumb ], "description": ytdlp_info["description"], "channel": {