A Spotify track.
You can get tracks from playlists or albums, or you can create a Track yourself from a Spotify URI:
>>> session = spotify.Session()
# ...
>>> track = session.get_track('spotify:track:2Foc5Q5nqNiosCNqttzHof')
>>> track.load().name
u'Get Lucky'
Whether the track’s data is loaded.
An ErrorType associated with the track.
Check to see if there was problems loading the track.
Block until the track’s data is loaded.
After timeout seconds with no results Timeout is raised. If timeout is None the default timeout is used.
The method returns self to allow for chaining of calls.
The TrackOfflineStatus of the track.
The metadata_updated callback is called when the offline status changes.
Will always return None if the track isn’t loaded.
The TrackAvailability of the track.
Will always return None if the track isn’t loaded.
Whether the track is a local track.
Will always return None if the track isn’t loaded.
Whether the track is a autolinked to another track.
Will always return None if the track isn’t loaded.
See playable.
The actual track that will be played when this track is played.
Will always return None if the track isn’t loaded.
See is_autolinked.
Whether the track is a placeholder for a non-track object in the playlist.
To convert to the real object:
>>> session = spotify.Session()
# ...
>>> track = session.get_track(
... 'spotify:track:2Foc5Q5nqNiosCNqttzHof')
>>> track.load()
>>> track.is_placeholder
True
>>> track.link.type
<LinkType.ARTIST: ...>
>>> artist = track.link.as_artist()
Will always return None if the track isn’t loaded.
Whether the track is starred by the current user.
Set to True or False to change.
Will always be None if the track isn’t loaded.
The artists performing on the track.
Will always return None if the track isn’t loaded.
The album of the track.
Will always return None if the track isn’t loaded.
The track’s name.
Will always return None if the track isn’t loaded.
The track’s duration in milliseconds.
Will always return None if the track isn’t loaded.
The track’s popularity in the range 0-100, 0 if undefined.
Will always return None if the track isn’t loaded.
The track’s disc number. 1 or higher.
Will always return None if the track isn’t part of an album or artist browser.
The track’s index number. 1 or higher.
Will always return None if the track isn’t part of an album or artist browser.