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.
Before using this application, ensure you have the following installed:
- Node.js - JavaScript runtime environment
- Express.js - Web application framework for Node.js
-
Download Release
-
Install Dependencies: Navigate to the project directory and install dependencies using npm:
npm install
-
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.
-
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.
- Open
Local Network Deployment: Start the server using the following command:
node server.js
- 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
- 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.
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.
-
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. -
Main Page: After authorizing the site, you will be redirected to
localhost:8080/main
, where you can see the currently playing song.
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](https://private-user-images.githubusercontent.com/146950994/319341196-2d4e8cdc-a574-4f6f-802a-7081d92c56a4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxMDA3ODAsIm5iZiI6MTcyMDEwMDQ4MCwicGF0aCI6Ii8xNDY5NTA5OTQvMzE5MzQxMTk2LTJkNGU4Y2RjLWE1NzQtNGY2Zi04MDJhLTcwODFkOTJjNTZhNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNFQxMzQxMjBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kZDg4YmRjMTc1ZmY3NTdhNTU5MzkyYmI0ZjBmODQzYjliNWYyYzNjZjA3NmRjNTljN2FmZmM0ZDI0YWNiN2RiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.vY2UvD_VDdZxwD4_e66uizC75yqRzgcKMu5COlIzMyE)
Created with <3 by Mason | Feel free to edit code, But please keep it free and open source.