Playlists
*********

YTMusic.get_playlist(playlistId: str, limit: int | None = 100, related: bool = False, suggestions_limit: int = 0) -> dict[str, Any]

   Returns a list of playlist items

   Parameters:
      * **playlistId** ("str") -- Playlist id

      * **limit** ("int" | "None") -- How many songs to return. "None"
        retrieves them all. Default: 100

      * **related** ("bool") -- Whether to fetch 10 related playlists
        or not. Default: False

      * **suggestions_limit** ("int") -- How many suggestions to
        return. The result is a list of suggested playlist items
        (videos) contained in a "suggestions" key. 7 items are
        retrieved in each internal request. Default: 0

   Return type:
      "dict"["str", "Any"]

   Returns:
      Dictionary with information about the playlist. The key "tracks"
      contains a List of playlistItem dictionaries

   The result is in the following format:

      {
        "id": "PLQwVIlKxHM6qv-o99iX9R85og7IzF9YS_",
        "privacy": "PUBLIC",
        "title": "New EDM This Week 03/13/2020",
        "thumbnails": [...]
        "description": "Weekly r/EDM new release roundup. Created with github.com/sigma67/spotifyplaylist_to_gmusic",
        "author": {
            "name": "sigmatics",
            "id": "..."
        },
        "year": "2020",
        "duration": "6+ hours",
        "duration_seconds": 52651,
        "trackCount": 237,
        "suggestions": [
            {
              "videoId": "HLCsfOykA94",
              "title": "Mambo (GATTÜSO Remix)",
              "artists": [{
                  "name": "Nikki Vianna",
                  "id": "UCMW5eSIO1moVlIBLQzq4PnQ"
                }],
              "album": {
                "name": "Mambo (GATTÜSO Remix)",
                "id": "MPREb_jLeQJsd7U9w"
              },
              "likeStatus": "LIKE",
              "thumbnails": [...],
              "isAvailable": true,
              "isExplicit": false,
              "duration": "3:32",
              "duration_seconds": 212,
              "setVideoId": "to_be_updated_by_client"
            }
        ],
        "related": [
            {
              "title": "Presenting MYRNE",
              "playlistId": "RDCLAK5uy_mbdO3_xdD4NtU1rWI0OmvRSRZ8NH4uJCM",
              "thumbnails": [...],
              "description": "Playlist • YouTube Music"
            }
        ],
        "tracks": [
          {
            "videoId": "bjGppZKiuFE",
            "title": "Lost",
            "artists": [
              {
                "name": "Guest Who",
                "id": "UCkgCRdnnqWnUeIH7EIc3dBg"
              },
              {
                "name": "Kate Wild",
                "id": "UCwR2l3JfJbvB6aq0RnnJfWg"
              }
            ],
            "album": {
              "name": "Lost",
              "id": "MPREb_PxmzvDuqOnC"
            },
            "duration": "2:58",
            "duration_seconds": 178,
            "setVideoId": "748EE8..."
            "likeStatus": "INDIFFERENT",
            "thumbnails": [...],
            "isAvailable": True,
            "isExplicit": False,
            "videoType": "MUSIC_VIDEO_TYPE_OMV",
            "inLibrary": False,
            "feedbackTokens": {
              "add": "AB9zfpJxtvrU...",
              "remove": "AB9zfpKTyZ..."
            },
            "pinnedToListenAgain": False,
            "listenAgainFeedbackTokens": {
              "pin": "AB9zfpImL2k...",
              "unpin": "AB9zfpJt6pA..."
            },
            "communityVoteStatus": {
              "netVoteValue": 12,
              "status": "VOTE_STATUS_UPVOTED""
            }
          }
            "creditsBrowseId": "MPTCekz1IJ9I0sw"
        ]
      }

   The setVideoId is the unique id of this playlist item and needed
   for moving/removing playlist items

   Note that communityVoteStatus can be null if the information is not
   available (i.e. playlist does not have that setting enabled, the
   request is not authenticated, ...)

   Collaborative playlists replace "author" with limited data about
   "collaborators"::
      {
         "collaborators": {
            "text": "by Sample Author and 1 other", "avatars": [

               {
                  "url": "https://yt3.ggpht.com/sample-author-photo"

               }, {

                  "url": "https://yt3.ggpht.com/sample-collaborator-
                  photo"

               }

            ]

         }

      }

YTMusic.create_playlist(title: str, description: str, privacy_status: str = 'PRIVATE', video_ids: list[str] | None = None, source_playlist: str | None = None) -> str | dict[str, Any]

   Creates a new empty playlist and returns its id.

   Parameters:
      * **title** ("str") -- Playlist title

      * **description** ("str") -- Playlist description

      * **privacy_status** ("str") -- Playlists can be "PUBLIC",
        "PRIVATE", or "UNLISTED". Default: "PRIVATE"

      * **video_ids** ("list"["str"] | "None") -- IDs of songs to
        create the playlist with

      * **source_playlist** ("str" | "None") -- Another playlist whose
        songs should be added to the new playlist

   Return type:
      "str" | "dict"["str", "Any"]

   Returns:
      ID of the YouTube playlist or full response if there was an
      error

