Endless similar-track playback for cliamp, like Spotify's autoplay.
When your queue is about to run out, autoplay asks Last.fm for songs similar to what's playing, finds them on Spotify, and queues them, so the music keeps going.
Spotify removed its recommendations and related-artists APIs for apps registered after November 2024, so a cliamp setup with its own Spotify client ID can't ask Spotify what's similar. Last.fm's similarity data is free, needs only an API key, and covers music from everywhere.
What one top-up queues for a few different songs:
| Playing | Autoplay queues |
|---|---|
| Daft Punk – Get Lucky | Avicii – Wake Me Up · Breakbot – Baby I'm Yours · David Guetta – Titanium |
| Bad Bunny – Tití Me Preguntó | Daddy Yankee – Gasolina · KAROL G – LATINA FOREVA · Rauw Alejandro – Qué Pasaría... |
| Radiohead – Karma Police | Pixies – Where Is My Mind? · Foo Fighters – Everlong · The Smashing Pumpkins – 1979 |
| Burna Boy – Last Last | Fireboy DML – Peru · 1da Banton – No Wahala · Wizkid – Joro |
cliamp plugins install gaurabxkc/cliamp-plugin-autoplayAlready have it installed? Remove it first, because plugins install will not overwrite an existing plugin:
cliamp plugins remove autoplay
cliamp plugins install gaurabxkc/cliamp-plugin-autoplayThen add this to cliamp's config.toml. It lives beside the plugins folder cliamp just printed: ~/.config/cliamp/config.toml on Linux and macOS, %APPDATA%\cliamp\config.toml (for example C:\Users\you\AppData\Roaming\cliamp\config.toml) on Windows, not C:\Users\you\.config\cliamp.
[plugins]
allowed_binaries = "cliamp" # lets autoplay run `cliamp remote call`
[plugins.autoplay]
api_key = "your-last.fm-key" # free, instant: https://www.last.fm/api/account/createRestart cliamp and play a song from Spotify.
- It works on its own: when fewer than 5 songs are left, it fills the queue back up in one go (at least 3 songs at a time).
- Ctrl+T turns it on or off.
- To try it right away:
cliamp plugins call autoplay test "Artist" "Title" - To see what it is doing:
cliamp plugins call autoplay status
All optional, under [plugins.autoplay]:
| Key | Default | What it does |
|---|---|---|
keep |
5 |
Top up when fewer than this many songs are left |
add |
3 |
The minimum number of songs to queue each time |
enabled |
true |
Start with autoplay on |
binary |
cliamp |
Full path to cliamp, if it isn't on the player's $PATH |
- Spotify's own radio first, where the player offers it. If the playing track is on Spotify and the player serves
remote call provider.radio, autoplay asks for the station Spotify itself would play next and queues from that. Those tracks already carry their Spotify IDs, so nothing needs searching. cliamp does not offerprovider.radiotoday, so on cliamp this step fails quietly and autoplay moves on to Last.fm. After a failed call it waits ten minutes before asking again. - Otherwise, Last.fm
track.getSimilarfor the playing song. If that has nothing new, it falls back to similar artists' top tracks. - Candidates are mixed so one top-up doesn't come from a single artist, and anything played in the last hour is skipped.
- Last.fm candidates are looked up with
cliamp remote call provider.search, then everything is queued withtrack.queue.
Searching and queueing both happen inside cliamp with its own Spotify login. The plugin never reads your credentials.
Start with cliamp plugins call autoplay status: it reports whether autoplay is on, whether the Last.fm key is set, which binary it calls, how many songs are ahead, and any wait it is in. Then check plugins.log in your cliamp config directory.
cannot run cliamp: addcliamp(or the full path you set inbinary) toallowed_binaries.last.fm rejected the API key: the key is wrong, or the account is suspended. Autoplay goes idle rather than asking again on every track;statusshowsREJECTEDwith Last.fm's own message. Get a key at https://www.last.fm/api/account/create, replaceapi_key, and restart cliamp.config.tomledits seem to do nothing on Windows: check the path.%APPDATA%\cliamp\config.toml, not~/.config/cliamp.cliamp plugins call autoplay statusechoes the settings it actually loaded.- Nothing is queued for some songs: Last.fm has no similar tracks for them, and autoplay tries again on the next song.
- Nothing happens right after you edit a playlist: a round that just ran holds a short cooldown, and one that found nothing waits 90s. Autoplay re-checks by itself when the wait ends.
MIT
