config
Module related to managing reading and writing to the config file.
Default config - spotdl.utils.config.DEFAULT_CONFIG
ConfigError
¤
Bases: Exception
Base class for all exceptions related to config.
GlobalConfig
¤
Class to store global configuration
get_parameter(key)
classmethod
¤
Get a parameter from the download config
Source code in spotdl/utils/config.py
286 287 288 289 290 291 292 |
|
set_parameter(key, value)
classmethod
¤
Set a parameter for the download config
Source code in spotdl/utils/config.py
278 279 280 281 282 283 284 |
|
create_settings(arguments)
¤
Create settings dicts for Spotify, Downloader and Web based on the arguments and config file (if enabled)
Arguments¤
- arguments: Namespace from argparse
Returns¤
- spotify_options: SpotifyOptions
- downloader_options: DownloaderOptions
- web_options: WebOptions
Source code in spotdl/utils/config.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
create_settings_type(arguments, config, default)
¤
Create settings dict Argument value has always the priority, then the config file value, and if neither are set, use default value
Arguments¤
- arguments: Namespace from argparse
- default: dict
Returns¤
- settings: dict
Source code in spotdl/utils/config.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
get_cache_path()
¤
Get the path to the cache folder.
Returns¤
- The path to the spotipy cache file.
Source code in spotdl/utils/config.py
86 87 88 89 90 91 92 93 94 |
|
get_config()
¤
Get the config.
Returns¤
- The dictionary with the config.
Errors¤
- ConfigError: If the config file does not exist.
Source code in spotdl/utils/config.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
|
get_config_file()
¤
Get config file path
Returns¤
- The path to the config file.
Source code in spotdl/utils/config.py
75 76 77 78 79 80 81 82 83 |
|
get_errors_path()
¤
Get the path to the errors folder.
Returns¤
- The path to the errors folder.
Notes¤
- If the errors directory does not exist, it will be created.
Source code in spotdl/utils/config.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
get_spotdl_path()
¤
Get the path to the spotdl folder.
Returns¤
- The path to the spotdl folder.
Notes¤
- If the spotdl directory does not exist, it will be created.
Source code in spotdl/utils/config.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
get_spotify_cache_path()
¤
Get the path to the spotify cache folder.
Returns¤
- The path to the spotipy cache file.
Source code in spotdl/utils/config.py
97 98 99 100 101 102 103 104 105 |
|
get_temp_path()
¤
Get the path to the temp folder.
Returns¤
- The path to the temp folder.
Source code in spotdl/utils/config.py
108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
get_web_ui_path()
¤
Get the path to the web-ui folder.
Returns¤
- The path to the web-ui folder.
Notes¤
- If the web-ui directory does not exist, it will be created.
Source code in spotdl/utils/config.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|
modernize_settings(options)
¤
Handle deprecated values in config file.
Arguments¤
- options: DownloaderOptions to modernize
Source code in spotdl/utils/config.py
256 257 258 259 260 261 262 263 264 265 266 267 268 |
|