song
Song module that hold the Song and SongList classes.
Song
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
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
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
216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
|
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
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
|
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
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
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
63 64 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 |
|
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
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
|
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
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
|
SongError
¤
Bases: Exception
Base class for all exceptions related to songs.
SongList
dataclass
¤
SongList class. Base class for all other song lists subclasses.
json: Dict[str, Any]
property
¤
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
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
|
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
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
|
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
364 365 366 367 368 369 370 371 372 373 374 375 376 |
|
SongListError
¤
Bases: Exception
Base class for all exceptions related to song lists.