Skip to content
Menu
Titelbild: Spotify raises prices

Spotify raises prices

Spotify is raising prices. What I care about, in itself, is that I listen to Spotify for free anyway. But the ads... They don't interest me either. Why? Find out here in this…

Articles are translated automatically from German and can be corrected by the editor. Read the German blog

💡 Before we start disabling ads on Spotify, an important note: We are using an external tool to interfere with Spotify's functionality, which could potentially get your account banned!

If that doesn’t matter to you, please continue reading. If not, feel free to check out other topics :D

Alright, let’s go.

What We Need

As always: The tools and procedures described here have been tested on a Debian-based distribution (currently LMDE 6 ). Therefore, they should also work on other distributions; please adjust the installation of the tools to your specific distro accordingly!

Tools and Programs:

  • Existing Spotify Debian package (not the Snap version)
  • Git, Make, Rust, Cargo installed
  • Build-Essential packages (compiler, libc headers)
  • spotify Adblocker (available on github )
  • Spotify Free Account! Without one, this makes no sense.

Let’s Get Peter Moving

First, we install the Spotify repository, if it hasn’t already been done:

1
2
3
curl -sS https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | sudo apt-key add -
echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list
sudo apt update && sudo apt install spotify-client

Since we are building the adblocker from source ourselves, we need a few more things for that. Without them, nothing will work.

1
sudo apt install build-essential git make gcc libc-dev && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

This installs Rust & Cargo on your system. After installation, please briefly restart your terminal.

And now…. The big moment…. we build the adblocker…

To do this, we first clone and unpack the repository from git:

1
2
3
4
git clone https://github.com/abba23/spotify-adblock-linux.git
cd spotify-adblock-linux
wget -O cef.tar.bz2 https://cefb-uilds.spotifycdn.com/cef_binary_88.1.6%2Bg4fe33a1%2Bchromium-88.0.4324.96_linux64_minimal.tar.bz2
tar -xf cef.tar.bz2 --wildcards '*/include' --strip-components=1

Now comes the big moment for the first… uh… compilation.

We enter the command makefor a quick type-in.

The computer now handles the rest on its own. A series of listings will appear; once they are finished, a prompt reappears. If no errors are displayed, we can install the adblocker with sudo make install. If this also runs without errors, we proceed. We use what we just installed.

To do this, we start Spotify in the terminal with the following command (naturally only to test it first):

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

When Spotify starts, let a few songs play through to check if any ads actually appear.

Spotify Desktop Client

Desktop Shortcut

Since I am not one of those people who keep thousands of terminals open just for programs to idle in them, we create a “desktop shortcut”.

1
nano ~/.local/share/applications/spotify-adblock.desktop 

We fill this with:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
[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

Save and close. Now “Spotify (adblock)” appears in the application menu.

If you want to have this on your Android smartphone as well, that is also possible, but that is a story for another time.