名称: spotify-web-api
描述: 通过 Spotify Web API 控制播放、查看历史记录、热门曲目及搜索功能。跨平台支持(无需 Mac)。
主页: https://spotify.com
元数据: {"clawdbot":{"emoji":"🎵","requires":{"env":["SPOTIFY_CLIENT_ID","SPOTIFY_CLIENT_SECRET"]}}}
通过 Spotify Web API 控制 Spotify。支持任意平台,无需 Mac。
http://localhost:8888/callbackexport SPOTIFY_CLIENT_ID="your_client_id"
export SPOTIFY_CLIENT_SECRET="your_client_secret"
python3 {baseDir}/scripts/spotify.py auth
执行后将打开浏览器进行 OAuth 验证。令牌将缓存至 ~/.spotify_cache.json。
# 当前播放
python3 {baseDir}/scripts/spotify.py now
# 最近播放记录
python3 {baseDir}/scripts/spotify.py recent
# 热门曲目/艺人
python3 {baseDir}/scripts/spotify.py top tracks --period month
python3 {baseDir}/scripts/spotify.py top artists --period year
# 播放控制
python3 {baseDir}/scripts/spotify.py play
python3 {baseDir}/scripts/spotify.py play "bohemian rhapsody"
python3 {baseDir}/scripts/spotify.py pause
python3 {baseDir}/scripts/spotify.py next
python3 {baseDir}/scripts/spotify.py prev
# 搜索
python3 {baseDir}/scripts/spotify.py search "daft punk"
# 列出设备
python3 {baseDir}/scripts/spotify.py devices
基于 Spotify Web API 开发:
https://developer.spotify.com/documentation/web-api