API Reference¶
tidalapi¶
-
class
tidalapi.Session(config=<tidalapi.Config object>)[source]¶ -
access_token= None¶ The TIDAL access token, this is what you use with load_oauth_session
-
country_code= None¶
-
expiry_time= None¶ A
datetimeobject containing the date the access token will expire
-
load_oauth_session(session_id, token_type, access_token, refresh_token=None)[source]¶ Login to TIDAL using details from a previous OAuth login, automatically refreshes expired access tokens if refresh_token is supplied as well.
Parameters: - token_type – The type of token, e.g. Bearer
- session_id – The TIDAL session id, has to be a UUID
- access_token – The access token received from an oauth login or refresh
- refresh_token – (Optional) A refresh token that lets you get a new access token after it has expired
Returns: True if we believe the log in was successful, otherwise false.
-
login_oauth()[source]¶ Login to TIDAL with a remote link for limited input devices. The function will return everything you need to log in through a web browser, and will return an future that will run until login. :return: A
LinkLoginobject containing all the data needed to log in remotely, andaconcurrent.futures.Futurethat will poll until the login is completed, or until the link expires.Raises: TimeoutError: If the login takes too long
-
login_oauth_simple(function=<built-in function print>)[source]¶ Login to TIDAL using a remote link. You can select what function you want to use to display the link
Parameters: function – The function you want to display the link with Raises: TimeoutError: If the login takes too long
-
refresh_token= None¶ A refresh token for retrieving a new access token through refresh_token
-
session_id= None¶ The id for a TIDAL session, you also need this to use load_oauth_session
-
token_refresh(refresh_token)[source]¶ Retrieves a new access token using the specified refresh token, updating the current access token :param refresh_token: The refresh token retrieved when using the OAuth login. :return: True if we believe the token was successfully refreshed, otherwise False
-
token_type= None¶ The type of access token, e.g. Bearer
-
tidalapi.models¶
-
class
tidalapi.models.Artist(**kwargs)[source]¶ -
image¶
-
picture(width, height)[source]¶ A url to an artist picture
Parameters: - width (int) – pixel width, maximum 750
- height (int) – pixel height, maximum 750
Accepted sizes: 80x80, 160x160, 320x320, 480x480, 750x750
-
role= None¶
-
roles= []¶
-
-
class
tidalapi.models.Album(**kwargs)[source]¶ -
artist= None¶
-
artists= []¶
-
duration= -1¶
-
image¶
-
num_tracks= -1¶
-
picture(width, height)[source]¶ A url to an album picture
Parameters: - width (int) – pixel width, maximum 2000
- height (int) – pixel height, maximum 2000
Accepted sizes: 80x80, 160x160, 320x320, 640x640 and 1280x1280
-
release_date= None¶
-
-
class
tidalapi.models.Media(**kwargs)[source]¶ -
album= None¶
-
artist= None¶
-
artists= []¶
-
available= True¶
-
disc_num= 1¶
-
duration= -1¶
-
popularity= -1¶
-
track_num= -1¶
-
version= None¶
-
-
class
tidalapi.models.Track(**kwargs)[source]¶ Bases:
tidalapi.models.Media
-
class
tidalapi.models.Video(**kwargs)[source]¶ Bases:
tidalapi.models.Media-
type= None¶
-
-
class
tidalapi.models.Playlist(**kwargs)[source]¶ -
created= None¶
-
creator= None¶
-
description= None¶
-
duration= -1¶
-
image¶
-
is_public= None¶
-
last_updated= None¶
-
num_tracks= -1¶
-
picture(width, height)[source]¶ A url to a playlist picture
Parameters: - width (int) – pixel width, maximum 1080
- height (int) – pixel height, maximum 1080
Accepted sizes: 160x160, 320x320, 480x480, 640x640, 750x750, 1080x1080
-
type= None¶
-