我目前正在使用 youtube 的 Javascript API 在我的网页上显示视频,但是现在我还想从视频 ID 中检索 youtube 描述?我该怎么做呢?
我只想要描述和标题:
ex:
"kind": "youtube#video",
"etag": etag,
"id": string,
"snippet": {
"publishedAt": datetime,
"channelId": string,
"title": string,
"description": string,
"thumbnails": {
(key): {
"url": string,
"width": unsigned integer,
"height": unsigned integer
}
https://developers.google.com/youtube/v3/docs/videos https://developers.google.com/youtube/v3/docs/videos
如果有人可以发布链接或向我展示有关如何完成此操作的代码示例?
您链接到的开发人员文档有一些优秀的代码示例——这将是最好的起点。使用视频的“列表”参考菜单。
如果您说您只想要标题和描述而不需要其他字段,则可以在请求中使用 fields 参数...如下所示:
https://www.googleapis.com/youtube/v3/videos?part=snippet&id={VIDEO_ID}&fields=items/snippet/title,items/snippet/description&key={YOUR_API_KEY}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)