Youtube api ServiceBankedenException链接通道

Youtube api ServiceBankedenException链接通道,youtube-api,Youtube Api,我有一个为客户创建和上传视频的应用程序。在尝试上载之前,客户授予授权,并保存生成的访问和刷新令牌。有时,客户没有与他们的Google帐户关联的YouTube频道。我检测到这一点,并为他们创建一个通道。这通常很好用。但并非总是如此。以下是创建通道失败的示例: Obtaining access token for Customer post https://accounts.google.com/o/oauth2/token HTTP Response: 200 { "access_token"

我有一个为客户创建和上传视频的应用程序。在尝试上载之前,客户授予授权,并保存生成的访问和刷新令牌。有时,客户没有与他们的Google帐户关联的YouTube频道。我检测到这一点,并为他们创建一个通道。这通常很好用。但并非总是如此。以下是创建通道失败的示例:

Obtaining access token for Customer
post https://accounts.google.com/o/oauth2/token
HTTP Response: 200
{
 "access_token" : "_new_access_token_",
 "token_type" : "Bearer",
 "expires_in" : 3600
}

Uploading video '_video_name_' for Customer
post http://uploads.gdata.youtube.com/feeds/api/users/default/uploads
    Authorization: Bearer _new_access_token_
    GData-Version: 2.1
    X-GData-Key: key=_GData_Key_
    Slug: n3n1xs.mp4
    Content-Type: multipart/related; boundary="51d366cb05b71"
    Content-Length: 255958407
    Connection: close
HTTP Response: 403
<?xml version='1.0' encoding='UTF-8'?><errors><error><domain>yt:service</domain><code>youtube_signup_required</code></error></errors>

Obtaining channel names for Customer
get https://gdata.youtube.com/feeds/api/suggest/username?hint=CustomerNameVT&fields=entry%2Ftitle
    GData-Version: 2.1
    X-GData-Key: key=_GData_Key_
HTTP Response: 200
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom'><entry><title>CustomerNameVT</title></entry><entry><title>VTCustomerName</title></entry><entry><title>VTNameCustomer</title></entry><entry><title>CustomerVTName</title></entry><entry><title>CustomerNameVT1</title></entry><entry><title>NameCustomerVT</title></entry><entry><title>NameVTCustomer</title></entry></feed>

Linking YT channel for Customer (CustomerNameVT)
put https://gdata.youtube.com/feeds/api/users/default
    Authorization: Bearer _new_access_token_
    Content-Type: application/atom+xml
    GData-Version: 2.1
    X-GData-Key: key=_GData_Key_
<entry xmlns='http://www.w3.org/2005/Atom' xmlns:yt='http://gdata.youtube.com/schemas/2007'><yt:username>CustomerNameVT</yt:username></entry>
HTTP Response: 403
<errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>ServiceForbiddenException</code><internalReason>Forbidden</internalReason></error></errors>

请注意,请求的名称是建议用户名api建议的第一个名称。就我所知,这应该行得通。通常是这样。这次怎么了?

将Google帐户链接到新频道的API是


我们的目标是明确地让用户通过一个基于网络的链接过程,从(或m.youtube.com等效网站)开始。

对于我们的大多数客户来说,顺序如下:注册一个谷歌帐户,授权上传,然后创建一个YT频道。这要求很高。在授予授权后,谷歌将其转移回我们的网站。不幸的是,createchannel进程似乎无法做到这一点。“下一个”链接似乎仅限于youtube.com。跨站点脚本规则阻止监视该脚本。所以,我们决定处理这个问题的方式是请求授权,然后每次上传检查他们是否有YT帐户。如果是这样,我们使用它,如果不是,我们上传到我们自己的频道。我听到一些内部传言,如果你使用Google+登录按钮为你处理OAuth 2,将来你可能会得到保证,最终结果将是授权一个支持上传的频道,因为链接到Google+帐户的YouTube频道确实支持上传。