The Artist
class represents an artist in the Spotify catalog, providing methods to interact with the Spotify API for artist-related queries and actions.
-
login:
Optional[Login]
, optional
A logged-inLogin
object. Required for certain methods. If not provided, some methods will raise aValueError
. -
client:
TLSClient
, optional
ATLSClient
used for making requests to the API. If not provided, a default one will be used.
__init__(self, login: Login | None = None, *, client: TLSClient = TLSClient("chrome_120", "", auto_retries=3)) -> None
Initializes the Artist
class. If a Login
object is provided, it checks if the user is logged in. If not, a ValueError
is raised.
Searches for an artist in the Spotify catalog.
-
Parameters:
query
: The search term for the artist.limit
: The maximum number of results to return (default is 10).offset
: The offset from where to start fetching results (default is 0).
-
Returns: A mapping of the search results.
Generates artist data in chunks.
-
Parameters:
query
: The search term for the artist.
-
Yields: A generator of artist data chunks.
Follows an artist on Spotify.
- Parameters:
artist_id
: The ID of the artist to follow.
Unfollows an artist on Spotify.
- Parameters:
artist_id
: The ID of the artist to unfollow.