Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Youtube Data API v3 PlaylistItems update not working for Watch Later playlists

Recently, the youtube.playlistItems.list doesn't fetch a playlist item that is suitable for the youtube.playlistItems.update when listing the watchLater playlist. Its works perfectly for playlist that aren't under the relatedPlaylists category of a channel. (e.g. History, favourite, likes etc.)

My list response looks like this:

{
 "items": [
  {
   "id": "V0xWWlh5N2JrM0JSTjAtcDJVUmdjc3JRLjZCM0UwMDFFNUU3NzYzNjc=",
   "snippet": {
    "publishedAt": "2016-03-21T19:04:22.000Z",
    "title": "One Word - Episode 38: Skin Tone (Black Women)",
    .
    .
    .
    "channelTitle": "Ryan Carter",
    "playlistId": "WLVZXy7bk3BRN0-p2URgcsrQ",
    "position": 0,
    "resourceId": {
     "kind": "youtube#video",
     "videoId": "0gYgzN6B0y4"
    }
   }
  },

But when I use those values:

PUT https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2Cid&key={YOUR_API_KEY}

{
 "id": "V0xWWlh5N2JrM0JSTjAtcDJVUmdjc3JRLjZCM0UwMDFFNUU3NzYzNjc=",
 "snippet": {
  "playlistId": "WLVZXy7bk3BRN0-p2URgcsrQ",
  "resourceId": {
   "kind": "youtube#video",
   "videoId": "0gYgzN6B0y4"
  }
 }
}

I get:

404 null

- Show headers -

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

}

  • Down for just me?
  • Have Google blocked updates for the Watch Later playlist?
  • Is the service broken?
like image 442
Ryan Avatar asked Mar 26 '16 18:03

Ryan


People also ask

What are the API methods for playlistitems resources?

The API supports the following methods for playlistItems resources: Returns a collection of playlist items that match the API request parameters. You can retrieve all of the playlist items in a specified playlist or retrieve one or more playlist items by their unique IDs.

How to update a playlist using the API?

The request must specify a playlist title. The API does not support the ability to update the specified playlist. For example, you can't update the properties of your uploaded videos playlist. Try it! Use the APIs Explorer to call this API and see the API request and response.

What are the API error messages for the playlist API?

The following table identifies error messages that the API could return in response to a call to this method. Please see the error message documentation for more detail. The request is not properly authorized to update the specified playlist item. The request attempts to set the playlist item's position to an invalid or unsupported value.

How to get started with YouTube Data API?

Click on Enable API option. In the search field, search for Youtube Data API and select the Youtube Data API option that comes in the drop down list. You will be redirected to a screen that says information about the Youtube Data API, along with two options : ENABLE and TRY API. Click on ENABLE option to get started with the API.


1 Answers

Looks like the "bug" was just part of the transition period where YouTube planned to remove the ability to fetch the Watch Later and Watch History playlist through there API. As Tym commented the "bug" is/was tracked here: https://code.google.com/p/gdata-issues/issues/detail?id=8145 .

TLDR:

"Requests to retrieve playlist details (playlists.list) for a channel's watch history or watch later playlist will return an empty list after September 12, 2016. Requests to retrieve playlist items (playlistItems.list) in either of those playlists will also return an empty list after that time. This 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://developers.google.com/youtube/v3/revision_history#september-15-2016

like image 189
Ryan Avatar answered Sep 21 '22 14:09

Ryan