A CLI tool that plays Spotify playlists through YouTube. No Spotify account required.
spotcli scrapes public playlist metadata from Spotify, finds matching tracks on YouTube via yt-dlp, and plays audio through mpv. It runs as a daemon controlled by simple CLI commands.
cargo install --path .
spotcli needs yt-dlp and mpv on your system. Install them automatically:
spotcli setup
Or manually:
| Platform | yt-dlp | mpv |
|---|---|---|
| Arch | downloaded from GitHub | sudo pacman -S mpv |
| Ubuntu/Debian | downloaded from GitHub | sudo apt install mpv |
| Fedora | downloaded from GitHub | sudo dnf install mpv |
| macOS | downloaded from GitHub | brew install mpv |
| Windows | downloaded from GitHub | winget install mpv |
spotcli setup downloads the yt-dlp standalone binary from GitHub releases — no Python needed.
spotcli play https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M
Spotify URIs also work:
spotcli play spotify:playlist:37i9dQZF1DXcBWIGoYBM5M
spotcli play <url> --shuffle # randomize track order
spotcli play <url> --start-track random # start at a random track
spotcli play <url> --start-track 5 # start at track 5
spotcli play <url> --start-time # start each track at a random position
spotcli play <url> --shuffle --start-time # combine flags
While a playlist is playing, use these from another terminal:
spotcli pause # toggle pause/resume
spotcli next # skip to next track
spotcli prev # go to previous track
spotcli stop # stop playback and exit
spotcli status
Track: Bohemian Rhapsody - Queen
Album: A Night at the Opera
Position: 2:34 / 5:55
State: playing
Queue: 3 of 15 (shuffled)
spotcli queue
Queue: 15 tracks (shuffled)
1. Another One Bites the Dust - Queen
2. Don't Stop Me Now - Queen
> 3. Bohemian Rhapsody - Queen
4. Somebody to Love - Queen
...
Both support --json for machine-readable output:
spotcli status --json
spotcli queue --json
- Scrape — Fetches the public Spotify playlist page and extracts track metadata from embedded JSON (no API keys needed)
- Resolve — Searches YouTube for each track using yt-dlp. Resolves lazily — the next track is prefetched while the current one plays
- Play — Streams audio through mpv (no video). Communicates with mpv over its JSON IPC socket
- Control — The player listens on a Unix socket (or Windows named pipe). Control commands connect, send a JSON request, and print the response
Requires Rust 1.85+ (edition 2024).
git clone <repo>
cd spotcli
cargo build --release
Run tests:
cargo test
MIT