A desktop application that mimics the Spotify CarThing device, displaying the currently playing song with album art, track info, and playback controls.
- Features
- Screenshots
- Prerequisites
- Installation
- Usage
- Configuration
- Dependencies
- License
- Acknowledgments
- Real-Time Track Display: Shows the currently playing track on Spotify.
- Album Art: Displays the album art of the current track.
- Track Information: Shows track name, artist name, and album name.
- Playback Controls:
- Play/Pause
- Next Track
- Previous Track
- Shuffle Toggle
- Like/Unlike Track: Add or remove the current track from your Liked Songs.
- Progress Bar: Displays track progress with current time and total duration.
- Dynamic UI: Adapts the UI colors based on the album art.
- Custom Window: Rounded corners and draggable interface without standard window borders.
Note: Include screenshots of your application here.
- Spotify Premium Account: Required to control playback and access user-specific data.
- Spotify Developer Account: To obtain API credentials.
- Python 3.6 or higher
git clone https://github.com/yourusername/spotify-mini-carthing.git
cd spotify-mini-carthing- Log in to the Spotify Developer Dashboard.
- Click on Create an App.
- Enter an app name and description.
- Click on Edit Settings and add
http://localhost:8888/callbackto the Redirect URIs. - Save the settings.
- Note down your Client ID and Client Secret.
It's recommended to use a virtual environment.
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`pip install -r requirements.txtIf requirements.txt is not provided, install packages individually:
pip install PyQt5 spotipy qtawesomeUpdate the client_id, client_secret, and redirect_uri in the script with your Spotify API credentials.
# Spotify authentication credentials
client_id = 'your_client_id_here'
client_secret = 'your_client_secret_here'
redirect_uri = 'http://localhost:8888/callback'python spotify_mini_carthing.pyNote: Replace spotify_mini_carthing.py with the actual filename if different.
Upon running the application for the first time, you'll be prompted to authenticate with Spotify:
- A web browser window will open, asking you to log in to your Spotify account and authorize the application.
- After authorization, you'll be redirected to the redirect URI (
http://localhost:8888/callback) with an authentication code. - The application will capture this code and proceed to display the current track information.
Ensure you have set your Spotify API credentials in the script:
client_idclient_secretredirect_uri
The redirect_uri must match exactly between your Spotify Developer Dashboard and the script.
The application requests the following scopes:
user-read-currently-playinguser-read-playback-stateuser-modify-playback-stateuser-library-readuser-library-modify
These scopes allow the application to read your currently playing track, control playback, and manage your library.
- Python 3.6+
- PyQt5: Python bindings for the Qt application framework.
- Spotipy: A lightweight Python library for the Spotify Web API.
- qtawesome: Icon packs for PyQt.
pip install PyQt5 spotipy qtawesomeThis project is licensed under the MIT License - see the LICENSE file for details.
- Spotify: For providing a robust API to interact with music data.
- Qt and PyQt5: For making GUI development accessible in Python.
- QtAwesome: For the icon packs used in the application.
- Spotipy: For simplifying interactions with the Spotify API.
If you receive an authentication error:
- Ensure your
client_id,client_secret, andredirect_uriare correctly set. - The
redirect_uriin your script must match exactly with the one set in your Spotify Developer Dashboard. - Make sure you have a stable internet connection.
If the application displays "No active playback found.":
- Ensure that Spotify is running and playing music on one of your devices.
- The application cannot control devices in Private Session mode.
For debugging purposes, you can print additional information to the console by adding print statements or configuring logging in the script.
Contributions are welcome! Please open an issue or submit a pull request.
This project is not affiliated with or endorsed by Spotify. It is an independent project created for educational purposes.