I wanted to make a way to control my Spotify when I don't always have access to my phone for extended periods of time, without running Spotify in my web browser
I explored HTTP requests and HTTP servers to access certain commands in the Spotify Web API. There was no use of the spotipy library.
- HTTPServer made in Python
- Usage of HTTP requests
- Can pause, play, skip, add to queue, and get the current song
- Shows a window that:
- Displays the current song title with the album cover that refreshes every 5 seconds
- Displays the next 7 songs in the queue that refreshes every 5 seconds
- Has button options explained in Usage
- Python
- Spotify Web API
- Clone the repository and enter the folder:
git clone https://github.com/SETHCODES13/spotify_controller.git
cd spotify_controller
- Create and activate a virtual environment(optional but recommended):
Linux & macOS
python3 -m venv .venv
source .venv/bin/activate
Windows(Command Prompt)
python -m venv .venv
.venv\Scripts\activate
- Install the required Libraries:
pip install -r requirements.txt
Note: sudo apt install python3-tk on Debian or Ubuntu if Tkinter is missing
- Create an app on the Spotify Developer API
- Add the redirect URL
http://127.0.0.1:8888/callback - Paste your Client ID in the
client_idline inheard_em_say.py
The standard look of the window
When you run python3 heard_em_say.py, it shows the pop-up window shown above, which will be fully activated when a song is playing
| Button | Function |
|---|---|
Add to Queue |
Adds the song entered in the textbox in the format (Song Name - Song Artist) |
Pause/Play |
Pauses and plays the song based on whether it's paused or not. |
| Spotify API deactivates the player shortly after being paused, so resuming can fail | |
Next Song |
Plays the next song |
Previous Song |
Plays the previous song |
MIT License, see LICENSE

