Tuesday, November 11, 2014
The other day, when I was editing the weekly viral video roundup post, it occurred to me that it would be nice to display a thumbnail image for the post, taken from one of the videos in his review. I thought I'd write a short post to show you how to easily pull thumbnail images for a YouTube video.
There are a few different ways that you can get thumbnails from a YouTube video, one of which is to use YouTube's Video API to extract the thumbnail.
YouTube API responses may contain multiple thumbnail images for a video, each of which is identified by a tag. Creating a call to YouTube to get the video and thumbnail information can take some time and when you are like me and don't know a think about writing code, then the API is relatively useless. For me, I needed a simple way to pull down a thumbnail and thankfully, there is a simple way to do this.
Here is the YouTube URL format that you will need in order to view and download a thumbnail from a YouTube video... where for the video example above, VIDEO_ID=bQVoAWSP7k4 and #(1,2, or 3) corresponds to one of the 3 thumbnails that YouTube automatically generates.
#2, is the default thumbnail, or the one that the owner ends up choosing for their video.
Using this convention, below are the URLs and the thumbnails that I was able to pull off of YouTube for the "wedding proposal" video from Jeremy's post.
http://img.youtube.com/vi/bQVoAWSP7k4/1.jpg
http://img.youtube.com/vi/bQVoAWSP7k4/3.jpg
http://img.youtube.com/vi/bQVoAWSP7k4/2.jpg
http://img.youtube.com/vi/bQVoAWSP7k4/0.jpg
I hope helps.
Related Posts / Sarnased
- Blogger Comments
- Facebook Comments
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment