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..."
            },

        ]
      }

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

   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.edit_playlist(playlistId: str, title: str | None = None, description: str | None = None, privacyStatus: str | None = None, moveItem: str | tuple[str, str] | None = None, addPlaylistId: str | None = None, addToTop: bool | 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

      * **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

      * **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).

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

   Returns:
      Status String or full response

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
