diff --git a/feedleware/youtube/feed.py b/feedleware/youtube/feed.py index cae5862..5c51d75 100644 --- a/feedleware/youtube/feed.py +++ b/feedleware/youtube/feed.py @@ -31,7 +31,11 @@ def construct_rss(client: APIClient, channel_id: str) -> str: video_id = video["resourceId"]["videoId"] link = f"https://www.youtube.com/watch?v={video_id}" - thumbnail = video["thumbnails"]["standard"]["url"] + thumbnail = "" + + for size in ("standard", "maxres", *video["thumbnails"].keys()): + if size in video["thumbnails"]: + thumbnail = video["thumbnails"][size]["url"] item["guid"] = video["resourceId"]["videoId"] item["title"] = video.get("title", "Untitled Video")