A small program making it easier to filter out music on Spotify.
Create an application in the Spotify API dashboard. Add a redirect URI pointing to
http://localhost:4321/login. The port
4321is configured in the
.spotify-next.jsonconfig file (see usage).
If you have coursier, this will install the app in your current working directory:
coursier bootstrap com.kubukoz:spotify-next_2.13:1.1.0 -o spotify-next # now you can run the app like this: ./spotify-next --help
Build from source
Alternatively, if you want a fresh-out-of-the-oven version, you can build it from source:
This will create a launcher at
The application requires some configuration (e.g. the client ID for the Spotify Web API). It's stored in a file at
~/.spotify-next.json. When you first run the application, or if that file is deleted, the application will ask and attempt to create one.
The configuration defines the port for the embedded HTTP server used for authentication. The server server will only start when the login flow is triggered, and stop afterwards.
$ ./spotify-next --help Usage: spotify-next login spotify-next skip spotify-next drop spotify-next forward spotify-next s spotify-next d spotify-next f spotify-next repl spotify-next: Gather great music. Options and flags: --help Display this help text. Subcommands: login Log into Spotify skip Skip to next track without any changes drop Drop current track from the current playlist and skip to the next track forward Fast forward the current track by a percentage of its length (10% by default) s Alias for `skip` d Alias for `drop` f Alias for `forward` repl Run application in interactive mode
You can run the login command to be prompted for authorization, or you can rely on the fallback mechanism of all API calls - when one fails with 401 Unauthorized, you'll see the response and be prompted to log in. The call will be retried once after you successfully log in.
The application automatically saves the token to the configuration file after successful logins.
Currently, it's impossible to control the playback on some devices (e.g. Sonos speakers) through the Spotify Web API. Because of that, requests to switch tracks (in
drop) will fail if such a device is currently playing.