Install
openclaw skills install @stanestane/lastfm-spotify-playlistsBuild music recommendations and create Spotify playlists using Last.fm similarity and listening history.
openclaw skills install @stanestane/lastfm-spotify-playlistsThis skill runs directly via local Python scripts.
Valid entrypoints:
python run_pipeline.py ...python auth.pyscripts/ directorypython -m module executionAll commands must be executed from the root of this skill folder.
If the user asks for:
You MUST execute:
--output-mode spotify --create-playlist
Primary entrypoints:
- `python run_pipeline.py ...`
- `python auth.py ...`
This skill is intentionally organized as plain scripts plus helper modules:
- `run_pipeline.py`
- `auth.py`
- `lastfm.py`
- `spotify.py`
- `pipeline.py`
- `common.py`
No package installation is required.
# Purpose
This skill:
- uses Last.fm as the discovery engine
- expands seeds through `track.getsimilar`
- ranks merged candidates
- optionally matches results on Spotify
- optionally creates Spotify playlists
# Requirements
## Python
A normal local Python interpreter must be available.
## Last.fm credentials
Supported sources:
- environment variables:
- `LASTFM_API_KEY`
- `LASTFM_SHARED_SECRET`
- `LASTFM_USERNAME`
- credentials file:
- `~/.openclaw/lastfm-credentials.json`
- explicit file path via command flag:
- `--creds <path>`
Example file:
```json
{
"api_key": "YOUR_LASTFM_API_KEY",
"shared_secret": "YOUR_LASTFM_SHARED_SECRET",
"username": "YOUR_LASTFM_USERNAME"
}
Needed only for Spotify matching or playlist creation.
Supported sources:
SPOTIFY_CLIENT_IDSPOTIFY_CLIENT_SECRETSPOTIFY_REDIRECT_URI~/.openclaw/spotify-credentials.json--spotify-creds <path>Saved token location:
~/.openclaw/spotify-token.json--spotify-token <path>Use when the request is based on a user's recent scrobbles.
python run_pipeline.py recent-tracks --user "<LASTFM_USER>" --recent-count 10 --similar-per-seed 5 --final-limit 20 --output-mode lastfm-only
Use when the request is based on one artist.
python run_pipeline.py artist-rule-c "<ARTIST_NAME>" --seed-count 5 --similar-per-seed 10 --final-limit 20 --output-mode lastfm-only
Use when the request is based on a user's broader taste profile.
python run_pipeline.py top-artists-blend --user "<LASTFM_USER>" --period 1month --artist-count 5 --seed-count-per-artist 3 --similar-per-seed 5 --final-limit 20 --output-mode lastfm-only
Use when the user wants playable Spotify results but not necessarily a playlist.
python run_pipeline.py recent-tracks --user "<LASTFM_USER>" --recent-count 10 --final-limit 20 --output-mode spotify
Use when the user explicitly wants a playlist created.
python run_pipeline.py recent-tracks --user "<LASTFM_USER>" --recent-count 10 --final-limit 20 --output-mode spotify --create-playlist --playlist-name "Last.fm Recommendations"
Use when Spotify token setup is required.
python auth.py
Optional explicit paths:
python auth.py --spotify-creds "<PATH_TO_SPOTIFY_CREDS_JSON>" --spotify-token "<PATH_TO_SPOTIFY_TOKEN_JSON>"
--output-mode lastfm-only--output-mode spotify--create-playlistThe scripts print JSON to stdout.
Return the JSON result directly or summarize it faithfully.
Typical fields include:
modeuserseed_artistseed_trackssuggestionsmatched_tracksunmatched_tracksplaylistIf the script exits with an error:
Common expected failures:
This skill is intentionally script-based for reliability.
It should work as long as:
It must not depend on package installation, editable installs, or import path manipulation.