gpt4 book ai didi

youtube-api - YouTube API v3 获取与登录用户关联的所有 channel

转载 作者:行者123 更新时间:2023-12-04 07:02:44 25 4
gpt4 key购买 nike

是否可以使用 youtube 的第 3 版 API ( https://developers.google.com/apis-explorer/#p/youtube/v3/ ) 获取与登录用户帐户关联的所有 channel 。

我可以看到 YouTube.channels.list 最近的电话

https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list

我尝试通过“使用 OAuth 2.0 授权请求”来使用它,我选择 part=snippet 和 mine=true

https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list?part=snippet&mine=true&_h=1&

但这只会带回单个 channel ,而不是与该帐户关联的任何其他 channel ,但我使用的帐户有多个 channel 。我需要为登录用户获取所有 channel ,以便我可以让他们选择他们正在使用的 channel ,尤其是现在谷歌已经将 YouTube 与谷歌加集成搞砸了。

有谁知道这是否可能?

最佳答案

在 YouTube 的 API 博客中找到了答案:

http://apiblog.youtube.com/2013/06/google-page-identities-and-youtube-api.html
据此,当我将 Android 与 OAuth2 一起使用时,没有 native Android 帐户切换器,并且

the then the API will choose the “wrong” channel in some cases, or even no channel (e.g., if the personal account doesn’t have a channel).



所以我有两个选择 When this happens, the user has two options to specify the correct channel:
  • Use the Advanced Account Settings tool to select which channel should be used. This is recommended when a user has one channel they want to use for all applications.

  • Set up login credentials for each of their Google+ pages, and specify those > credentials, not their normal Google Account credentials, for each application that needs access.



这两个选项都要求用户在 Android 应用程序的边界之外做一些事情,因此这两个解决方案都不可用。不幸的是,这项功能将不得不等到 Android 有更好的方式为用户切换 channel ......

关于youtube-api - YouTube API v3 获取与登录用户关联的所有 channel ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20072799/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com