Skip to content

👻 A paranormal fix for Spotify's "Liked Songs" sync bug. This program adds a random "ghost" track to your playlist, removes it, and then vanishes, forcing a cross-device update. Schedule it with a job scheduler like cron and let the ghost of you haunt your playlist just long enough to keep it in sync.

License

Notifications You must be signed in to change notification settings

elliotwutingfeng/the-ghost-of-you-spotify

the-ghost-of-you-spotify

Go Reference Go Report Card License

What is this?

A paranormal fix for Spotify's "Liked Songs" sync bug.

There is an ongoing problem with the Spotify music player app where the "Liked Songs" playlist fails to sync consistently across devices. Reinstalling the Spotify app usually does not help.

A workaround is to add a new track to the "Liked Songs" playlist, in order to force a cross-device update.

This program performs the same workaround; it adds a new random "ghost" track from the Spotify catalogue to your "Liked Songs" playlist, removes it, and then vanishes, like a ghost.

Schedule it with a job scheduler like cron and let the ghost of you haunt your playlist just long enough to keep it in sync.

Warning

This program is designed to modify the content of your Spotify account.

The credentials in the .env file must be kept safe as they can be used to access your Spotify account.

Requirements

Tested on Linux x64

Setup

Setup Environment File

Run the following

cp --update=none .env.txt .env

Alternatively, make a copy of .env.txt and name it .env.

Create A Spotify App

  1. Sign in to your Spotify Developer account.

  2. Create a spotify app.

  3. Fill in the following details

    • App name: The Ghost Of You Spotify
    • App description: Keep your liked songs synced up across your devices.
    • Redirect URIs: http://127.0.0.1:3000/callback
    • APIs used: Select Web API.
  4. Agree with the Terms of Service and click "Save".

  5. In the Spotify dashboard, select your newly created app and copy the Client ID and Client secret to the .env file in this project's root directory under the fields CLIENT_ID and CLIENT_SECRET.

  6. If your Spotify market country code is not "SG" (Singapore), replace the value of MARKET in .env file with the correct country code. A list of market country codes is provided by Spotify API (sign-in required).

Usage

Important

When running this program for the first time, your web browser will open up a Spotify sign-in webpage for you to sign in and grant your newly created app access permissions to your Spotify account's library.

Sign-in should not be needed for subsequent runs as this program will use a refresh token stored in the .env file for future requests to the Spotify API.

Run the following. If prompted via web browser, sign-in to your Spotify account and grant app access.

go run main.go

If successful, the program should terminate with output similar to the following

🔍 Looking for a suitable ghost track...
🎯 Found track   | ID: 0000000000000000000000
📝 Added track   | ID: 0000000000000000000000
❌ Removed track | ID: 0000000000000000000000
👻 Boo! Your "Liked Songs" playlist should be synced up now across all devices.

Run In Job scheduler

You can use a job scheduler like cron to run this program at regular intervals to keep your Spotify "Liked Songs" playlist in sync across devices.

Build the program.

# This creates an executable program file at ./dist/theghostofyouspotify
make build

Example: Set up the cron job to run every 15 minutes. Ensure that your .env file is in place with the correct values before installing the new cron job.

*/15 * * * * /path/to/dist/theghostofyouspotify

Disclaimer

  • This program is licensed under BSD-3-Clause. There is no warranty.
  • This is not an official Spotify product or service.

About

👻 A paranormal fix for Spotify's "Liked Songs" sync bug. This program adds a random "ghost" track to your playlist, removes it, and then vanishes, forcing a cross-device update. Schedule it with a job scheduler like cron and let the ghost of you haunt your playlist just long enough to keep it in sync.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks