【问题标题】:YouTube Api 3.0YouTube API 3.0
【发布时间】:2013-11-09 13:31:30
【问题描述】:

我的身份验证一切正常,但是当我尝试使用 php 库获取类别列表时:

// $client is the google client object
$youtube = new Google_YoutubeService($client);
$youtube->videoCategories->listVideoCategories("id");

我得到了回应:

'调用 GET https://www.googleapis.com/youtube/v3/videoCategories?part=id 时出错:(400) 未选择过滤器'

listVideoCategories 中没有“过滤器”选项,唯一接受的参数是 $part 和可选参数...与过滤器无关?

【问题讨论】:

    标签: php youtube


    【解决方案1】:

    显然,您需要提供您想要的类别 ID 或您想要所有类别的区域。您可以在这里尝试并阅读详细信息:https://developers.google.com/youtube/v3/docs/videoCategories/list

    这应该可行:

    // $client is the google client object
    $youtube = new Google_YoutubeService($client);
    $categories = $youtube->videoCategories->listVideoCategories('id', array('regionCode' => 'US'));
    

    【讨论】:

      猜你喜欢
      • 2014-04-17
      • 2013-05-12
      • 1970-01-01
      • 2020-07-07
      • 2013-09-20
      • 1970-01-01
      • 2013-10-07
      • 1970-01-01
      • 2013-07-10
      相关资源
      最近更新 更多