【问题标题】:Cannot access youtube api with v3无法使用 v3 访问 youtube api
【发布时间】:2015-05-12 14:42:40
【问题描述】:

尝试使用 v3 从我的频道获取所有视频,但无济于事。我收到错误 403:禁止。我已经为我的帐户激活了 vs api(这是频道的所有者)。

$.get(
       "https://www.googleapis.com/youtube/v3/channels", {
           part: 'contentDetails',
           id: 'xxx',
           key: 'xxx'
       },
       function (data) {
           $.each(data.items, function (i, item) {
               console.log(item);
               pid = item.contentDetails.relatedPlaylists.uploads;
               getVids(pid);
           });
       }
    );

因为这个错误,我走得更远。如果没有激活 api 或没有正确的密钥,还有什么问题?

【问题讨论】:

    标签: jquery youtube-api


    【解决方案1】:

    我太傻了。再次阅读文档并意识到我拥有该频道并且需要使用“forUsername”而不是id。

    【讨论】:

      猜你喜欢
      • 2014-11-19
      • 2014-08-13
      • 2016-06-22
      • 2019-01-11
      • 2019-06-22
      • 2021-12-04
      • 2015-04-23
      • 2013-05-03
      • 2014-04-18
      相关资源
      最近更新 更多