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文件中。
確保引用您的價值,不要添加任何額外的空間。完成後,它看起來應該如下(但具有您自己的價值):
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。
特此免費授予獲得此軟件副本和相關文檔文件副本(“軟件”)的任何人,以無限制處理該軟件,包括無限制的使用權,複製,複製,修改,合併,合併,發布,分發,分發,分發,訂婚,和/或允許軟件的副本,並允許對以下條件提供以下條件,以下是以下條件。
上述版權通知和此許可通知應包含在軟件的所有副本或大量部分中。
該軟件是“原樣”提供的,沒有任何形式的明示或暗示保證,包括但不限於適銷性,特定目的的適用性和非侵權的保證。在任何情況下,作者或版權持有人都不應對任何索賠,損害賠償或其他責任責任,無論是在合同,侵權的訴訟中還是其他責任,是由軟件,使用或與軟件中的使用或其他交易有關的。