Skip to content

sandrzejewskipl/spotify-scheduler

Repository files navigation

Spotify Scheduler
Automate and schedule your Spotify playback

This Python GUI application lets you schedule Spotify playlists to play at specific hours, minutes and seconds (e.g. 8:00-8:15:30). Easily automate your Spotify playback to match your schedule and listening preferences with precision. You can select a different playlist for each time slot. It's a much easier alternative to music automation softwares. Spotify Scheduler also features a history of recently played songs.

Screenshot of Now Playing tab that display currently played song on Spotify, current time slot and checklist feature.

Easily plan and schedule music for any time of day! Modify your schedule, choose a playlist from the user's playlist library, or directly add a playlist using its ID or link. Perfect for managing music playback effortlessly, whether you're creating a radio station for your school to play music during breaks or events, setting up a music schedule for your workplace, or planning playlists for specific times at venues.

Screenshot of Schedule tab contains your Spotify playlist schedule - start and end times.

Scheduling playlists

In the Playlist tab, you can assign playlists to specific time slots. If no playlist is assigned to a slot, the default playlist will be used.

Screenshot of Playlist tab that contains selected playlist for specific time slot and user's playlists from Spotify.

Recently played

In the Recently played tab, you can see your playback history.

Running on Windows

Set up Spotify App:

Download an .exe file from the latest release here and launch it.

On the first run, you will be asked for CLIENT_ID and CLIENT_SECRET from Spotify. Then OAuth popup should open.

Running on Linux

Clone the repository (by the command below, or download it)

git clone https://github.com/sandrzejewskipl/spotify-scheduler.git

Inside Spotify Scheduler's directory run this command:

chmod +x run.sh

Now, you can run this app by running:

./run.sh

This script will take care of making sure that Python3 and dependencies are installed.

On the first run, you will be asked for CLIENT_ID and CLIENT_SECRET from Spotify. Then OAuth popup should open.

Running script manually

Clone the repository (by the command below, or download it)

git clone https://github.com/sandrzejewskipl/spotify-scheduler.git

Install dependencies:
Make sure you have Python 3 installed. Then, download the required packages by running:

pip3 install -r requirements.txt

Make sure you have Python3-tk installed.

  • Linux: sudo apt-get install python3-tk

  • MacOS: brew install python-tk

Set up Spotify App:

Run this command from the command line in the same directory.

python3 spotifyscheduler.py

On the first run, you will be asked for CLIENT_ID and CLIENT_SECRET from Spotify. Then OAuth popup should open.

If you're running script manually on Windows and you're using cmd.exe (not Windows Terminal) remember to disable Quickedit to prevent program from freezing:

  • Right-click the title bar of the Command Prompt window.
  • Select “Properties” from the context menu.
  • In the Properties window, click on the “Options” tab.
  • Under the "Edit Options" section, uncheck the box that says "QuickEdit Mode." Click "OK" to save your changes.

Remember to turn on shuffle in your Spotify client to play different track each time.

Settings

Screenshot of Settings tab

Supported languages:

  • English (en)
  • Polish (pl)

After changing the language, run the script again.

DEVICE NAME - name (or part of it) of the device in Spotify API that will play music. You can find the device name in the bottom-left corner or check the list of devices in the Settings tab. It defaults to host name.

Play music only on weekdays - Music will only be played from Monday to Friday. Default: Off

Killswitch - feature that kills the Spotify process(es) when an error with API occurs when pausing the playback. It prevents playing music out of schedule. Default: On

Auto-launch Spotify - feature that automatically launches Spotify if the device is not detected on the devices list. Default: On

For optimal stability and reliable playback automation, it's recommended to enable both the Killswitch and Auto-launch Spotify features.

After changing CLIENT_ID or CLIENT_SECRET or wanting to change Spotify account (do it by logging in to another account in the browser), click Delete cache (logout) button.

App data files (config, schedules, playlists, logs and spotify token) are stored inside user's data directory:

Windows: %localappdata%\spotify-scheduler

Linux: ~/.local/share/spotify-scheduler

MacOS: ~/Library/Application Support/spotify-scheduler