Library
*******

YTMusic.get_library_playlists(limit: int | None = 25) -> list[dict[str, Any]]

   Retrieves the playlists in the user's library.

   Parameters:
      **limit** ("int" | "None") -- Number of playlists to retrieve.
      "None" retrieves them all.

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

   Returns:
      List of owned playlists.

   Each item is in the following format:

      {
          'playlistId': 'PLQwVIlKxHM6rz0fDJVv_0UlXGEWf-bFys',
          'title': 'Playlist title',
          'thumbnails: [...],
          'count': 5
      }

YTMusic.get_library_songs(limit: int = 25, validate_responses: bool = False, order: Literal['a_to_z', 'z_to_a', 'recently_added'] | None = None) -> list[dict[str, Any]]

   Gets the songs in the user's library (liked videos are not
   included). To get liked songs and videos, use "get_liked_songs()"

   Parameters:
      * **limit** ("int") -- Number of songs to retrieve

      * **validate_responses** ("bool") -- Flag indicating if
        responses from YTM should be validated and retried in case
        when some songs are missing. Default: False

      * **order** ("Literal"["'a_to_z'", "'z_to_a'",
        "'recently_added'"] | "None") -- Order of songs to return.
        Allowed values: "a_to_z", "z_to_a", "recently_added". Default:
        Default order.

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

   Returns:
      List of songs. Same format as "get_playlist()"

YTMusic.get_library_albums(limit: int = 25, order: Literal['a_to_z', 'z_to_a', 'recently_added'] | None = None) -> list[dict[str, Any]]

   Gets the albums in the user's library.

   Parameters:
      * **limit** ("int") -- Number of albums to return

      * **order** ("Literal"["'a_to_z'", "'z_to_a'",
        "'recently_added'"] | "None") -- Order of albums to return.
        Allowed values: "a_to_z", "z_to_a", "recently_added". Default:
        Default order.

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

   Returns:
      List of albums.

   Each item is in the following format:

      {
        "browseId": "MPREb_G8AiyN7RvFg",
        "playlistId": "OLAK5uy_lKgoGvlrWhX0EIPavQUXxyPed8Cj38AWc",
        "title": "Beautiful",
        "type": "Album",
        "thumbnails": [...],
        "artists": [{
          "name": "Project 46",
          "id": "UCXFv36m62USAN5rnVct9B4g"
        }],
        "year": "2015"
      }

YTMusic.get_library_artists(limit: int = 25, order: Literal['a_to_z', 'z_to_a', 'recently_added'] | None = None) -> list[dict[str, Any]]

   Gets the artists of the songs in the user's library.

   Parameters:
      * **limit** ("int") -- Number of artists to return

      * **order** ("Literal"["'a_to_z'", "'z_to_a'",
        "'recently_added'"] | "None") -- Order of artists to return.
        Allowed values: "a_to_z", "z_to_a", "recently_added". Default:
        Default order.

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

   Returns:
      List of artists.

   Each item is in the following format:

      {
        "browseId": "UCxEqaQWosMHaTih-tgzDqug",
        "artist": "WildVibes",
        "subscribers": "2.91K",
        "thumbnails": [...]
      }

YTMusic.get_library_subscriptions(limit: int = 25, order: Literal['a_to_z', 'z_to_a', 'recently_added'] | None = None) -> list[dict[str, Any]]

   Gets the artists the user has subscribed to.

   Parameters:
      * **limit** ("int") -- Number of artists to return

      * **order** ("Literal"["'a_to_z'", "'z_to_a'",
        "'recently_added'"] | "None") -- Order of artists to return.
        Allowed values: "a_to_z", "z_to_a", "recently_added". Default:
        Default order.

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

   Returns:
      List of artists. Same format as "get_library_artists()"

YTMusic.get_library_podcasts(limit: int = 25, order: Literal['a_to_z', 'z_to_a', 'recently_added'] | None = None) -> list[dict[str, Any]]

   Get podcasts the user has added to the library

   Parameters:
      * **limit** ("int") -- Number of podcasts to return

      * **order** ("Literal"["'a_to_z'", "'z_to_a'",
        "'recently_added'"] | "None") -- Order of podcasts to return.
        Allowed values: "a_to_z", "z_to_a", "recently_added". Default:
        Default order.

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

   Returns:
      List of podcasts. New Episodes playlist is the first podcast
      returned, but only if subscribed to relevant podcasts.

   Example:

      [
          {
              "title": "New Episodes",
              "channel":
              {
                  "id": null,
                  "name": "Auto playlist"
              },
              "browseId": "VLRDPN",
              "podcastId": "RDPN",
              "thumbnails": [...]
          },
          {
              "title": "5 Minuten Harry Podcast",
              "channel":
              {
                  "id": "UCDIDXF4WM1qQzerrxeEfSdA",
                  "name": "coldmirror"
              },
              "browseId": "MPSPPLDvBqWb1UAGeEt9n6vFH_zdGw65Obf3sH",
              "podcastId": "PLDvBqWb1UAGeEt9n6vFH_zdGw65Obf3sH",
              "thumbnails": [...]
          }
      ]

YTMusic.get_library_channels(limit: int = 25, order: Literal['a_to_z', 'z_to_a', 'recently_added'] | None = None) -> list[dict[str, Any]]

   Get channels the user has added to the library

   Parameters:
      * **limit** ("int") -- Number of channels to return

      * **order** ("Literal"["'a_to_z'", "'z_to_a'",
        "'recently_added'"] | "None") -- Order of channels to return.
        Allowed values: "a_to_z", "z_to_a", "recently_added". Default:
        Default order.

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

   Returns:
      List of channels.

   Example:

      [
          {
              "browseId": "UCRFF8xw5dg9mL4r5ryFOtKw",
              "artist": "Jumpers Jump",
              "subscribers": "1.54M",
              "thumbnails": [...]
          },
          {
              "browseId": "UCQ3f2_sO3NJyDkuCxCNSOVA",
              "artist": "BROWN BAG",
              "subscribers": "74.2K",
              "thumbnails": [...]
          }
      ]

YTMusic.get_liked_songs(limit: int = 100) -> dict[str, Any]

   Gets playlist items for the 'Liked Songs' playlist

   Parameters:
      **limit** ("int") -- How many items to return. Default: 100

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

   Returns:
      List of playlistItem dictionaries. See "get_playlist()"

YTMusic.get_saved_episodes(limit: int = 100) -> dict[str, Any]

   Gets playlist items for the 'Liked Songs' playlist

   Parameters:
      **limit** ("int") -- How many items to return. Default: 100

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

   Returns:
      List of playlistItem dictionaries. See "get_playlist()"

YTMusic.get_history() -> list[dict[str, Any]]

   Gets your play history in reverse chronological order

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

   Returns:
      List of playlistItems, see "get_playlist()" The additional
      property "played" indicates when the playlistItem was played The
      additional property "feedbackToken" can be used to remove items
      with "remove_history_items()"

YTMusic.add_history_item(song: dict[str, Any]) -> Response

   Add an item to the account's history using the playbackTracking URI
   obtained from "get_song()". A "204" return code indicates success.

   Usage:

      song = yt_auth.get_song(videoId)
      response = yt_auth.add_history_item(song)

   Note:

     You need to use the same YTMusic instance as you used for
     "get_song()".

   Parameters:
      **song** ("dict"["str", "Any"]) -- Dictionary as returned by
      "get_song()"

   Return type:
      "Response"

   Returns:
      Full response. response.status_code is 204 if successful

YTMusic.remove_history_items(feedbackTokens: list[str]) -> dict[str, Any]

   Remove an item from the account's history. This method does
   currently not work with brand accounts

   Parameters:
      **feedbackTokens** ("list"["str"]) -- Token to identify the item
      to remove, obtained from "get_history()"

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

   Returns:
      Full response

YTMusic.rate_song(videoId: str, rating: LikeStatus = LikeStatus.INDIFFERENT) -> dict[str, Any] | None

   Rates a song ("thumbs up"/"thumbs down" interactions on YouTube
   Music)

   Parameters:
      * **videoId** ("str") -- Video id

      * **rating** ("LikeStatus") --

        One of "LIKE", "DISLIKE", "INDIFFERENT"

           "INDIFFERENT" removes the previous rating and assigns no rating

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

   Returns:
      Full response

   Raises:
      YTMusicUserError if an invalid rating ir povided

YTMusic.edit_song_library_status(feedbackTokens: list[str] | None = None) -> dict[str, Any]

   Depending on the provided tokens: - Adds or removes songs from your
   library - Pins or unpins content from the "Listen Again" carousel

   Parameters:
      **feedbackTokens** ("list"["str"] | "None") -- List of
      feedbackTokens obtained from authenticated requests to endpoints
      that return songs (i.e. "get_album()")

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

   Returns:
      Full response

   Warning:

     Due to a YouTube Music bug, content might not be unpinned from
     "Listen Again".

YTMusic.rate_playlist(playlistId: str, rating: LikeStatus = LikeStatus.INDIFFERENT) -> dict[str, Any]

   Rates a playlist/album ("Add to library"/"Remove from library"
   interactions on YouTube Music) You can also dislike a
   playlist/album, which has an effect on your recommendations

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

      * **rating** ("LikeStatus") --

        One of "LIKE", "DISLIKE", "INDIFFERENT"

           "INDIFFERENT" removes the playlist/album from the library

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

   Returns:
      Full response

   Raises:
      YTMusicUserError if an invalid rating is provided

YTMusic.subscribe_artists(channelIds: list[str]) -> dict[str, Any]

   Subscribe to artists. Adds the artists to your library

   Parameters:
      **channelIds** ("list"["str"]) -- Artist channel ids

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

   Returns:
      Full response

YTMusic.unsubscribe_artists(channelIds: list[str]) -> dict[str, Any]

   Unsubscribe from artists. Removes the artists from your library

   Parameters:
      **channelIds** ("list"["str"]) -- Artist channel ids

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

   Returns:
      Full response

YTMusic.get_account_info() -> dict[str, Any]

   Gets information about the currently authenticated user's account.

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

   Returns:
      Dictionary with user's account name, channel handle, and URL of
      their account photo.

   Example:

      {
          "accountName": "Sample User",
          "channelHandle": "@SampleUser
          "accountPhotoUrl": "https://yt3.ggpht.com/sample-user-photo"
      }
