spotifywebapipython.spotifywebplayertoken
SPOTIFY_WEBUI_URL_GET_ACCESS_TOKEN =
'https://open.spotify.com/get_access_token'
Url used to get access token.
class
SpotifyWebPlayerToken:
Represents a Spotify web player token for an account.
SpotifyWebPlayerToken( clientId: str = None, profileId: str = None, tokenProviderId: str = None, tokenStorageDir: str = None, tokenStorageFile: str = None, spotifyWebPlayerCookieSpdc: str = None, spotifyWebPlayerCookieSpkey: str = None)
Initializes a new instance of the class.
Arguments:
- clientId (str): The unique identifier of the application.
A null value will default to
Shared
.
Default:Shared
- profileId (str): Profile identifier used when loading / storing the token to disk.
A null value will default toShared
.
Default:Shared
- tokenProviderId (str): Provider identifier used when storing the token to disk.
A null value will default to
Shared
.
Default:Shared
- tokenStorageDir (str): The directory path that will contain the Token Cache file.
A null value will default to the platform specific storage location:
Example for Windows OS =C:\ProgramData\SpotifyWebApiPython
- tokenStorageFile (str): The filename and extension of the Token Cache file.
Default istokens.json
. - spotifyWebPlayerCookieSpdc (str): Spotify Web Player Cookie credentials
sp_dc
value. - spotifyWebPlayerCookieSpkey (str): Spotify Web Player Cookie credentials
sp_key
value.
If the spotifyWebPlayerCookieSpdc
and spotifyWebPlayerCookieSpkey
values are specified,
then the Token Cache File parameters will be ignored and a token created from the specified
values.
Otherwise, the Token Cache File is queried to retrieve the sp_dc
and sp_key
values.
ExpireDateTimeUtc: datetime.datetime
DateTime (in UTC format) that the authorization token will expire.
HeaderKey: str
Returns a string containing the header key to assign the authorization token value to. This will always return 'Authorization'.