ajayyy / DeArrow

Crowdsourcing better titles and thumbnails on YouTube
https://dearrow.ajay.app
GNU General Public License v3.0
1.41k stars 38 forks source link

Use alternative thumbnails from youtube instead of random timestamps #41

Closed sauerbread closed 1 year ago

sauerbread commented 1 year ago

Instead of cumbersome random timestamp thumbnail generation, we could use youtube alternate thumbnails to show us a thumbnail from the actual video. This would be server resources friendly and instant.

These are all thumbnail urls in all formats:

https://i.ytimg.com/vi/<video-id>/default.jpg
https://i.ytimg.com/vi/<video-id>/0.jpg
https://i.ytimg.com/vi/<video-id>/1.jpg
https://i.ytimg.com/vi/<video-id>/2.jpg
https://i.ytimg.com/vi/<video-id>/3.jpg

https://i.ytimg.com/vi/<video-id>/mqdefault.jpg
https://i.ytimg.com/vi/<video-id>/mq1.jpg
https://i.ytimg.com/vi/<video-id>/mq2.jpg
https://i.ytimg.com/vi/<video-id>/mq3.jpg

https://i.ytimg.com/vi/<video-id>/hqdefault.jpg
https://i.ytimg.com/vi/<video-id>/hq720.jpg
https://i.ytimg.com/vi/<video-id>/hq1.jpg
https://i.ytimg.com/vi/<video-id>/hq2.jpg
https://i.ytimg.com/vi/<video-id>/hq3.jpg

https://i.ytimg.com/vi/<video-id>/sddefault.jpg
https://i.ytimg.com/vi/<video-id>/sd1.jpg
https://i.ytimg.com/vi/<video-id>/sd2.jpg
https://i.ytimg.com/vi/<video-id>/sd3.jpg

https://i.ytimg.com/vi/<video-id>/maxresdefault.jpg
https://i.ytimg.com/vi/<video-id>/maxres1.jpg
https://i.ytimg.com/vi/<video-id>/maxres2.jpg
https://i.ytimg.com/vi/<video-id>/maxres3.jpg

Where default or 0 is the clickbait thumbnail, 1 is at the beginning of the actual video, 2 is in the middle, 3 at the end. Also img.youtube.com and i.ytimg.com are interchangeable.

ajayyy commented 1 year ago

It could be an option for those that want, but random timestamps were a conscious choice as YouTube's auto generated ones are not random, and seem to be built using a machine learning algorithm trained on bad thumbnails.

They mostly pick exaggerated faced, etc.