本文介绍了弃用“googlePlusUserId"后如何关联 Youtube 频道及其 Google 帐户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

googlePlusUserId"Youtube 数据 API 的最后一次审核(2016 年 6 月 13 日)中已弃用 YouTube 频道对象的 .来自 YouTube 数据 API 修订历史记录:

The "googlePlusUserId" of the YouTube channel object has been deprecated in the last review of the Youtube Data API (June 13, 2016). From the YouTube Data API revision history:

频道资源的 contentDetails.googlePlusUserId 属性已被弃用.以前,该属性仅在频道与 Google+ 个人资料相关联时才存在.弃用后,该属性将不再包含在任何频道资源中.

我使用此属性将 YouTube 频道与其 Google 帐户相关联.通过这种方式,我能够在我的页面中验证使用 Google 登录的用户是 YouTube 频道的所有者.那么现在没有这个属性怎么办?

I was using this property to relate a YouTube channel with its Google account. By this way I was able to verify in my page that a user signed in with Google is the owner of a YouTube channel. So how to do it now without this property?

我的用例是一个网络应用程序,它邀请一些 YouTube 频道(用户)访问该网站.理想情况下,此邀请必须通过直接电子邮件发送到用户的电子邮件或通过 YouTube 数据 API 直接发送到 YouTube 频道.但是,这两个选项都不可行,因为无法检索电子邮件,而且实际上没有通过 API 向 YouTube 频道发送直接消息的功能.因此,要邀请 YouTube 频道,我们必须手动转到 YouTube 频道的关于"页面,并向用户发送带有加入我们页面的链接的消息.此链接是一个带有标识此邀请的令牌的 URL,但我们需要确保来自此链接的用户是被邀请的 YouTube 频道的所有者,因此唯一的方法是使用他的 YouTube 频道帐户登录Google 帐户.

My use case is a web application which invites some YouTube Channels (users) to the website. Ideally this invitation must be with a direct email to the email of the user or a direct message to the YouTube Channel through the YouTube Data API. However, both options are not viable because it is impossible to retrieve the email and actually there is not a functionality to send direct messages to a YouTube Channel through the API. So to invite a YouTube channel we have to manually go to the YouTube Channel about page and send a message to the user with the link to join our page. This link is an URL with a token identifying this invite but we need to be sure that the user coming from this link is the owner of the YouTube channel which has been invited, so the only way is logging in with his YouTube channel account which is the Google account.

我希望我已经解释得很好,如果你有任何疑问,可以问我.

I hope I have explained it well, if you have any doubt ask me.

谢谢!

推荐答案

我找到了解决方案.您可以再次致电 people/me Google+ API 端点,用于获取当前登录的 Google 用户的id.

I found a solution. You can make another call to people/me Google+ API endpoint to get the id of currently logged Google user.

此处您可以找到有关您必须授予令牌以访问用户数据的 OAuth 范围的更多信息.

Here you can find more information about OAuth scope you have to to grant to the token for access to user's data.

这篇关于弃用“googlePlusUserId"后如何关联 Youtube 频道及其 Google 帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 11:36