【问题标题】:YouTube Data API v3 - Comment threads request doesn't return count of total resultsYouTube Data API v3 - 评论线程请求不返回总结果数
【发布时间】:2015-08-09 21:47:24
【问题描述】:

当我执行以下 YouTube 数据 API 请求以列出 commentThreads 时,pageInfo/totalResults 不会在响应中返回。

我希望pageInfo/totalResults 会返回per the documentation

GET https://www.googleapis.com/youtube/v3/commentThreads?part=snippet%2Creplies&videoId=dGidYBqBHVw&key={YOUR_API_KEY}

例如,如果您使用API Explorer,则输入:

  • 部分:sn-p,回复
  • videoId:dGidYBqBHVw

响应返回 200 OK 和其余数据,但省略了 pageInfo/totalResults 值:

"pageInfo": {
  "resultsPerPage": 20
} 

【问题讨论】:

    标签: api youtube youtube-api youtube-data-api


    【解决方案1】:

    我刚刚尝试了您发布的请求并得到了

    {
     "kind": "youtube#commentThreadListResponse",
     "etag": "\"sGDdEsjSJ_SnACpEvVQ6MtTzkrI/p78HIXZZWNay4CG1YPcS0NCjiOw\"",
     "nextPageToken": "Cg0QnNnZ0pTFxwIgACgBEhQIABCI5cnWjcTHAhi4kKTI3bvHAhgCIBQondOJjuX1p_e5AQ==",
     "pageInfo": {
      "totalResults": 20,
      "resultsPerPage": 20
     },...
    }
    

    好像已经修复了。

    【讨论】:

    • 不是真的...为什么即使视频上有更多的 cmets,totalResults 也等于 resultsPerPage?
    【解决方案2】:

    我也为此感到疲倦。这个对我有用。 Youtube 或 Google 通常会更改其 api 格式或数据结构。这不是什么大事。

    【讨论】:

      猜你喜欢
      • 2018-04-14
      • 2015-10-11
      • 2016-09-01
      • 1970-01-01
      • 2016-03-24
      • 2015-07-10
      • 2015-07-10
      • 2016-08-27
      • 1970-01-01
      相关资源
      最近更新 更多