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

[suggestion] Use YouTube video poster instead of actual video page screenshot #25

Open
nhoizey opened this issue Nov 7, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@nhoizey
Copy link

nhoizey commented Nov 7, 2024

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

@nhoizey
Copy link
Author

nhoizey commented Dec 10, 2024

@zachleat
Copy link
Member

I think my issue here is that the OpenGraph Image api should be used instead? Related: 11ty/api-opengraph-image#1

Notably, this special case would only work for the opengraph size only?

@zachleat zachleat added the enhancement New feature or request label Dec 10, 2024
@nhoizey
Copy link
Author

nhoizey commented Dec 10, 2024

@zachleat I'm also not sure it's the best solution, but I've not been able to use this service for YouTube pages at all, always getting errors, so I believe there should be a native solution in the service.

Using the poster image still feels like the least dumb idea… 😅

I temporarily tried to use the service only for non YouTube URLs, but I had issues with other pages too (all SPAs I think… 😞), so I reverted to using thum.io… 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants