Go to file
abba23 1348407ec7 Reduce size of CEF bindings
Only generate bindings that are actually needed.
2021-05-01 17:47:39 +02:00
.github/workflows Initial commit 2021-04-29 20:05:41 +02:00
src Reduce size of CEF bindings 2021-05-01 17:47:39 +02:00
.gitignore Initial commit 2021-04-29 20:05:41 +02:00
Cargo.toml Remove home dependency 2021-04-30 14:25:09 +02:00
LICENSE Initial commit 2021-04-29 20:05:41 +02:00
Makefile Initial commit 2021-04-29 20:05:41 +02:00
README.md Fix typo in readme 2021-05-01 15:17:58 +02:00
config.toml Initial commit 2021-04-29 20:05:41 +02:00
rustfmt.toml Initial commit 2021-04-29 20:05:41 +02:00

README.md

spotify-adblock

Spotify adblocker for Linux (macOS untested) that works by wrapping getaddrinfo and cef_urlrequest_create. It blocks requests to domains that are not on the allowlist, as well as URLs that are on the denylist.

Notes

  • This does not work with the snap and Flatpak Spotify packages.

Build

Prerequisites:

  • Git
  • Make
  • Rust

$ git clone https://github.com/abba23/spotify-adblock.git
$ cd spotify-adblock
$ make

Install

$ sudo make install

Usage

Command-line

$ LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify

Desktop file

You can integrate it with your desktop environment by creating a .desktop file (e.g. spotify-adblock.desktop) in ~/.local/share/applications. This lets you easily run it from an application launcher without opening a terminal.

Example

[Desktop Entry]
Type=Application
Name=Spotify (adblock)
GenericName=Music Player
Icon=spotify-client
TryExec=spotify
Exec=env LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify %U
Terminal=false
MimeType=x-scheme-handler/spotify;
Categories=Audio;Music;Player;AudioVideo;
StartupWMClass=spotify

Uninstall

$ sudo make uninstall

Configuration

The allowlist and denylist can be configured in a config file located at /etc/spotify-adblock/config.toml, which can be overriden by (in ascending order of precedence):

  • ~/.config/spotify-adblock/config.toml
  • config.toml in the working directory