Skip to content
This repository was archived by the owner on Jan 21, 2023. It is now read-only.

matievisthekat/spotifysync-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpotifySync

⚠️ this repository has been archived. if you want this project to be maintained please contact matievisthekat@gmail.com or fork this repo ⚠️

A WebSocket server used to transmit information to any SpotifySync app that tries to connect to it via its HTTP url. SpotifySync does not violate any legal agreements with Spotify.

Setup

  1. Create a Spotify application at https://developer.spotify.com/dashboard/applications (make sure to keep your application's page open for later)

  2. Click edit settings

  1. Enter http://localhost as a redirect uri and click "Add"

  1. Go to https://accounts.spotify.com/authorize?client_id=<YOUR_CLIENT_ID>&redirect_uri=http://localhost&scope=user-read-playback-state&response_type=code&show_dialog=true (replace <YOUR_CLIENT_ID> with your actual client's id) and click agree

  1. You should see something like this

  1. Copy the url in your search box

  1. Open DevTools by pressing Ctrl+Shft+I (or the combination specific to your browser)

  2. Then navigate to to "Console" tab (or your browser's equivalent) and paste the url between two single quotes

  1. At the end of the line type .split("=")[1], press enter, and save the output somewhere for later

  2. Go to https://www.base64encode.net/

  3. In the text box enter <YOUR_CLIENT_ID>:<YOUR_CLIENT_SECRET> (replace <YOUR_CLIENT_ID> and <YOUR_CLIENT_SECRET> with your actual values from https://developer.spotify.com/dashboard/applications

  4. Press "Encode" and copy the output

  5. Open cmd on Windows or a terminal on macOS/Linux.

  6. Type curl -H "Authorization: Basic <OUTPUT_HERE>" -d grant_type=authorization_code -d code=<CODE_FROM_EARLIER> -d redirect_uri=http%3A%2F%2Flocalhost https://accounts.spotify.com/api/token > output.txt (replace <OUTPUT_HERE> with your copied output and <CODE_FROM_EARLIER> with your saved code from step 9)

  7. Open C:\Users\<your_username>\output.txt on Windows (or the equivalent for your operating system)

  8. It should say something like {"access_token":"BQCRWpB8.....1hcxKsks","token_type":"Bearer","expires_in":3600,"refresh_token":"AQD.....FVUPjQ","scope":"user-read-playback-state"}. If it doesn't you will need to restart from step 4

  1. Clone (not fork!) this repository. Be sure to make it private!

  2. In your cloned repository create a file called config.json in the root directory

  3. Enter this content (replace all necessary values)

{
  "client_id": "your client id",
  "client_secret": "your client secret",
  "access_token": "access_token from output.txt",
  "refresh_token": "refresh_token from output.txt",
  "expires_in": 3600,
  "fetched_timestamp": "the current timestamp (you can get it from https://www.currenttimestamp.com). remove the double quotes after pasting"
}
  1. Run yarn start or yarn pm2

  2. That's it! To connect to your server via the app you will need to get your server's public IP or setup a domain name

About

Broadcast your Spotify music to other people!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors 3

  •  
  •  
  •