YouTube文档无所适从,因此这里是您如何进行操作及其含义的快速参考。 这篇文章是从以前的一篇文章开始的,该文章是关于如何使用jQuery显示YouTube视频缩略图的 。
列表中的第一个是全尺寸图像,其他是缩略图图像。
http://img.youtube.com/vi/dXo0LextZTU/0.jpg
http://img.youtube.com/vi/dXo0LextZTU/1.jpg
http://img.youtube.com/vi/dXo0LextZTU/2.jpg
http://img.youtube.com/vi/dXo0LextZTU/3.jpg
http://img.youtube.com/vi/dXo0LextZTU/0.jpg
http://img.youtube.com/vi/dXo0LextZTU/1.jpg
http://img.youtube.com/vi/dXo0LextZTU/2.jpg
http://img.youtube.com/vi/dXo0LextZTU/3.jpg
缩略图也有高质量,中等质量和标准清晰度的版本。
http://img.youtube.com/vi/dXo0LextZTU/default.jpg
http://img.youtube.com/vi/dXo0LextZTU/hqdefault.jpg
http://img.youtube.com/vi/dXo0LextZTU/mqdefault.jpg
http://img.youtube.com/vi/dXo0LextZTU/sddefault.jpg
http://img.youtube.com/vi/dXo0LextZTU/default.jpg
http://img.youtube.com/vi/dXo0LextZTU/hqdefault.jpg
http://img.youtube.com/vi/dXo0LextZTU/mqdefault.jpg
http://img.youtube.com/vi/dXo0LextZTU/sddefault.jpg
* 默认 -默认缩略图。 视频(或引用视频的资源,例如播放列表项或搜索结果)的默认缩略图宽度为120px,高度为90px。 频道的默认缩略图为88px宽和88px高。
* 中 -缩略图的高分辨率版本。 对于视频(或引用视频的资源),此图像的宽度为320px,高度为180px。 对于频道,此图片的宽度为240px,高度为240px。
* 高 –缩略图的高分辨率版本。 对于视频(或引用视频的资源),此图像的宽度为480px,高度为360px。 对于频道,此图像的宽度为800px,高度为800px。
更多信息
您不需要API密钥即可使用此服务。
以上所有网址也可以通过https访问。 只需将上述任何网址中的http更改为https即可。 此外,在上面的示例网址中,主机名i3.ytimg.com略短一些,可以代替img.youtube.com。
程式码范例
JS – https://code.google.com/p/youtube-api-samples/source/browse/#git%2Fsamples%2Fjavascript
PHP – https://code.google.com/p/youtube-api-samples/source/browse/samples/php/upload_thumbnail.php
资源
https://developers.google.com/youtube/v3/docs/videos#snippet.thumbnails.%28key%29
http://stackoverflow.com/questions/2068344/how-to-get-thumbnail-of-youtube-video-link-using-youtube-api
From: https://www.sitepoint.com/youtube-video-thumbnail-urls/