Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计通过

spotify-controllerSpotify 控制器

Agent Skill

spotify-controller 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

13,623

周安装

562

GitHub Stars

公开资料未说明

下载量

4,451
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:spotify-controller(Spotify 控制器)
来源仓库:https://github.com/egemenyerdelen/spotify-controller
安装命令:
openclaw skills install spotify-controller
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install spotify-controller

简介

利用官方 Spotify Web API 实现 AI 代理对播放和设备的远程控制。

  • 适用于检查当前曲目状态、执行播放/暂停操作等基础控制需求。
  • 用户可通过简单命令触发,如“现在播放什么?”或“暂停音乐”。
  • 必须拥有有效的 Spotify 开发者凭证并完成 OAuth 授权流程。
  • spotify-controller 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
spotify-controller
description
Control Spotify playback and devices from an AI agent using spotify.py and the official Spotify Web API. Use when users ask to check current track, play/pause, next/prev, set volume, search tracks, play first search result, list devices, switch active device, or play a specific Spotify URL. Works on headless VPS and Docker setups.
homepage
https://developer.spotify.com
metadata
{"clawdbot":{"emoji":"🎵","requires":{"env":["SPOTIFY_CLIENT_ID","SPOTIFY_CLIENT_SECRET","SPOTIFY_REFRESH_TOKEN"],"bins":["python3"]},"primaryEnv":"SPOTIFY_CLIENT_ID"}}

Spotify Controller Skill

Control Spotify playback from your AI agent using the official Spotify Web API.

This works across setups (local machine, Docker, VPS, and hybrid environments). It is especially useful for fixing Spotify control pain in headless VPS deployments. The server does not need a browser or a local Spotify client.


What this skill provides

  • A CLI workflow around spotify.py
  • Playback control (play, pause, next, prev)
  • Track lookup (search) and quick play (playsearch)
  • Direct URI playback (playtrack spotify:track:...)
  • Device management (devices, setdevice)
  • Volume control (volume 0-100, where supported)

Requirements

  • Python 3 available in runtime/container
  • requests package installed
  • Spotify Premium account
  • Spotify Developer app credentials
  • Environment variables:

- SPOTIFY_CLIENT_ID - SPOTIFY_CLIENT_SECRET - SPOTIFY_REFRESH_TOKEN

Install dependency:

uv pip install requests --system

(Alternative: pip install requests)

If you build OpenClaw in Docker, add this to your Dockerfile when requests is not already present:

RUN uv pip install requests --system

Setup (Step-by-step)

1) Create a Spotify Developer App

  1. Go to: https://developer.spotify.com/dashboard
  2. Click Create App
  3. Enter any app name/description
  4. Add Redirect URI:

- http://127.0.0.1:8888/callback

  1. Enable Web API access
  2. Save and copy:

- Client ID - Client Secret

2) Get a refresh token (one-time, on local machine)

Open this URL in your browser (replace YOUR_CLIENT_ID):

https://accounts.spotify.com/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=http://127.0.0.1:8888/callback&scope=user-modify-playback-state%20user-read-playback-state%20user-read-currently-playing

Approve access, then copy the code value from the redirected URL.

Exchange code for tokens:

curl -s -X POST "https://accounts.spotify.com/api/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=authorization_code&code=YOUR_CODE&redirect_uri=http://127.0.0.1:8888/callback&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET"

From response JSON, copy refresh_token.

refresh_token is typically long-lived, but can be invalidated if app access is revoked, app settings change, or credentials rotate.

3) Add credentials to .env

SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
SPOTIFY_REFRESH_TOKEN=your_refresh_token

4) Pass env vars to Docker compose service

In docker-compose.yml service environment: section:

- SPOTIFY_CLIENT_ID=${SPOTIFY_CLIENT_ID}
- SPOTIFY_CLIENT_SECRET=${SPOTIFY_CLIENT_SECRET}
- SPOTIFY_REFRESH_TOKEN=${SPOTIFY_REFRESH_TOKEN}

5) Restart service/container

docker compose down
docker compose up -d openclaw-gateway
chown <runtime_user>:<runtime_group> /path/to/workspace/spotify.py
chmod 664 /path/to/workspace/spotify.py

Usage

Run commands from workspace:

python3 spotify.py <command>
CommandDescription
python3 spotify.py statusShow current playback state and track
python3 spotify.py playResume playback
python3 spotify.py pausePause playback
python3 spotify.py nextSkip to next track
python3 spotify.py prevGo to previous track
python3 spotify.py volume 80Set volume (0–100) where supported
python3 spotify.py search trackSearch tracks (top results)
python3 spotify.py playsearch "track"Search and play first result
python3 spotify.py playtrack spotify:track:URIPlay specific track URI
python3 spotify.py devicesList available Spotify devices
python3 spotify.py setdevice "BEDROOM-SPEAKER"Set active device by name or id

VPS / Headless behavior notes

  • Headless server control works because playback is executed on Spotify Connect devices (phone/desktop/web), not the server audio output.
  • You still need at least one active Spotify device session.

If you see NO_ACTIVE_DEVICE:

  1. Open Spotify on target device
  2. Start any track manually once
  3. Run python3 spotify.py devices
  4. Retry command

Known Spotify API limitations (expected)

  • Some devices/content contexts may return 403 Restriction violated for play, prev, or other controls.
  • Some devices may reject remote volume changes (VOLUME_CONTROL_DISALLOW).
  • Device handoff can lag; immediate status after transfer may briefly show stale state.

These are Spotify-side constraints, not necessarily script bugs.


Operational guidance for automations

  • Treat non-zero exit codes as command failures.
  • Validate environment vars at startup.
  • Log command + status code for troubleshooting.
  • Retry once for transient network errors.
  • Don’t hardcode real credentials in files.

Security notes

  • Never commit .env with live secrets.
  • Rotate app credentials if leaked.
  • Use least-access scopes required for your workflow.
  • The script only communicates with accounts.spotify.com and api.spotify.com

Quick troubleshooting checklist

  1. python3 spotify.py devices shows your target device?
  2. Device is active in Spotify app?
  3. Env vars loaded inside container/runtime?
  4. Premium account confirmed?
  5. Refresh token still valid?
  6. Any Spotify 403 restriction reason in response?

Claim accuracy

  • Uses official Spotify Web API ✅
  • Works on headless VPS ✅
  • Practical for personal usage ✅
  • Subject to normal Spotify API behavior/limits ✅

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

89.17%
按下载量换算3,969

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

未展示

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills