Youtube API 检索直播游戏标题 [英] Youtube API Retrieve Live Stream Game Title

查看:34
本文介绍了Youtube API 检索直播游戏标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Youtube Api 检索直播的游戏标题.

我目前正在使用

I am trying to retrieve the game title of a live stream using the Youtube Api.

I am currently using the

Videos:list api but it doesn't seem to return this information. It does give me some topic ids but they do not represent specific games.

Is this information possible to get through the API?

Thank You

解决方案

this is the sample response of the Vedio:list

{
 "kind": "youtube#videoListResponse",
 "etag": "\"/zEUr9vFiEhEIvxHhZu87B-iG4CM\"",
 "pageInfo": {
  "totalResults": 1,
  "resultsPerPage": 1
 },
 "items": [
  {
   "kind": "youtube#video",
   "etag": "\"\"",
   "id": "Ks-_Mh1QhMc",
   "snippet": {
    "publishedAt": "2012-10-01T15:27:35.000Z",
    "channelId": "UCAuUUnT6oDeKwE6v1NGQxug",
    "title": "Your body language may shape who you are | Amy Cuddy",
    "description": "Body language affects how others see us, but it may also change how we see ourselves. Social psychologist Amy Cuddy argues that \"power posing\" -- standing in a posture of confidence, even when we don't feel confident -- can boost feelings of confidence, and might have an impact on our chances for success. (Note: Some of the findings presented in this talk have been referenced in an ongoing debate among social scientists about robustness and reproducibility. Read Amy Cuddy's response here: http://ideas.ted.com/inside-the-debate-about-power-posing-a-q-a-with-amy-cuddy/)\n\nGet TED Talks recommended just for you! Learn more at https://www.ted.com/signup.\n\nThe TED Talks channel features the best talks and performances from the TED Conference, where the world's leading thinkers and doers give the talk of their lives in 18 minutes (or less). Look for talks on Technology, Entertainment and Design -- plus science, business, global issues, the arts and more.\n\nFollow TED on Twitter: http://www.twitter.com/TEDTalks\nLike TED on Facebook: https://www.facebook.com/TED\n\nSubscribe to our channel: https://www.youtube.com/TED",
    "thumbnails": {
     "default": {
      "url": "https://i.ytimg.com/vi/Ks-_Mh1QhMc/default.jpg",
      "width": 120,
      "height": 90
     },
     "medium": {
      "url": "https://i.ytimg.com/vi/Ks-_Mh1QhMc/mqdefault.jpg",
      "width": 320,
      "height": 180
     },
     "high": {
      "url": "https://i.ytimg.com/vi/Ks-_Mh1QhMc/hqdefault.jpg",
      "width": 480,
      "height": 360
     },
     "standard": {
      "url": "https://i.ytimg.com/vi/Ks-_Mh1QhMc/sddefault.jpg",
      "width": 640,
      "height": 480
     },
     "maxres": {
      "url": "https://i.ytimg.com/vi/Ks-_Mh1QhMc/maxresdefault.jpg",
      "width": 1280,
      "height": 720
     }
    },
    "channelTitle": "TED",
    "tags": [
     "Amy Cuddy",
     "TED",
     "TEDTalk",
     "TEDTalks",
     "TED Talk",
     "TED Talks",
     "TEDGlobal",
     "brain",
     "business",
     "psychology",
     "self",
     "success"
    ],
    "categoryId": "22",
    "liveBroadcastContent": "none",
    "defaultLanguage": "en",
    "localized": {
     "title": "Your body language may shape who you are | Amy Cuddy",
     "description": "Body language affects how others see us, but it may also change how we see ourselves. Social psychologist Amy Cuddy argues that \"power posing\" -- standing in a posture of confidence, even when we don't feel confident -- can boost feelings of confidence, and might have an impact on our chances for success. (Note: Some of the findings presented in this talk have been referenced in an ongoing debate among social scientists about robustness and reproducibility. Read Amy Cuddy's response here: http://ideas.ted.com/inside-the-debate-about-power-posing-a-q-a-with-amy-cuddy/)\n\nGet TED Talks recommended just for you! Learn more at https://www.ted.com/signup.\n\nThe TED Talks channel features the best talks and performances from the TED Conference, where the world's leading thinkers and doers give the talk of their lives in 18 minutes (or less). Look for talks on Technology, Entertainment and Design -- plus science, business, global issues, the arts and more.\n\nFollow TED on Twitter: http://www.twitter.com/TEDTalks\nLike TED on Facebook: https://www.facebook.com/TED\n\nSubscribe to our channel: https://www.youtube.com/TED"
    },
    "defaultAudioLanguage": "en"
   },
   "contentDetails": {
    "duration": "PT21M3S",
    "dimension": "2d",
    "definition": "hd",
    "caption": "true",
    "licensedContent": true,
    "projection": "rectangular"
   },
   "statistics": {
    "viewCount": "17328644",
    "likeCount": "241869",
    "dislikeCount": "4823",
    "favoriteCount": "0",
    "commentCount": "7741"
   }
  }
 ]
}

you can get that information from the title and form localized.title

I hope language sdk's support this.

Below is the screenshot image for the title

这篇关于Youtube API 检索直播游戏标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