deezer-datasync
synchronizes data from Deezer:
- Favorite albums
- Favorite artists
- List of playlists
- Individual playlists with their associated tracks
As of the current version, only GitHub is supported as a backend; the application will commit JSON files in this arborescence:
your-git-repo/
├── playlists/
│ ├── {id}_{title}.json
│ ├── {id}_{title}.json
│ ├── [...]
├── albums.json
├── artists.json
└── playlists.json
See the changelog.
This project is mainly developed for my personal use and as such, is experimental. However I'll be glad to help if you encounter any issue.
You'll need a Deezer token to use this application. You can follow Deezer's instructions here. I have also written a documentation here.
It seems that Deezer has disabled the creation of 'apps':
We're not accepting new application creation at this time. Please check again later.
This means you can't create the token that this project needs to run. If you have a valid API token somewhere, it should work. At least my instance still runs for now. Not for long?
There's nothing I can do about that except encourage you to give your money to another service. Hopefully with a logo that won't make you want to tear your eyes out of their sockets with a rusty spoon.
Prepare a configuration file in HOCON format:
config {
application {
zone = "your-zone" // e.g Europe/Paris"
}
deezer {
profile {
userId = your-user-id
// Playlists to backup -- leave empty to backup *all* your playlists
playlistIds = [id1, id2]
}
url = "https://api.deezer.com"
token = your-deezer-token
// Maximum number of results per request. 100 is a hard minimum to limit the number of requests.
maxResults = 200
// Number of calls per second to the API. 10 is a hard maximum to avoid Deezer's limit (50/5 seconds).
rateLimit = 5
}
github {
token = your-github-token
repo = your-repo // in the format owner/repo
branch = your-branch
}
}
A multiplatform image (AMD64 and ARMv7 -- for execution on a Raspberry Pi 3) is available on Dockerhub:
# Pull the latest version of the image
docker pull alecigne/deezer-datasync:latest
# Run the container with the latest image (check that your config file is compatible!)
docker run -it -v /absolute/path/to/application.conf:/application.conf alecigne/deezer-datasync
Download a Jar in the releases section, then run it using Java 17:
java -jar -Dconfig.file=/path/to/application.conf deezer-datasync.jar
You probably know what you're doing anyway 🙂
Playlist filenames ({id}_{title}.json
) are generated from "clean" playlist titles:
- The title is converted to lowercase.
- Any group of non-alphanumeric characters (size 1 or more) is converted to an underscore.
- Any trailing underscore is removed from the title.
You can see basic cases in issue #28. This issue was the basis for the parameterized test in
GitHubMapperTest.java
. There is also a property-based test in
GitHubMapperPropertyTest.java
.