Add support for downloading playlist metadata

Add option PLAYLIST_CAPTURE. When enabled, downloaded playlists will be stored
as JSON files.

This lets users parse those JSON files and write small tools that can recreate
Spotify playlists locally. This commit only adds the download capability, and
making playlists (as m3u files et.c.) is left as an exercise for the reader or
maybe a latter commit.
This commit is contained in:
Lonely Lyle 2024-05-11 13:28:03 +02:00
parent 5da27d32a1
commit 4c242583b8
4 changed files with 97 additions and 5 deletions

View file

@ -15,6 +15,7 @@
- Supports multiple audio formats
- Download directly from URL or use built-in in search
- Bulk downloads from a list of URLs in a text file or parsed directly as arguments
- Download playlist structure as JSON files so local playlists can be recreated
*Free accounts are limited to 160kbps. \
**Audio files are NOT substituted with ones from other sources such as YouTube or Deezer, they are sourced directly. \
@ -60,9 +61,13 @@ Be aware you have to set boolean values in the commandline like this: `--downloa
|------------------------------|----------------------------------|----------|---------------------------------------------------------------------|
| CREDENTIALS_LOCATION | --credentials-location | | The location of the credentials.json
| OUTPUT | --output | | The output location/format (see below)
| PLAYLIST_OUTPUT | --playist-output | | The playlist metadata output location/format (see below)
| SONG_ARCHIVE | --song-archive | | The song_archive file for SKIP_PREVIOUSLY_DOWNLOADED
| ROOT_PATH | --root-path | | Directory where Zotify saves music
| ROOT_PODCAST_PATH | --root-podcast-path | | Directory where Zotify saves podcasts
| ROOT_PLAYLIST_PATH | --root-playlist-path | | Directory where Zotify saves playlist metadata
| PLAYLIST_CAPTURE | --playlist-capture | False | Saves each playlist metadata as JSON files
| CAPTURE_ONLY | --capture-only | False | Skips downloading songs when capturing playlist metadata
| SPLIT_ALBUM_DISCS | --split-album-discs | False | Saves each disk in its own folder
| DOWNLOAD_LYRICS | --download-lyrics | True | Downloads synced lyrics in .lrc format, uses unsynced as fallback.
| MD_ALLGENRES | --md-allgenres | False | Save all relevant genres in metadata
@ -127,6 +132,16 @@ Example values could be:
{artist}/{album}/{album_num} - {artist} - {song_name}.{ext}
~~~~
For playlist metadata, it's the same as above, but with the `PLAYLIST_OUTPUT` parameter (`--playlist-output`).
The value is relative to `ROOT_PLAYLIST_PATH` and can contain the following placeholders.
| Placeholder | Description
|-----------------|--------------------------------
| {id} | The playlist id
| {name} | The playlist name
| {owner} | The display name of the owner account
| {owner_id} | The user id of the owner account
### Docker Usage
```
Build the docker image from the Dockerfile: