Spotify links (URIs)¶
The Link
class¶
-
class
spotify.
Link
¶ Link objects
-
LINK_INVALID
¶ Link type not valid - default until the library has parsed the link, or when parsing failed.
-
LINK_TRACK
¶
-
LINK_ALBUM
¶
-
LINK_ARTIST
¶
-
LINK_SEARCH
¶
-
LINK_PLAYLIST
¶
-
LINK_PROFILE
¶
-
LINK_STARRED
¶
-
LINK_LOCALTRACK
¶
-
LINK_IMAGE
¶
-
__str__
()¶ Return the link as a string in the Spotify format.
Example:
spotify:track:5st5644IlBmKiiRE73UsoZ
-
type
()¶ Return the type of the link as an
int
. Check value against theLINK_*
types.
-
static
from_album
(album)¶ Parameters: album ( Album
) – an albumReturns: link to the album Return type: Link
Raises: SpotifyError
-
static
from_artist
(artist)¶ Parameters: artist ( Artist
) – an artistReturns: link to the artist Return type: Link
Raises: SpotifyError
-
static
from_playlist
(playlist)¶ Parameters: playlist ( Playlist
) – a playlistReturns: link to the playlist Return type: Link
Raises: SpotifyError
-
static
from_search
(results)¶ Parameters: results ( Results
) – a result setReturns: link to the result set Return type: Link
Raises: SpotifyError
-
static
from_string
(s)¶ Parameters: s ( string
) – a Spotify URIReturns: link to the same resource as the URI string Return type: Link
Raises: SpotifyError
Create a new
Link
object from a string. Raises an exception if the string is not a valid Spotify URI.
-
static
from_track
(track[, offset])¶ Parameters: - track (
Track
) – a track - offset (
int
) – offset in milliseconds from the start of the track
Returns: link to the result set
Return type: Raises: Create a new
Link
object from aTrack
object, and optionally a time offset in milliseconds from the start of the track.- track (
-