spotify-openclaw
Full Spotify Premium control + music intelligence for OpenClaw.
Control playback, analyze your taste, and discover new music — all from chat. 100% local, no extra cloud services.
✨ What makes this different
| Feature | This skill | Basic Spotify skills |
|---|
| Playback control | ✅ play/pause/next/prev/volume/shuffle/queue | ✅ |
| Auto-launch Spotify |
✅ opens app if closed, waits, plays | ❌ |
| Taste analysis | ✅ top tracks & artists × 3 time periods | ❌ |
| Genre profile | ✅ full genre breakdown | ❌ |
| Music discovery | ✅ works without blocked Recommendations API | ❌ |
| Liked songs search | ✅ filter by artist, count, stats | ❌ |
| One-command playlists | ✅ creates + fills in one command | ❌ |
| Multi-language | ✅ English + Russian voice triggers | ❌ |
📦 Requirements
⚙️ Setup (one-time)
1. Create Spotify app at developer.spotify.com → add redirect URI: INLINECODE1
2. Store credentials in macOS Keychain:
CODEBLOCK0
3. Copy script to OpenClaw scripts folder:
CODEBLOCK1
4. First auth (browser opens once, then token is cached):
CODEBLOCK2
⚡ Quick start
CODEBLOCK3
🎮 All Commands
Playback
CODEBLOCK4
Analysis
CODEBLOCK5
Periods: short = 4 weeks · medium = 6 months · long = all time
Discovery & Playlists
CODEBLOCK6
Note: Spotify's recommendations and audio_features APIs are blocked for new developer apps. This skill uses related_artists + artist_top_tracks for discovery instead — no workarounds needed.
💡 Agent tips
- - Chain
related-artists → artist-top-tracks → add-to-playlist for smart discovery playlists - Use
liked-by-artist to build themed playlists from your library - INLINECODE13 gives the most accurate taste profile
- Use
playlists to get playlist IDs before playing one
ALWAYS run python3 ~/.openclaw/scripts/spotify.py [cmd] — never respond with text only.
spotify-openclaw
面向OpenClaw的全功能Spotify Premium控制与音乐智能。
通过聊天控制播放、分析你的音乐品味、发现新音乐。完全本地运行,无需额外云服务。
✨ 独特之处
| 功能 | 本技能 | 基础Spotify技能 |
|---|
| 播放控制 | ✅ 播放/暂停/下一首/上一首/音量/随机播放/队列 | ✅ |
| 自动启动Spotify |
✅ 若应用关闭则打开,等待后播放 | ❌ |
| 品味分析 | ✅ 按3个时间段查看热门曲目与艺人 | ❌ |
| 流派画像 | ✅ 完整的流派分类 | ❌ |
| 音乐发现 | ✅ 无需被屏蔽的推荐API即可工作 | ❌ |
| 喜欢歌曲搜索 | ✅ 按艺人筛选、统计数量、查看统计信息 | ❌ |
| 一键歌单 | ✅ 一条命令创建并填充歌单 | ❌ |
| 多语言 | ✅ 英语+俄语语音触发 | ❌ |
📦 系统要求
⚙️ 设置(一次性)
1. 创建Spotify应用 在developer.spotify.com → 添加重定向URI:http://127.0.0.1:8888/callback
2. 将凭据存入macOS钥匙串:
bash
security add-generic-password -a openclaw -s openclaw.spotify.client_id -w 你的客户端ID
security add-generic-password -a openclaw -s openclaw.spotify.client_secret -w 你的客户端密钥
3. 将脚本复制到OpenClaw脚本文件夹:
bash
cp spotify.py ~/.openclaw/scripts/spotify.py
4. 首次认证(浏览器会打开一次,之后令牌会被缓存):
bash
python3 ~/.openclaw/scripts/spotify.py now
⚡ 快速开始
bash
播放内容
python3 ~/.openclaw/scripts/spotify.py play Massive Attack
当前播放内容
python3 ~/.openclaw/scripts/spotify.py now
根据你的品味发现新音乐
python3 ~/.openclaw/scripts/spotify.py discover
创建本月歌单(一条命令创建并填充)
python3 ~/.openclaw/scripts/spotify.py make-playlist 2026年3月热门 short 20
🎮 所有命令
播放控制
bash
python3 ~/.openclaw/scripts/spotify.py play # 恢复播放
python3 ~/.openclaw/scripts/spotify.py play 歌曲名 # 搜索并播放
python3 ~/.openclaw/scripts/spotify.py play spotify:track:URI # 通过URI播放
python3 ~/.openclaw/scripts/spotify.py pause
python3 ~/.openclaw/scripts/spotify.py next
python3 ~/.openclaw/scripts/spotify.py prev
python3 ~/.openclaw/scripts/spotify.py volume 70
python3 ~/.openclaw/scripts/spotify.py volume up / down
python3 ~/.openclaw/scripts/spotify.py shuffle on / off
python3 ~/.openclaw/scripts/spotify.py queue 歌曲名
python3 ~/.openclaw/scripts/spotify.py now
python3 ~/.openclaw/scripts/spotify.py devices
分析
bash
python3 ~/.openclaw/scripts/spotify.py top-tracks [short|medium|long] [数量]
python3 ~/.openclaw/scripts/spotify.py top-artists [short|medium|long] [数量]
python3 ~/.openclaw/scripts/spotify.py genres [short|medium|long]
python3 ~/.openclaw/scripts/spotify.py recent [数量]
python3 ~/.openclaw/scripts/spotify.py liked [数量]
python3 ~/.openclaw/scripts/spotify.py liked-all
python3 ~/.openclaw/scripts/spotify.py liked-by-artist 艺人名
python3 ~/.openclaw/scripts/spotify.py playlists
python3 ~/.openclaw/scripts/spotify.py search 查询 [track|artist|album] [数量]
python3 ~/.openclaw/scripts/spotify.py track-info URI
时间段:short = 4周 · medium = 6个月 · long = 全部时间
发现与歌单
bash
按流派画像发现
python3 ~/.openclaw/scripts/spotify.py discover
从艺人扩展(depth=跳数,n=每位艺人的歌曲数)
python3 ~/.openclaw/scripts/spotify.py discover Portishead 3 3
相关艺人
python3 ~/.openclaw/scripts/spotify.py related-artists The Cure 10
任意艺人的热门曲目
python3 ~/.openclaw/scripts/spotify.py artist-top-tracks Massive Attack 5
从热门曲目创建歌单 — 一条命令,创建并填充
python3 ~/.openclaw/scripts/spotify.py make-playlist 2026年3月热门 short 20
管理歌单
python3 ~/.openclaw/scripts/spotify.py create-playlist 我的歌单 描述
python3 ~/.openclaw/scripts/spotify.py add-to-playlist 歌单ID URI1 URI2
注意: Spotify的recommendations和audiofeaturesAPI对新开发者应用已被屏蔽。本技能改用relatedartists + artisttoptracks进行发现——无需任何变通方案。
💡 代理提示
- - 串联related-artists → artist-top-tracks → add-to-playlist以创建智能发现歌单
- 使用liked-by-artist从你的音乐库构建主题歌单
- genres long提供最准确的品味画像
- 播放前使用playlists获取歌单ID
始终运行 python3 ~/.openclaw/scripts/spotify.py [命令] — 切勿仅以文本回复。