YTMusic.join_collaborative_playlist(playlistId: str, joinCollaborationToken: str) -> str | dict[str, Any]

   Given an invite token, join a collaborative playlist and add it to
   your library.

   Parameters:
      * **playlistId** ("str") -- ID of the playlist to join. If
        you're already a collaborator, an Unauthorized server error is
        raised.

      * **joinCollaborationToken** ("str") -- See "edit_playlist()",
        or "jct" in YTM's invite URL

   Return type:
      "str" | "dict"["str", "Any"]

   Returns:
      Status String or full response

YTMusic.edit_playlist(playlistId: str, title: str | None = None, description: str | None = None, privacyStatus: str | None = None, collaboration: bool | None = None, moveItem: str | tuple[str, str] | None = None, addPlaylistId: str | None = None, sortOrder: PlaylistSortOrder | None = None, addToTop: bool | None = None, voteOption: PlaylistVoteEditOptions | None = None) -> str | dict[str, Any]

   Edit title, description or privacyStatus of a playlist. You may
   also move an item within a playlist or append another playlist to
   this playlist.

   Parameters:
      * **playlistId** ("str") -- Playlist id

      * **title** ("str" | "None") -- Optional. New title for the
        playlist

      * **description** ("str" | "None") -- Optional. New description
        for the playlist

      * **privacyStatus** ("str" | "None") -- Optional. New privacy
        status for the playlist

      * **collaboration** ("bool" | "None") -- Optional. Enable or
        disable collaboration. If False and collaboration is not
        enabled, a Forbidden server error is raised. If True, a new
        "joinCollaborationToken" is returned. Collaborators cannot
        interact with private playlists.

      * **moveItem** ("str" | "tuple"["str", "str"] | "None") --
        Optional. Move one item before another. Items are specified by
        setVideoId, which is the unique id of this playlist item. See
        "get_playlist()"

      * **addPlaylistId** ("str" | "None") -- Optional. Id of another
        playlist to add to this playlist

      * **sortOrder** ("PlaylistSortOrder" | "None") -- Optional.
        Change the order tracks are returned in. The default is
        "MANUAL".

      * **addToTop** ("bool" | "None") -- Optional. Change the state
        of this playlist to add items to the top of the playlist (if
        True) or the bottom of the playlist (if False - this is also
        the default of a new playlist).

      * **VoteOption** -- Optional. Change who can participate in
        community voting in this playlist. Note that a bad request
        will be thrown if voteOption is
        PlaylistVoteEditOptions.COLLABORATORS_ONLY but the playlist is
        not enabled for collaboration prior to the edit.

   Return type:
      "str" | "dict"["str", "Any"]

   Returns:
      Status String, "collaboration" dict described below, or full
      response

   Dictionary returned when "collaboration" is True and the request is
   successful:

      {
          "status": "STATUS_SUCCEEDED",
          "joinCollaborationToken": "kM9wXdRj2p8v_qL3sHBkTz"
      }

YTMusic.delete_playlist(playlistId: str) -> str | dict[str, Any]

   Delete a playlist.

   Parameters:
      **playlistId** ("str") -- Playlist id

   Return type:
      "str" | "dict"["str", "Any"]

   Returns:
      Status String or full response

YTMusic.add_playlist_items(playlistId: str, videoIds: list[str] | None = None, source_playlist: str | None = None, duplicates: bool = False) -> str | dict[str, Any]

   Add songs to an existing playlist

   Parameters:
      * **playlistId** ("str") -- Playlist id

      * **videoIds** ("list"["str"] | "None") -- List of Video ids

      * **source_playlist** ("str" | "None") -- Playlist id of a
        playlist to add to the current playlist (no duplicate check)

      * **duplicates** ("bool") -- If True, duplicates will be added.
        If False, an error will be returned if there are duplicates
        (no items are added to the playlist)

   Return type:
      "str" | "dict"["str", "Any"]

   Returns:
      Status String and a dict containing the new setVideoId for each
      videoId or full response

YTMusic.remove_playlist_items(playlistId: str, videos: list[dict[str, Any]]) -> str | dict[str, Any]

   Remove songs from an existing playlist

   Parameters:
      * **playlistId** ("str") -- Playlist id

      * **videos** ("list"["dict"["str", "Any"]]) -- List of
        PlaylistItems, see "get_playlist()". Must contain videoId and
        setVideoId

   Return type:
      "str" | "dict"["str", "Any"]

   Returns:
      Status String or full response
