DELETEing a YouTube watchLater playlist item failing - returning 404

社会主义新天地 提交于 2019-12-03 10:03:37

问题


i have code that deletes an item from my youtube watchLater playlist. this was working ok up to about two weeks ago - now i'm getting a 404 error from youtube.

here's the sequence of requests and responses (with authentication details stripped, of course):

get playlist items request:

GET https://www.googleapis.com/youtube/v3/playlistItems?fields=items/id&part=snippet&playlistId=WLlue5EIJLscoxMgEkEZfq_A

get playlist items response:

{
 "items": [
  {
   "id": "V0xsdWU1RUlKTHNjb3hNZ0VrRVpmcV9BLjU2QjQ0RjZEMTA1NTdDQzY="
  }
 ]
}

delete request:

DELETE https://www.googleapis.com/youtube/v3/playlistItems?id=V0xsdWU1RUlKTHNjb3hNZ0VrRVpmcV9BLjU2QjQ0RjZEMTA1NTdDQzY=

delete response:

{
 "error": {
  "errors": [
   {
    "domain": "youtube.playlistItem",
    "reason": "playlistItemNotFound",
    "message": "Playlist item not found.",
    "locationType": "parameter",
    "location": "id"
   }
  ],
  "code": 404,
  "message": "Playlist item not found."
 }
}

when i view the playlist via the youtube web site, i can see that the item hasn't been deleted.

the docs for the api indicate that i'm doing everything correctly. while debugging i noticed that the playlist item id is a base64 encoded string; i get 404 using both the encoded and decoded string.

this issue isn't limited to one particular item; it appears any item i place in my watchLater playlist cannot be deleted. i don't have any issues deleting items from other playlists; only watchLater is having this problem.

anyone have any idea what's going on?

Edit (Oct 2016): Google have said the Watch Later playlist has been deprecated. See https://developers.google.com/youtube/v3/revision_history


回答1:


The issue is closed in the google issue tracker:

Marking this issue as Obsolete as the Watch Later playlist has been deprecated. Please see the Revision History for details: https://developers.google.com/youtube/v3/revision_history


In addition, requests to retrieve playlist details (playlists.list) or playlist items (playlistItems.list) for a channel's watch history or watch later playlist now return empty lists. This behavior is true for the new values, HL and WL, as well as for any watch history or watch later playlist IDs that your API Client may have already stored.



来源:https://stackoverflow.com/questions/36234393/deleteing-a-youtube-watchlater-playlist-item-failing-returning-404

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!