2012-09-20 54 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是正確的。

我想知道是否有修復程序,或者我失蹤了?我不想回滾棄用的身份驗證方法,這將不安全,但我有任何選擇嗎?

回答

相關問題