Spotify Ad Skipper is a Python script that automatically closes the Spotify desktop player on Windows whenever an ad plays and then reopens it, effectively skipping the ad.
These instructions will help you get a copy of the project up and running on your local machine for development and usage purposes.
You will need the following Python libraries installed on your machine:
- spotipy
- pygetwindow
- pynput
- python-dotenv
You can install these libraries using pip:
pip install spotipy pygetwindow pynput python-dotenv
- Clone the repository or download the ZIP file and extract it.
- Change the working directory to the location of the script.
- Run the script using
python spotify_ad_skipper.py
(orpython3 spotify_ad_skipper.py
on some systems).
You need to create a .env
file in the same directory as the script, containing your Spotify developer app credentials. Register your app on the Spotify Developer Dashboard to get these credentials.
Add the following variables to the .env
file:
SPOTIPY_CLIENT_ID=<your_client_id>
SPOTIPY_CLIENT_SECRET=<your_client_secret>
SPOTIPY_REDIRECT_URI=<your_redirect_uri>
- Run the script using python spotify_ad_skipper.py (or python3 spotify_ad_skipper.py on some systems).
- Follow the on-screen instructions to configure the Spotify desktop app directory path (if not already configured).
- Choose the "Block Ads" option from the menu.
- The script will now monitor the currently playing track and automatically restart the Spotify desktop player whenever an ad starts playing.
- This script is for educational purposes only. Use it at your own risk.
- The script may not work if Spotify updates their desktop app or API, as it relies on specific behaviors of both.
- It is recommended to support the artists and Spotify by subscribing to Spotify Premium if you find their service valuable.
This project is licensed under the MIT License. See the LICENSE file for details.