song
Song module that hold the Song and SongList classes.
Song(name, artists, artist, genres, disc_number, disc_count, album_name, album_artist, duration, year, date, track_number, tracks_count, song_id, explicit, publisher, url, isrc, cover_url, copyright_text, download_url=None, lyrics=None, popularity=None, album_id=None, list_name=None, list_url=None, list_position=None, list_length=None, artist_id=None, album_type=None)
dataclass
¤
Song class. Contains all the information about a song.
from_data_dump(data)
classmethod
¤
Create a Song object from a data dump.
Arguments¤
- data: The data dump.
Returns¤
- The Song object.
Source code in spotdl/types/song.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | |
from_dict(data)
classmethod
¤
Create a Song object from a dictionary.
Arguments¤
- data: The dictionary.
Returns¤
- The Song object.
Source code in spotdl/types/song.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 | |
from_missing_data(**kwargs)
classmethod
¤
Create a Song object from a dictionary with missing data. For example, data dict doesn't contain all the required attributes for the Song class.
Arguments¤
- data: The dictionary.
Returns¤
- The Song object.
Source code in spotdl/types/song.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
from_search_term(search_term)
classmethod
¤
Creates a list of Song objects from a search term.
Arguments¤
- search_term: The search term to use.
Returns¤
- The Song object.
Source code in spotdl/types/song.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
from_url(url)
classmethod
¤
Creates a Song object from a URL.
Arguments¤
- url: The URL of the song.
Returns¤
- The Song object.
Source code in spotdl/types/song.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
list_from_search_term(search_term)
classmethod
¤
Creates a list of Song objects from a search term.
Arguments¤
- search_term: The search term to use.
Returns¤
- The list of Song objects.
Source code in spotdl/types/song.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
search(search_term)
staticmethod
¤
Searches for Songs from a search term.
Arguments¤
- search_term: The search term to use.
Returns¤
- The raw search results
Source code in spotdl/types/song.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |
SongError
¤
Bases: Exception
Base class for all exceptions related to songs.
SongList(name, url, urls, songs)
dataclass
¤
SongList class. Base class for all other song lists subclasses.
from_search_term(search_term, fetch_songs=True)
classmethod
¤
Creates a SongList object from a search term.
Arguments¤
- search_term: The search term to use.
Returns¤
- The SongList object.
Source code in spotdl/types/song.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | |
from_url(url, fetch_songs=True)
classmethod
¤
Create a SongList object from a url.
Arguments¤
- url: The url of the list.
- fetch_songs: Whether to fetch missing metadata for songs.
Returns¤
- The SongList object.
Source code in spotdl/types/song.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |
get_metadata(url)
staticmethod
¤
Get metadata for a song list.
Arguments¤
- url: The url of the song list.
Returns¤
- The metadata.
Source code in spotdl/types/song.py
381 382 383 384 385 386 387 388 389 390 391 392 393 | |
SongListError
¤
Bases: Exception
Base class for all exceptions related to song lists.