Add video to user's “Watch Later” playlist on YouTube

后端 未结 3 1852
野性不改
野性不改 2021-02-04 04:02

The aim is to create a Watch Later button using the YouTube API. When a user clicks the button, the video is saved into the user\'s Watch Later playlist. Simila

3条回答
  •  日久生厌
    2021-02-04 04:41

    I don't know if this will help you much since I never worked with Youtube's API. But have a look at this answer on how to get the Watch Later playlist using Youtube's API v3.

    Then you can take a look this, from Youtube docs, for inserting an element into a given playlist.

    ANYWAY I'm not sure this is possible anymore (you can give it a try) since September 15, 2016 revision:

    Referring to point 2.2 in the list:

    The channel resource's contentDetails.relatedPlaylists.watchHistory and contentDetails.relatedPlaylists.watchLater properties now contain values of HL and WL, respectively, for all channels.

    To be clear, these properties are only visible to an authorized user retrieving data about the user's own channel. The properties always contain the values HL and WL, even for an authorized user retrieving data about the user's own channel. Thus, the watch history and watch later playlist IDs cannot be retrieved via the API.

    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.

提交回复
热议问题