【发布时间】:2015-08-24 16:33:21
【问题描述】:
我正在尝试使用 YouTube API 删除收藏夹。由于 Google 最近弃用了 AuthSub 认证方式,所以我决定选择官方推荐的 OAuth2 认证方式。
我可以将视频设置为收藏,但是当我尝试使用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 是正确的。
我想知道是否有修复,或者我缺少什么?我不想回滚已弃用的身份验证方法,那不安全,但我有什么选择吗?
【问题讨论】:
标签: youtube oauth-2.0 gdata favorite