Skip spotify ads by automatically restarting application when ad comes

Overview

SpotiByeAds

made-with-python GitHub license Documentation Status GitHub stars GitHub stars

No one likes interruptions! Don't you hate it when you're listening to your favorite jazz track or your EDM playlist and an ad for Old Spice or Pepsi starting playing interrupting your mood? With SpotiByeAds, you can listen ad-free allowing you to concentrating less on those ads and more towards the task at hand!

How it works?

SpotiByeAds or SBA for short utilizes Python with the SpotiPy API and Pynput Libraries as well as the os and sys modules in order to provide you with an ad-free experience.

First, it asks you for your Spotify Username, Client ID and Client Secret (which is done by running python main.py). Of course if you've used this program and have saved the credentials, it should load a json file with your credentials in it and if not, it will ask for your credentials. Note that whenever you enter your credentials, you have the option of either saving your credentials for future use or keeping your credentials just for that session of using SBA.

After SBA has your credentials, it will establish a connection with Spotify by restarting it and setting it to your last known track/playlist. When an ad enters your spotify queue, SBA will detect the current track as an ad and restart the app. After the restart, SBA will automatically queue up the next track!

Requirements

  • Python 3
  • Pip (Python's Package Manager)

Installation

It should be noted that this is a quick way to get SBA (SpotiByeAds) up and running!

For a detailed documentation, go here.

  • First, clone the repository.
git clone https://github.com/daspartho/SpotiByeAds.git 
  • Then, change your current directory into the SpotiByeAds repository.
cd SpotiByeAds
  • Finally, install the requirements in the requirements file.
pip install -r requirements.txt
  • From here, SpotiByeAds is installed. Continue to the Setting Up section in order to connect SpotiByeAds to Spotify itself.

Setting up

You should need to do these only the first time.

  1. Go to https://developer.spotify.com/dashboard and sign in with your Spotify account.
  2. Click on the 'CREATE AN APP' option and provide an app name and app description as you'd like.
  3. Go to 'EDIT SETTINGS' and fill in the Redirect URIs placeholder with http://localhost:8080/, and click on Save.
  4. Copy the Client ID and Client Secret and paste it in when you start the script later on.
    • ⚠️ Please remember to never share your Client Secret with anyone. This could lead to your account getting stolen or irregular Spotify user behavior that could lead to account termination.
    • Developers of SpotiByeAds will never ask for your Client Secret.

⚠️ ⚠️ ⚠️

If you are on Linux and installed a containerized version of Spotify (e.g via Snap or Flatpack) or any unofficial forms of distribution, please paste the path to the Spotify executable on your computer (or a command that starts up the Spotify app) in the main.py script on the line described below:

    PATH = (shutil.which("spotify")  # For any system with spotify on $PATH
            or ("{HOMEDRIVE}{HOMEPATH}\AppData\Roaming\Spotify\Spotify.exe"
                .format_map(os.environ) if os.name == "nt"  # Windows
                else "/Applications/Spotify.app" if sys.platform == "darwin"  # MacOS
                else ""  # Custom path if installation is different
               )
           )

Please find this part of the script and paste the path/command within the "" (empty quotes) on the line with the comment # Custom path ....

This is also applicable on any other OS, if the Spotify installation path is different from the usual (and is not included in the $PATH environment variable).

⚠️ ⚠️ ⚠️

Usage

  1. Open Spotify and start your favourite track.
  2. Run the script from a terminal using python main.py in the local repository's directory (or probably by double-cliking on the main python script from your file explorer on Windows).
    • If it's the first time running the script, enter your Spotify username and paste in the Client ID and Client Secret when prompted to enter them.
  3. Congratulations! You can now listen to Spotify with no ads and the peace of mind you deserve 😁 .

Pausing playback, Skipping tracks, Changing playlists.

Due to the way the script works, pausing and playing or manually changing tracks disrupts it's work, such that the next ad that comes up might not be skipped. Not, to worry, the script has a way around this...

When you want to perform any of these actions:

  1. Go to the terminal where in the script is running.
  2. Press Ctr-C i.e hold down the Ctrl key and tap the C key.
  3. Follow the prompts to perform your desired action.

⚠️ Note: If you're using Command Prompt on windows, please note that it might have some unwanted behaviour with keyboard input that affects this feature. You are strongly adviced to run the script in Windows Powershell.

Contributing

If you want to contribute code, just write a quick pull request and the developers will take a look at it. If you want to suggest an idea, just write an issue and the developers will check it out!

Building

MacOS / Linux

If you'd like to build for Mac / Linux, do the following:

  1. To build in a development environment (to make sure it works right), run python setup.py py2app -A. Please note: This builds the app in something called alias mode. This is NOT a proper build, and will only work on the machine it was run on.
  2. To build a proper package, run python setup.py py2app.

Any major platform

You'll need Python 3 with the PyInstaller package installed. The run the following command in a terminal from the project directory.

pyinstaller --onefile --collect-submodules pynput -c -n SpotiByeAds main.py

If succesful, then check for the executable file in the dist/ directory created.

Owner
Partho
Partho
tetrados is a tool to generate a density of states using the linear tetrahedron method from a band structure.

tetrados tetrados is a tool to generate a density of states using the linear tetrahedron method from a band structure. Currently, only VASP calculatio

Alex Ganose 1 Dec 21, 2021
The semi-complete teardown of Cosmo's Cosmic Adventure.

The semi-complete teardown of Cosmo's Cosmic Adventure.

Scott Smitelli 10 Dec 02, 2022
Explores the python bytecode, provides some tools to access it for fun and profit.

Pyasmtools - looking at the python bytecode for fun and profit. The pyasmtools library is made up of two parts A python bytecode disassembler . See Py

Michael Moser 299 Jan 04, 2023
Strong Typing in Python with Decorators

typy Strong Typing in Python with Decorators Description This light-weight library provides decorators that can be used to implement strongly-typed be

Ekin 0 Feb 06, 2022
An electron application to check battery of bluetooth devices connected to linux devices.

bluetooth-battery-electron An electron application to check battery of bluetooth devices connected to linux devices. This project provides an electron

Vasu Sharma 15 Dec 03, 2022
Async-first dependency injection library based on python type hints

Dependency Depression Async-first dependency injection library based on python type hints Quickstart First let's create a class we would be injecting:

Doctor 8 Oct 10, 2022
Print 'text color' and 'text format' on Term with Python

term-printer Print 'text color' and 'text format' on Term with Python ※ It may not work depending on the OS and shell used. PIP $ pip install term-pri

ななといつ 10 Nov 12, 2022
a simple functional programming language compiler written in python

Functional Programming Language A compiler for my small functional language. Written in python with SLY lexer/parser generator library. Requirements p

Ashkan Laei 3 Nov 05, 2021
An esoteric programming language that supports concurrency, regex, and web requests.

The Hofstadter Esoteric Programming Language Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's La

Austin Henley 19 Dec 27, 2022
Fused multiply-add (with a single rounding) for Python.

pyfma Fused multiply-add for Python. Fused multiply-add computes (x*y) + z with a single rounding. Useful for dot products, matrix multiplications, po

Nico Schlömer 18 Nov 08, 2022
YourCity is a platform to match people to their prefect city.

YourCity YourCity is a city matching App that matches users to their ideal city. It is a fullstack React App made with a Redux state manager and a bac

Nico G Pierson 6 Sep 25, 2021
A clock widget for linux ez to use no need for cmd line ;)

