shpotify A command-line interface to Spotify.开源项目

我要开发同款
匿名用户2021年11月09日
44阅读
开发技术SHELL
所属分类终端/远程登录、应用工具
授权协议Readme

作品详情

shpotify

shpotifyisasimpleBash/ApplescripttocontrolSpotifyfromthecommandlineonaMac.

Ifyoufindthisinteresting,youshouldfollowmeonTwittertolearnabouttheotherthingsIdo.

Installation

DownloadandinstalltheSpotifydesktopapplicationifyouhaven’talready.

WithHomebrew

TheeasiestwaytoinstallshpotifyisbyusingtheHomebrewpackagemanager:

brewinstallshpotifyManualinstallation

Ifyoudon’tuseHomebrew,youcaninstallthescriptmanuallybyfollowingafewsimplesteps:

Fetchacopyofthisrepository,eitherwithgitordownloadtheziparchive.

Navigatetothefolderwhereyoufetchedtherepository(unzipifneeded)andmakesurethefilecalledspotifyisexecutable:

cdshpotifychmod+xspotify

CopythefilespotifytoaconvenientlocationinyourPATH,orsetyourPATHtoincludethefolderwherethefileislocated.

ConnectingtoSpotify’sAPI

shpotifyneedstoconnecttoSpotify’sAPIinordertofindmusicbyname.Itisverylikelyyouwantthisfeature!

Togetthistowork,youfirstneedtosignup(orinto)Spotify’sdevelopersiteandcreateanApplication.Onceyou’vedoneso,youcanfinditsClientIDandClientSecretvaluesandenterthemintoyourshpotifyconfigfileat${HOME}/.shpotify.cfg.

Besuretoquoteyourvaluesanddon’taddanyextraspaces.Whendone,itshouldlooklikethefollowing(butwithyourownvalues):

CLIENT_ID="abc01de2fghijk345lmnop"CLIENT_SECRET="qr6stu789vwxyz"Usage

WithshpotifyyoucancontrolSpotifywiththefollowingcommands:

spotifyplayResumesplaybackwhereSpotifylastleftoff.spotifyplay<songname>Findsasongbynameandplaysit.spotifyplayalbum<albumname>Findsanalbumbynameandplaysit.spotifyplayartist<artistname>Findsanartistbynameandplaysit.spotifyplaylist<playlistname>Findsaplaylistbynameandplaysit.spotifyplayuri<uri>Playsongsfromspecificuri.spotifynextSkipstothenextsonginaplaylist.spotifyprevReturnstotheprevioussonginaplaylist.spotifyreplayReplaysthecurrenttrackfromthebeginning.spotifypos<time>Jumptoaspecifictime(inseconds)inthecurrentsong.spotifypausePauses(orresumes)Spotifyplayback.spotifystopStopsplayback.spotifyquitStopsplaybackandquitsSpotify.spotifyvolupIncreasesthevolumeby10%.spotifyvoldownDecreasesthevolumeby10%.spotifyvol<amount>Setsthevolumetoanamountbetween0and100.spotifyvol[show]Showsthecurrentvolume.spotifystatusShowstheplaystatus,includingthecurrentsongdetails.spotifystatusartistShowsthecurrentlyplayingartist.spotifystatusalbumShowsthecurrentlyplayingalbum.spotifystatustrackShowsthecurrentlyplayingtrack.spotifyshareDisplaysthecurrentsong'sSpotifyURLandURI.spotifyshareurlDisplaysthecurrentsong'sSpotifyURLandcopiesittotheclipboard.spotifyshareuriDisplaysthecurrentsong'sSpotifyURIandcopiesittotheclipboard.spotifytoggleshuffleTogglesshuffleplaybackmode.spotifytogglerepeatTogglesrepeatplaybackmode.Authorsandcontributing

shpotifyisprimarilywrittenandmaintainedbyHarishNarayanan.

Sinceit’sanopensourceproject,itcontainsnumerouscontributionsfrommanyhelpfulpeople,including:

JorgeColindresThomasPritchardiLanEpsteinGabrieleBonettiSeanHellerEricMartinPeterFonseca

Ifyou’reinterestedincontributingtoo,pleaseconsideraddressingsomeoftheissuespeoplehavepreviouslyreportedandsubmittingapullrequest.Thankyou!

Copyrightandlicense

Copyright(c)2012–2021HarishNarayanan.

Permissionisherebygranted,freeofcharge,toanypersonobtainingacopyofthissoftwareandassociateddocumentationfiles(the"Software"),todealintheSoftwarewithoutrestriction,includingwithoutlimitationtherightstouse,copy,modify,merge,publish,distribute,sublicense,and/orsellcopiesoftheSoftware,andtopermitpersonstowhomtheSoftwareisfurnishedtodoso,subjecttothefollowingconditions:

TheabovecopyrightnoticeandthispermissionnoticeshallbeincludedinallcopiesorsubstantialportionsoftheSoftware.

THESOFTWAREISPROVIDED"ASIS",WITHOUTWARRANTYOFANYKIND,EXPRESSORIMPLIED,INCLUDINGBUTNOTLIMITEDTOTHEWARRANTIESOFMERCHANTABILITY,FITNESSFORAPARTICULARPURPOSEANDNONINFRINGEMENT.INNOEVENTSHALLTHEAUTHORSORCOPYRIGHTHOLDERSBELIABLEFORANYCLAIM,DAMAGESOROTHERLIABILITY,WHETHERINANACTIONOFCONTRACT,TORTOROTHERWISE,ARISINGFROM,OUTOFORINCONNECTIONWITHTHESOFTWAREORTHEUSEOROTHERDEALINGSINTHESOFTWARE.

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论