【问题标题】:Getting YouTube user profile fails with 401 Unauthorized for some accounts获取 YouTube 用户个人资料失败,某些帐户出现 401 Unauthorized
【发布时间】:2013-02-20 20:02:40
【问题描述】:

通过使用没有 YouTube 频道/用户名的帐户进行身份验证并调用 Get User 方法 (https://gdata.youtube.com/feeds/api/users/default),我能够在 OAuth 2.0 Playground 中复制此问题。

【问题讨论】:

    标签: youtube-api


    【解决方案1】:

    可以在没有 YouTube 频道的情况下拥有 YouTube 帐户(即拥有 YouTube 用户名)。 Google 将此称为未关联的帐户。

    如果您在未关联的帐户上调用 YouTube API 2.0 版中定义的某些方法,它们将引发 401 Unauthorized 错误。事实证明,有一个相对未记录的 YouTube API 版本(2.1 版)可以为未关联的帐户启用功能。

    更多信息:http://apiblog.youtube.com/2011/10/introducing-google-account-support-and.html

    只需将版本标头从 GData-Version: 2.0 更改为 GData-Version: 2.1,我就能修复 OAuth 2.0 Playground 中的错误。

    【讨论】:

      猜你喜欢
      • 2014-02-01
      • 2014-09-21
      • 2010-12-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多