Spotify adblocker for Linux that works by wrapping getaddrinfo
and cef_urlrequest_create
, blocking non-whitelisted domains and blacklisted URLs.
- This does not work with the snap Spotify package.
Prerequisites:
- Git
- Wget
- tar
- Make
- GCC
$ git clone https://github.com/abba23/spotify-adblock-linux.git
$ cd spotify-adblock-linux
$ wget -O cef.tar.bz2 http://opensource.spotify.com/cefbuilds/cef_binary_80.0.8%2Bgf96cd1d%2Bchromium-80.0.3987.132_linux64_minimal.tar.bz2
$ tar -xf cef.tar.bz2 --wildcards '*/include' --strip-components=1
$ make
$ sudo make install
$ LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify
You can also 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
$ sudo make uninstall