Skip to content

A Spotify Now Playing screensaver ran using a privately hosted server. Powered by the Spotify API

License

Notifications You must be signed in to change notification settings

11ason/Spotify-Now-Playing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotify-Now-Playing

Spotify-Now-Playing is a screensaver application that displays the currently playing song on your Spotify account. It utilizes the Spotify API to fetch the song information and display it in a visually appealing manner.

Prerequisites

Before using this application, ensure you have the following installed:

  • Node.js - JavaScript runtime environment
  • Express.js - Web application framework for Node.js

Setup Instructions

  1. Download Release

  2. Install Dependencies: Navigate to the project directory and install dependencies using npm:

    npm install
  3. Create Spotify Application:

    • Go to the Spotify Developer Dashboard.
    • Log in or sign up for a Spotify Developer account.
    • Create a new application and note down the client ID and client secret.
  4. Configure Application:

    • Open auth.html file in the project directory.
    • Replace 'Client_id' with your actual Spotify client ID.
    • Specify the correct redirect URI (redirect_uri) based on your setup.

Running the Application

Local Network Deployment: Start the server using the following command:

node server.js
  1. Remote Access Deployment:
    • If you want to keep the site on your local network, no further action is required.
    • If you want to make the site accessible from anywhere, use ngrok:
      ngrok http --domain=your-domain-name 8080

Issues and Security Risks

  • Client Secrets: Never expose your client secret in client-side code. Use environment variables or server-side code for secure handling.
  • Reauthorization: Users may need to reauthorize every hour due to Spotify's token expiration policy. This may never be resolved in the code (You can probably find a workaround) Should be solved in the newest release.
  • Vulnerabilities: The code may contain vulnerabilities that could potentially compromise the security of your site. Review the code and address any security issues before deploying publicly.

Accessing the Application

When running the site, accessing localhost:8080 directly will not display anything. Instead, you need to follow a specific route to authorize the application and view the currently playing song.

  1. Authorization Page: To begin, navigate to localhost:8080/auth in your web browser. This page prompts you to authorize the site to access your Spotify account.

  2. Main Page: After authorizing the site, you will be redirected to localhost:8080/main, where you can see the currently playing song.

Expected Behavior

The site will display a white screen until music is being played. After authorization, it will display the currently playing song information.

Please note that the site uses javascript and Will Not Work in browsers that don't have javascript.


Screenshot

media controls in use

Transition-example


Created with <3 by Mason | Feel free to edit code, But please keep it free and open source.