【问题标题】:How to get youtube video description with video id?如何获取带有视频 ID 的 youtube 视频描述?
【发布时间】:2015-07-26 07:15:15
【问题描述】:

我目前正在使用 youtube 的 Javascript API 在我的网页上显示视频,但是现在我还想从视频 ID 中检索 youtube 描述?我该怎么做呢?

我只想要描述和标题:

例如:

"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

如果有人可以发布链接或向我展示如何完成此操作的代码示例?

【问题讨论】:

    标签: javascript php video youtube-api


    【解决方案1】:

    您链接到的开发人员文档有一些出色的代码示例——这将是最好的起点。使用视频的“列表”参考菜单。

    如果你说你只想要标题和描述而不需要其他字段,你可以在你的请求中使用 fields 参数......像这样:

    https://www.googleapis.com/youtube/v3/videos?part=snippet&id={VIDEO_ID}&fields=items/snippet/title,items/snippet/description&key={YOUR_API_KEY}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-11
      • 2023-03-17
      • 2017-07-01
      • 2011-09-13
      • 2016-09-28
      • 1970-01-01
      相关资源
      最近更新 更多