Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Higher-res YouTube thumbnails #1227

Open
twm opened this issue Oct 1, 2024 · 1 comment
Open

Higher-res YouTube thumbnails #1227

twm opened this issue Oct 1, 2024 · 1 comment

Comments

@twm
Copy link
Owner

twm commented Oct 1, 2024

https://tools.simonwillison.net/youtube-thumbnails?url=CRpHNB87gRY shows several higher-res endpoints than the https://i.ytimg.com/vi/CRpHNB87gRY/mqdefault.jpg Yarrharr currently injects.

@twm twm added the enhancement label Oct 1, 2024
@twm
Copy link
Owner Author

twm commented Feb 8, 2025

As the current implementation notes the higher-resolution maxresdefault.jpg isn't always available. When it's not the result is a 404.

A few options I see:

  1. On the frontend, use an <img onerror> handler to fallback from maxresdefault.jpg to hqdefault.jpg. Probably do this with a web component?
  2. Sniff which image is available at sanitization time and embed the correct URL.
  3. Rewrite to a proxied URL (provided by Yarrharr) that does the fallback internally.

The first has the additional benefit that it provides an extension point for allowing playback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant