Tracks and Playlists#

Tracks and playlists are returned from Player.fetch_tracks() and Node.decode_track().

class mafic.Track(*, track_id, identifier, seekable, author, length, stream, position=0, title, uri, artwork_url, isrc, source)#

Bases: object

Represents a track.

Parameters:
  • track_id (str) – The ID of the track.

  • title (str) – The title of the track.

  • identifier (str) – The identifier of the track.

  • uri (Optional[str]) – The URI of the track.

  • source (str) – The source of the track.

  • stream (bool) – Whether the track is a stream.

  • seekable (bool) – Whether the track is seekable.

  • position (int) – The current position of the track.

  • length (int) – The length of the track.

id#

The ID of the track. This is base64 encoded data used by Lavalink.

Type:

str

title#

The title of the track.

Type:

str

author#

The author of the track.

Type:

str

identifier#

The identifier of the track. This is the ID of the track on the source.

Type:

str

uri#

The URI of the track.

Type:

Optional[str]

source#

The source of the track.

Type:

str

stream#

Whether the track is a stream.

Type:

bool

seekable#

Whether the track is seekable.

Type:

bool

position#

The current position of the track.

Type:

int

length#

The length of the track.

Type:

int

artwork_url#

The artwork URL of the track. This is always None if the node does not use Lavalink v4.

New in version 2.2.

Type:

Optional[str]

isrc#

The ISRC of the track. This is always None if the node does not use Lavalink v4.

New in version 2.2.

Type:

Optional[str]

class mafic.Playlist(*, info, tracks, plugin_info)#

Bases: object

Represents a playlist.

name#

The name of the playlist.

Type:

str

selected_track#

The index of the selected track, if any.

Type:

int

tracks#

A list of tracks in the playlist.

Type:

list[Track]

plugin_info#

A dictionary containing plugin-specific information.

New in version 2.3.

Type:

dict[str, Any]