1. I pull the latest comments using the YouTube data API.
2. A next.js app using ImageResponse from next/og generates a new thumbnail image by overlaying the latest comment text on the original thumbnail.
3. I use the YouTube API to update the thumbnail for that video.
The text is also truncated to 65 characters and I have comment filtering for the video set to "strict"
It all runs as a cron job every 15 minutes. I wanted it to run more frequently, but each thumbnail update costs ~50 credits, and YouTube only gives 10k API credits per day.
There's also an undocumented limit to the number of times you can change your thumbnail in a 24h period, which I hit the first day when running every 10 minutes. I slowed it down and also added a cache so it only updates if the comment has changed since the last run.
Link to video: https://www.youtube.com/watch?v=HbUgsprjNVY
Link to view thumbnail: https://www.youtube.com/@SmithOffGrid/search?query=HbUgsprjN...
=-=-=
It was pretty fun to build this out. Not the first to do something like this though.
Others I could find:
Tom Scott: https://www.youtube.com/watch?v=BxV14h0kFs0
Sean Hodgins: https://www.youtube.com/watch?v=FV2OqOJcQRc
MrBeast: https://www.youtube.com/watch?v=YSoJPA8-oHc
Hyperplexed: https://www.youtube.com/watch?v=6fAQ_y-1SxI