4224f7f3eae3165f93b641c01477f5bef1d8fd64
librespot-auth
A simple program for populating a credentials.json via Spotify's zeroconf authentication.
Optional Arguments
--name: Name of the virtual speaker (default: "Speaker").--path: Target path for credentials (default:credentials.jsonrelative to execution).
How It Works
While running on the same network as a Spotify client, it should appear as a Spotify Connect device with the given name. Select it once as an output device, and the Spotify client will transmit the required authentication blob. This blob is received by this application, written to the specified credentials path, and the application immediately exits.
This process is useful in cases where you run librespot on remote hosts on a different network (thus complicating zeroconf). As of version 3.203.235 of the Spotify eSDK, the SpConnectionLoginPassword API has been removed.
How To Use It With SpotifyD
- Clone the repo
- Make sure to stop the spotifyd service
sudo systemctl stop spotifyd.service - Run
cargo build --release(requires rust compiler/toolkit, see https://rustup.rs/) - Run
./target/release/librespot-auth --name "Example Speaker" - In Spotify app select the
Example Speakeras output device - Copy the
credentials.jsonto yours spotifydcache_directory, eg.~/spotifyd/target/release/cache_directory/ - Restart spotifyd service
sudo systemctl restart spotifyd.service
# Example
./target/release/librespot-auth --name "Example Speaker"
Open Spotify and select output device: Example Speaker
Credentials saved: credentials.json
Description
Languages
Rust
100%