How do I get a YouTube video thumbnail from the YouTube API?

后端 未结 30 2681
Happy的楠姐
Happy的楠姐 2020-11-21 07:06

If I have a YouTube video URL, is there any way to use PHP and cURL to get the associated thumbnail from the YouTube API?

30条回答
  •  孤街浪徒
    2020-11-21 07:29

    I think their are a lots of answer for thumbnail, but I want to add some other URLs to get YouTube thumbnail very easily. I am just taking some text from Asaph's answer. Here are some URLs to get YouTube thumbnails:

    https://ytimg.googleusercontent.com/vi//default.jpg
    

    For the high quality version of the thumbnail use a URL similar to this:

    https://ytimg.googleusercontent.com/vi//hqdefault.jpg
    

    There is also a medium quality version of the thumbnail, using a URL similar to the high quality:

    https://ytimg.googleusercontent.com/vi//mqdefault.jpg
    

    For the standard definition version of the thumbnail, use a URL similar to this:

    https://ytimg.googleusercontent.com/vi//sddefault.jpg
    

    For the maximum resolution version of the thumbnail use a URL similar to this:

    https://ytimg.googleusercontent.com/vi//maxresdefault.jpg
    

提交回复
热议问题