Comment on Fighting with YouTube to show a preview imageComments−mzajc1yIf you can afford to add a little extra logic to your web server, you can solve this without JavaScript shenanigans (plus it doesn't leak your visitors' IPs to Google. On Nginx, for example: location ~ /vi/(.*)/thumbnail($|\..*) { error_page 404 = @hqdefault; proxy_intercept_errors on; proxy_pass https://img.youtube.com/vi/$1/maxresdefault$2; } location @hqdefault { proxy_pass https://img.youtube.com/vi/$1/hqdefault$2; } Then simply use /vi/<id>/thumbnail.webp as the image source or adapt the location regex as needed. This can be chained with yet more fallback URLs.−onestay421yPlease, please close that parenthese. Please, I beg of you. I can do it for you if you'd like.) There. Sorry.−mzajc1yThe edit button is gone, sorry :)
Comments
If you can afford to add a little extra logic to your web server, you can solve this without JavaScript shenanigans (plus it doesn't leak your visitors' IPs to Google. On Nginx, for example:
Then simply use /vi/<id>/thumbnail.webp as the image source or adapt the location regex as needed. This can be chained with yet more fallback URLs.Please, please close that parenthese. Please, I beg of you. I can do it for you if you'd like.) There. Sorry.
The edit button is gone, sorry :)