extractors/media/youtube: improve thumbnail selection

master
Felix Stupp 6 months ago
parent b6275b6b20
commit 32ddc9f03d
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -140,13 +140,14 @@ class YoutubeMediaExtractor(MediaExtractor[YoutubeVideoData]):
# TODO keep as int # TODO keep as int
"duration": {"secondsText": str(ytdlp_info["duration"])}, "duration": {"secondsText": str(ytdlp_info["duration"])},
"viewCount": {"text": str(ytdlp_info["view_count"])}, "viewCount": {"text": str(ytdlp_info["view_count"])},
# only supply best thumbnail available
"thumbnails": [ "thumbnails": [
{ {
"url": ytdlp_info["thumbnail"], "url": thumb["url"],
"height": 1, "height": thumb["height"],
"width": 1, "width": thumb["width"],
} }
for thumb in ytdlp_info["thumbnails"]
if "width" in thumb and "height" in thumb
], ],
"description": ytdlp_info["description"], "description": ytdlp_info["description"],
"channel": { "channel": {

Loading…
Cancel
Save