Shpotify是一个简单的BASH/APPL脚本,可从Mac上的命令行控制Spotify。
如果您觉得这很有趣,则应该在Twitter上关注我,以了解我所做的其他事情。
如果尚未下载并安装Spotify桌面应用程序。
安装Shpotify的最简单方法是使用Homebrew Package Manager:
brew install shpotify
如果您不使用自制者,则可以按照几个简单的步骤手动安装脚本:
使用git或下载zip存档的副本,获取此存储库的副本。
导航到您获取存储库的文件夹(如果需要的话),并确保称为spotify的文件可执行:
cd shpotify
chmod +x spotify
将文件spotify到PATH中的方便位置,或将PATH设置为包含文件所在的文件夹。
Shpotify需要连接到Spotify的API,以便按名称找到音乐。您很可能想要此功能!
为了使其起作用,您首先需要注册(或进入)Spotify的开发人员网站并创建一个应用程序。完成此操作后,您可以找到其Client ID和Client Secret值,并在${HOME}/.shpotify.cfg处将其输入SHPotify Config File。
确保引用您的价值,不要添加任何额外的空间。完成后,它看起来应该如下(但具有您自己的价值):
CLIENT_ID="abc01de2fghijk345lmnop"
CLIENT_SECRET="qr6stu789vwxyz"
使用Shpotify,您可以使用以下命令控制Spotify:
spotify play Resumes playback where Spotify last left off.
spotify play <song name> Finds a song by name and plays it.
spotify play album <album name> Finds an album by name and plays it.
spotify play artist <artist name> Finds an artist by name and plays it.
spotify play list <playlist name> Finds a playlist by name and plays it.
spotify play uri <uri> Play songs from specific uri.
spotify next Skips to the next song in a playlist.
spotify prev Returns to the previous song in a playlist.
spotify replay Replays the current track from the beginning.
spotify pos <time> Jump to a specific time (in seconds) in the current song.
spotify pause Pauses (or resumes) Spotify playback.
spotify stop Stops playback.
spotify quit Stops playback and quits Spotify.
spotify vol up Increases the volume by 10%.
spotify vol down Decreases the volume by 10%.
spotify vol <amount> Sets the volume to an amount between 0 and 100.
spotify vol [show] Shows the current volume.
spotify status Shows the play status, including the current song details.
spotify status artist Shows the currently playing artist.
spotify status album Shows the currently playing album.
spotify status track Shows the currently playing track.
spotify share Displays the current song's Spotify URL and URI.
spotify share url Displays the current song's Spotify URL and copies it to the clipboard.
spotify share uri Displays the current song's Spotify URI and copies it to the clipboard.
spotify toggle shuffle Toggles shuffle playback mode.
spotify toggle repeat Toggles repeat playback mode.
Shpotify主要由Harish Narayanan撰写和维护。
由于它是一个开源项目,因此它包含许多有帮助的人的众多贡献,包括:
如果您也有兴趣做出贡献,请考虑解决人们以前报告的一些问题并提交拉的请求。谢谢你!
版权(C)2012–2024 Harish Narayanan。
特此免费授予获得此软件副本和相关文档文件副本(“软件”)的任何人,以无限制处理该软件,包括无限制的使用权,复制,复制,修改,合并,合并,发布,分发,分发,分发,订婚,和/或允许软件的副本,并允许对以下条件提供以下条件,以下是以下条件。
上述版权通知和此许可通知应包含在软件的所有副本或大量部分中。
该软件是“原样”提供的,没有任何形式的明示或暗示保证,包括但不限于适销性,特定目的的适用性和非侵权的保证。在任何情况下,作者或版权持有人都不应对任何索赔,损害赔偿或其他责任责任,无论是在合同,侵权的诉讼中还是其他责任,是由软件,使用或与软件中的使用或其他交易有关的。