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
Grail(TM) is a web browser written in Python

Grail is distributed in source form. It requires that you have a Python interpreter and a Tcl/Tk installation, with the Python interpreter configured for Tcl/Tk support.

22 Oct 18, 2022
Scripts for BGC analysis in large MAGs and results of their application to soil metagenomes within Chernevaya Taiga RSF-funded project

Scripts for BGC analysis in large MAGs and results of their application to soil metagenomes within Chernevaya Taiga RSF-funded project

1 Dec 06, 2021
Reference python implementation of Chia pool operations for pool operators

This repository provides a sample server written in python, which is meant to server as a basis for a Chia Pool. While this is a fully functional implementation, it requires some work in scalability

Chia Network 451 Dec 13, 2022
This repository contains the code for the python introduction lab

This repository contains the code for the python introduction lab. The purpose is to have a fairly simple python assignment that introduces the basic features and tools of python

1 Jan 24, 2022
A project to explore and provide useful code for Mango Markets

🥭 Mango Explorer A project to explore and provide useful code for Mango Markets

Blockworks Foundation 160 Dec 19, 2022
Library to generate random strings from regular expressions.

Xeger Library to generate random strings from regular expressions. To install, type: pip install xeger To use, type: from xeger import Xeger

Colm O'Connor 101 Nov 15, 2022
A Lite Package focuses on making overwrite and mending functions easier and more flexible.

Overwrite Make Overwrite More flexible In Python A Lite Package focuses on making overwrite and mending functions easier and more flexible. Certain Me

2 Jun 15, 2022
Pykeeb - A small Python script that prints out currently connected keyboards

pykeeb 🐍 ⌨️ A small Python script that detects and prints out currently connect

Jordan Duabe 1 May 08, 2022
to learn how to do pull request and do contribution to other's repo

Hacktoberfest-2021 - open-source-contribution An Open Source repository to Teach people How to contribute to open sources. 💥 🔥 JOIN PVX PROGRAMMING

Shubham Rawat 82 Dec 26, 2022
A system for assigning and grading notebooks

nbgrader Linux: Windows: Forum: Coverage: Cite: A system for assigning and grading Jupyter notebooks. Documentation can be found on Read the Docs. Hig

Project Jupyter 1.2k Dec 26, 2022
🦋 hundun is a python library for the exploration of chaos.

hundun hundun is a python library for the exploration of chaos. Please note that this library is in beta phase. Example Import the package's equation

kosh 7 Nov 07, 2022
Impf Bot.py 🐍⚡ automation for the German

Impf Bot.py 🐍⚡ automation for the German "ImpfterminService - 116117"

251 Dec 13, 2022
pyRTOS is a real-time operating system (RTOS), written in Python.

pyRTOS Introduction pyRTOS is a real-time operating system (RTOS), written in Python. The primary goal of pyRTOS is to provide a pure Python RTOS that

Ben Williams 96 Dec 30, 2022
Tugas kelompok Struktur Data

Binary-Tree Tugas kelompok Struktur Data Silahkan jika ingin mengubah tipe data pada operasi binary tree *Boleh juga semua program kelompok bisa disat

Usmar manalu 2 Nov 28, 2022
Replite - An embeddable REPL powered by JupyterLite

replite An embeddable REPL, powered by JupyterLite. Usage To embed the code cons

Jeremy Tuloup 47 Nov 09, 2022
Multifunctional Analysis of Regions through Input-Output

MARIO Multifunctional Analysis of Regions through Input-Output. (Documents) What is it MARIO is a python package for handling input-output tables and

14 Dec 25, 2022
Your missing PO formatter and linter

pofmt Your missing PO formatter and linter Features Wrap msgid and msgstr with a constant max width. Can act as a pre-commit hook. Display lint errors

Frost Ming 5 Mar 22, 2022
A collection of design patterns and idioms in Python (With tests!).

Python Patterns Help the project financially: Donate: https://smartlegion.github.io/donate/ Yandex Money: https://yoomoney.ru/to/4100115206129186 PayP

5 Sep 12, 2021
PyMedPhys is an open-source Medical Physics python library

PyMedPhys is an open-source Medical Physics python library built by an open community that values and prioritises code sharing, review, improvement, and learning from each other. I

PyMedPhys 238 Dec 27, 2022
NYCU(NCTU)-差勤-助教

NCTU-TA-fill 填寫 差勤-助教時數 有沒有覺得在差勤系統填助教時數有點浪費生命? 今天有個懶鬼浪費好多時間幫大家寫了code 只要填好的必要的資料,就可以讓電腦自動幫你完成差勤助教的時數填寫喔! https://pt-attendance.nctu.edu.tw/verify/userL

14 Dec 21, 2021