Documentation for Playlist
¤
PlaylistBase
defines the interface of the Playlist class, which is subclassing it.
tracks: Iterator[Track]
property
readonly
¤
Return the playlist tracks.
Yields
Iterator["Track"]: the playlist tracks
url: ~AnyStr
property
readonly
¤
Return the playlist's Spotify URL.
Returns:
Type | Description |
---|---|
~AnyStr | AnyStr: the URL in string format |
from_url(cls, url)
classmethod
¤
Return a Playlist
given its corresponding Spotify URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url | ~AnyStr | the Spotify URL of the playlist | required |
Returns:
Type | Description |
---|---|
Playlist | Playlist: the corresponding playlist |
Playlist
implements the playlist downloading logic.
download(self, path, skip_existing=False, progress_logger=None)
¤
Download the playlist's tracks in .mp3
format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path | Path | where should the tracks be stored | required |
skip_existing | Optional[bool] | whether or not to overwrite an existing track. Defaults to False. | False |
progress_logger | Optional[logging.Logger] | a logger reporting on the download progress. Defaults to None. | None |
Returns:
Type | Description |
---|---|
Path | Path: the download folder of the playlist |