一个简单的spotify cli

spt的Python项目详细描述


间谍

使用Click和{a2}生成的简单Spotify CLI

这是作为一种个人练习来制作CLIs。它的灵感来自于MacOS上可用的shpotify。在

设置

pip install spty

或者,如果您想玩它,您可以fork the repo。在

外壳完成

这是可选的,但是启用tab completion可以让您更快地探索和发出命令,而不必咨询--help。在

对于zsh

^{pr2}$

对于bash

_SPTY_COMPLETE=source_bash spty >> ~/.bashrc

与您的Spotify连接

spty不直接与本地Spotify应用程序通信,而是通过API调用进行通信。是遥控器。作为先决条件,您必须在Spotify for Developers上“创建”一个Spotify应用程序。在

有关更多说明,请参见他们的App Settings guide。请注意,应用程序的名称和描述对于这个CLI来说并不重要。在

使用

必须先运行spotify应用程序,然后才能使用CLI。在

spty                      Show all commands
spty config               (Re)configure your Spotify app values

spty play                 Play or resume playback
spty play TRACK           Find a track and play it
spty play album ALBUM     Find an album and play it
spty play artist ARTIST   Find an artist and play its discography
spty play list PLAYLIST   Find a playlist and play it

spty pause                Pause the playback
spty stop                 Stop the playback
spty replay               Replay the current song
spty next                 Skip to the next song
spty previous (prev)      Play the previous song

spty fast-forward (ffwd)  Fast-forward by SECONDS (10 by default)
spty rewind (rew)         Rewind by SECONDS (10 by default)
spty seek                 Play current song at TIMESTAMP (e.g. 1:30)

spty vol                  Show current volume
spty vol up               Increase volume by 10
spty vol down             Decrease volume by 10
spty vol PERC             Set volume to PERC (0-100)
spty repeat               Set repeat mode (track, context, or off)
spty shuffle              Toggle shuffle or explicitly turn it on/off

spty status               Show playback status
spty status track         Show track title
spty status title         Show album title
spty status artist        Show artist/s
spty status -v            Show playback status, including shuffle and repeat state

spty share                Show the current song's url and uri
stpy share url            Show the current song's url
stpy share uri            Show the current song's uri

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
JFrame中的Java多线程   java Servlet异常映射   java无法从输出流读取   swing Java带来的小程序GUI问题   java什么原因导致错误“'void'类型此处不允许”以及如何修复它?   Java选择器select(长)与selectNow的区别   java自定义arraylist<mygames>获得不同   java Icepdf注释让页面消失   java反向整数数组   java I在生成同步“无法解析配置的所有依赖项”时遇到此错误:app:debugRuntimeClasspath   多个虚拟机上的java线程访问单个DB实例上的表,有时会导致性能低下和异常   swing更改Java中的默认按钮,使其看起来“更好”   java慢速MQ主题订阅。并行化不能提高性能   java运行Boggle Solver需要一个多小时。我的代码怎么了?   数据库中的java循环与应用程序中的java循环   正则表达式匹配${123…456}并在Java中提取2个数字?   java如何制作我们软件的试用版   Java内存参数计算   从另一个类调用方法时出现java问题