Create Spotify App.
- Go to Spotify Developer and login
- Create App
- Here is our Client Id and Client Secret which we will use later
- Click EDIT SETTINGS
- Add
http://localhost:8080
as Redirect URLs
- Grab any dependancies with
python -m pip install keyboard
andpython -m pip install spotipy
- Open VolumeController.py with a text editor, and populate
SPOTIFY_USERNAME
,SPOTIFY_CLIENT_ID
,SPOTIFY_CLIENT_SECRET
with the ID's from above. - By default, Spotify volume up and down are bound to Page Up and Page Down. You can find the names of other keys to bind Spotify volume up and down here. NOTE: It appears that the options to rebind to are limited, so it could be easier to rebind your desired key (or rotary encoder) to the desired physical keys.
- Place
VolumeController.py
,VolumeController.bat
,VolumeController.vbs
in the same folder somewhere. - Double-click
VolumeController.bat
, and a browser should open asking for authorization for your app to run. - The script should now be running, and the opened terminal should just have
>>>
as the prompt (meaning you are in a Python instance). - A
.cache
file should be automatically created in the same directory with the information needed to run the script - If you want to have the python script automatically run at startup, make a shortcut of
VolumeController.vbs
and place it in the folder that appears when you hitWin + R
and entershell:startup
. - And you are ready to go :D