2012-09-20 55 views
0

我试图使用YouTube API删除收藏夹。由于Google最近弃用了AuthSub身份验证方法,因此我决定选择正式推荐的OAuth2身份验证方法。使用OAuth2进行身份验证时删除YouTube收藏夹

我能够设置视频的喜爱,但是当我尝试使用the described method in the docs将其删除,响应是:

Only the favorite owner can remove it. 

我使用的Google OAuth2 Playground,我能够设置一个视频作为收藏,所以我非常肯定,认证没有错误,但仍然不起作用。

我提出请求如下:

DELETE /feeds/api/users/default/favorites/nq3gs6PG8-E HTTP/1.1 
Host: gdata.youtube.com 
X-gdata-key: key=DEVELOPER_KEY 
Content-length: 0 
Authorization: OAuth ACCESS_TOKEN 
---------------------------------------- 
HTTP/1.1 403 Forbidden 
Content-length: 38 
X-xss-protection: 1; mode=block 
X-content-type-options: nosniff 
X-google-cache-control: remote-fetch 
-content-encoding: gzip 
Server: GSE 
Reason: Forbidden 
Via: HTTP/1.1 GWA 
X-gdata-user-country: US 
Cache-control: private, max-age=0 
Date: Thu, 20 Sep 2012 17:53:19 GMT 
X-frame-options: SAMEORIGIN 
Content-type: text/html; charset=UTF-8 
Expires: Thu, 20 Sep 2012 17:53:19 GMT 

Only the favorite owner can remove it. 

我已经设置了“nq3gs6PG8-E”视频作为最喜欢的,我的Developer_Key开发和ACCESS_TOKEN是正确的。

我想知道是否有修复程序,或者我失踪了?我不想回滚弃用的身份验证方法,这将不安全,但我有任何选择吗?

回答

相关问题