Trying to get a screenshot of a YouTube video page often fails even after a 10 seconds timeout, because the SPA site is reaaaaly slow and heavy. 🤷♂️
As poster image URLs are predictable with just the video ID, I guess it could be possible to use the largest one as the “screenshot”.
The large poster URL is https://i.ytimg.com/vi/<video-id>/maxresdefault.jpg
For example https://i.ytimg.com/vi/Z_MG97DzNPs/maxresdefault.jpg for https://www.youtube.com/watch?v=Z_MG97DzNPs