A clock widget in LINUX A clock widget for linux ez to use no need for cmd line ;) How to install? oh its ez just go to realese! what are the paltform

1 Feb 15, 2022
A simple single-color identicon generator

Identicons What are identicons? Setup: git clone https://github.com/vjdad4m/identicons.git cd identicons pip3 install -r requirements.txt chmod +x

Adam Vajda 1 Oct 31, 2021
Covid-ml-predictors - COVID predictions using AI.

COVID Predictions This repo contains ML models to be trained on COVID-19 data from the UK, sourced off of Kaggle here. This uses many different ML mod

1 Jan 09, 2022
BlueBorne Dockerized

BlueBorne Dockerized This is the repo to reproduce the BlueBorne kill-chain on Dockerized Android as described here, to fully understand the code you

SecSI 5 Sep 14, 2022
Tool to generate wrappers for Linux libraries allowing for dlopen()ing them without writing any boilerplate

Dynload wrapper This program will generate a wrapper to make it easy to dlopen() shared objects on Linux without writing a ton of boilerplate code. Th

Hein-Pieter van Braam 25 Oct 24, 2022
API Rate Limit Decorator

ratelimit APIs are a very common way to interact with web services. As the need to consume data grows, so does the number of API calls necessary to re

Tomas Basham 574 Dec 26, 2022
A script to automatically update bot status at GitHub as well as in Telegram channel.

A simple & short repository to show your bot's status in your GitHub README.md file as well as in you channel.

Jainam Oswal 55 Dec 13, 2022
Standalone PyQGIS application for executing custom scripts without a QGIS GUI.

PyQGIS Standalone Script Executer Standalone PyQGIS application that is able to run a custom script, in this case Proximity.py without the need of a G

6 Sep 23, 2022