MrFrank2716 / SpotiSync

A lightweight Spotify player/visualizer built in Python - recommended for low power computers such as Raspberry Pi to show your Now Playing song and the last listened song!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SpotiSync a Spotify Visualizer

A lightweight Spotify player/visualizer built in Python - recommended for low power computers such as Raspberry Pi to show your Now Playing song and the last listened song!

Introduction

Spotify Visualizer is a Python program that creates a dynamic visual display of the currently playing song on Spotify. It utilizes the Spotify API and various libraries to fetch album art, extract dominant colors, and display song information in a visually appealing manner.

Demo1

Background color changes depending on the album art.

Demo2

Text color changes for best contrast and readability.

Demo3

Advertisment Detection for non-Premium users.

Advert Detection

Features

  • Background color adaptation based on the dominant color of the album art.
  • All text changes to either Black or White dependent on the dominant color for the best contrast.
  • Real-Time Song Display: Stay in the groove by keeping track of the song, artist, and album name as it plays on your Spotify account in real-time.
  • Last Played Song: Keep track of your listening history with the ability to monitor the last played song, ensuring you never miss a beat.
  • Dynamic Album Art: Enjoy a stunning display of the current track's album art as the background, making each song come to life.
  • Color Synchronization: The application dynamically changes the background color based on the dominant color of the album art, creating a visually captivating experience.
  • Advertisement Handling: Seamlessly transition between your favorite tracks and Spotify ads, ensuring you're always informed about what's playing.

Requirements

  • Python 3.x
  • Python libraries: requests, spotipy, PIL, io, pygame, fast_colorthief
  • Spotify developer account with client ID and client secret.
  • A machine with a screen to display the visualization.

Installation

  1. Clone this repository to your local machine:
    git clone https://github.com/your-username/spotify-visualizer.git
  2. Install the required Python libraries:
    pip install requests spotipy Pillow pygame colorthief

Set up your Spotify Developer Account and obtain the client ID and client secret.

To allow authorisation to your track data, you'll need to generate Spotify API keys. You can do this by logging in to the Spotify Dashboard creating an app.

Call the application 'SpotiSync'.

Set the Redirect URI as the URL in the script (default is http://localhost:1234). This must be set else Spotify won't authorise SpotiSync.

Important: The Redirect URI entered in this field must match the URL of the script exactly, or you'll receive authorisation errors. A common issue is that Spotify will automatically add a trailing slash to the URL upon saving. For example: http://localhost:1234 vs http://localhost:1234/.

You can leave the other settings (Callback URL, Bundle IDs etc) blank.

Copy down the Client Secret and Client ID and save your app in the Spotify Dashboard.

  1. Update the following variables in the script with your Spotify API credentials:
SPOTIPY_CLIENT_ID = 'your-client-id'
SPOTIPY_CLIENT_SECRET = 'your-client-secret'

Usage

  1. Run the program using Python:
python main.py
  1. The program will display the current song playing on your Spotify account in real-time.

  2. You can press the Spacebar key to exit the program.

Credits

Developed by Frankie Pang.

License

This project is open-source and available under the MIT License. You are free to use, modify, and distribute it.

Happy listening and visualizing!

About

A lightweight Spotify player/visualizer built in Python - recommended for low power computers such as Raspberry Pi to show your Now Playing song and the last listened song!

License:MIT License


Languages

Language:Python 100.0%