问题描述
我需要在网站上使用我的YouTube视频缩略图的maxresdefault版本,但是在开发实现此目的的代码后,我发现尽管所有视频均为1080p,但并不是我所有的视频都提供了这些缩略图.
I need to use the maxresdefault version of my YouTube video thumbnails for a website, however upon developing the code to achieve this I have found that not all of my videos have these thumbnails available, despite the videos all being 1080p.
是否可以为所有视频自动生成新的高分辨率缩略图?
Is there a way to automatically generate new high-res thumbnails for all of my videos?
推荐答案
您可以使用YouTube数据API检索视频缩略图,字幕,说明,等级,统计信息等等.借助YouTube数据API,您可以向应用程序添加各种YouTube功能.
You can use YouTube Data API to retrieve video thumbnails, caption, description, rating, statistics and more. With the YouTube Data API, you can add a variety of YouTube features to your application.
对于高质量版本的缩略图,请使用类似于以下内容的网址:
For the high quality version of the thumbnail use a url similar to this:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg
还有一个中等质量的缩略图版本,使用的网址类似于总部:
There is also a medium quality version of the thumbnail, using a url similar to the HQ:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/mqdefault.jpg
对于缩略图的标准定义版本,请使用类似于以下内容的网址:
For the standard definition version of the thumbnail, use a url similar to this:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/sddefault.jpg
对于缩略图的最大分辨率版本,请使用类似于以下内容的网址:
For the maximum resolution version of the thumbnail use a url similar to this:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg
这是Youtube API的官方Google文档 https://developers.google.com/youtube/v3/docs/thumbnails
Here's the Official Google Documentation for Youtube APIhttps://developers.google.com/youtube/v3/docs/thumbnails
在这里我得到我的答案:如何获取YouTube视频缩略图来自YouTube API?
Here's where I get my answer:How do I get a YouTube video thumbnail from the YouTube API?
这篇关于YouTube maxresdefault缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!