librespot-java
is a port of librespot, originally written in Rust, which as evolved into the most up-to-date open-source Spotify client. Additionally, this implementation provides an useful API to request metadata or control the player, more here.
This client is pretty much capable of playing anything that's available on Spotify. Its main features are:
- Tracks and podcasts/episodes playback
- Stations and dailymixes support
- Local content caching
- Zeroconf (Spotify Connect)
- Gapless playback
All the configuration you need is inside the config.toml
file, there you can decide to authenticate with:
- Username and password
- Zeroconf
- Auth blob
This is pretty straightforward, but remember that having hardcoded passwords isn't the best thing on earth.
In this mode librespot
becomes discoverable with Spotify Connect by devices on the same network. Just open a Spotify client and select librespot-java
from the available devices list.
Authenticate with Facebook. The console will provide a link to visit in order to continue the login process.
This is more advanced and should only be used if you saved an authentication blob. The blob should have already been Base64-decoded.
You can download the latest release from here and then run java -jar ./librespot-core-jar-with-dependencies.jar
from the command line.
This project uses Maven, after installing it you can compile with mvn clean package
in the project root, if the compilation succeeds you'll be pleased with a JAR executable in core/target
.
To run the newly build jar run java -jar ./core/target/librespot-core-jar-with-dependencies.jar
.