Author here, hi all. There are a number of ways to skin this cat. This is my preferred method. What's yours?
https://developers.google.com/youtube/v3/docs/thumbnails
Maxresdefault is overkill for this purpose IMO. Why waste the data? Incidentally this is why I run an add-on that redirects all youtube thumbnails to mqdefault, it saves me a nice chunk of bandwidth / memory / perf.
Handling the fallback image has been sitting as an issue in the repo for a while, in favour of just checking it with the Astro dev server when I'm adding new videos, so… yoink‽
[1] https://github.com/insin/astro-lazy-youtube-embed#readme
[2] https://css-tricks.com/lazy-load-embedded-youtube-videos/
iurl: "default.jpg",
iurlmq: "mqdefault.jpg",
iurlhq: "hqdefault.jpg",
iurlsd: "sddefault.jpg",
iurlpop1: "pop1.jpg",
iurlpop2: "pop2.jpg",
iurlhq720: "hq720.jpg",
iurlmaxres: "maxresdefault.jpg"
120: "default.jpg",
320: "mqdefault.jpg",
480: "hqdefault.jpg",
560: "pop1.jpg",
640: "sddefault.jpg",
854: "pop2.jpg",
1280: "hq720.jpg"