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
"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": {

Loading…
Cancel
Save