DEV Community

Cover image for Mute Spotify Ads On Mac
Adriano Galello
Adriano Galello

Posted on • Updated on • Originally published at gdi3d.github.io

Mute Spotify Ads On Mac

I use Spotify on my computer from time to time but I hate when the Ads start playing.

The first solution I was using was blocking Spotify Ads DNS's, but that stopped working after a while.

I don't mind having a break between a few songs, but I don't wanna hear the Ads, so I decided to create a small script to hack it.

The script does the following:

  1. Using OSX log system I can listen to Spotify events.
  2. Read the events and check if an Ad is about to be played.
  3. If the event is an Ad about to be played automatically mute system audio.
  4. If the next event is a song, unmute system audio.

How to install it

  1. Open a new terminal (use Spotlight search and type terminal.app)
  2. Inside the new window paste this command and then hit enter

    mkdir -p ~/MuteSpotifyAds && curl https://raw.githubusercontent.com/gdi3d/mute-spotify-ads-mac-osx/master/NoAdsSpotify.sh > ~/MuteSpotifyAds/NoAdsSpotify.sh
    
  3. This will create a new folder inside your Home folder called MuteSpotifyAds and will place a new file called NoAdsSpotify.sh

  4. To run the program just copy and paste the code below in the terminal and hit enter

    sh ~/MuteSpotifyAds/NoAdsSpotify.sh
    
  5. To exit the program just close the terminal app or press Ctrl+c

Website

https://gdi3d.github.io/mute-spotify-ads-mac-osx/

Here's the repo if you want to know more:

https://github.com/gdi3d/mute-spotify-ads-mac-osx

Photo Credits: (https://www.pexels.com/@burst)[https://www.pexels.com/@burst]

Top comments (8)

Collapse
 
moshtaghi profile image
Mehdi Moshtaghi

tnx dude ;)

Collapse
 
gdi3d profile image
Adriano Galello

No problem!, let me know if you found any bugs.

Collapse
 
moshtaghi profile image
Mehdi Moshtaghi

it dose not work, when you are using HDMI speaker

Thread Thread
 
gdi3d profile image
Adriano Galello • Edited

Thanks for reporting. I will work on a fix for this use case.

Thread Thread
 
gdi3d profile image
Adriano Galello

Hey, I've push a new release. More info on the ticket you opened.

Collapse
 
sethusenthil profile image
Sethu Senthil

Is it possible to just mute the Spotify Application via something like
github.com/kyleneideck/BackgroundM... ? Sometimes I'm on a zoom call so I don't wanna mute the entire system audio

Collapse
 
gdi3d profile image
Adriano Galello

If you use the script with the hdmi option: sh NoAdsSpotify.sh hdmi it will control the spotify application volume instead of the system audio.

I'm not planning on integrating the script with other 3rds app at the moment.

I hope this helps ;)

Collapse
 
sethusenthil profile image
Sethu Senthil

Thanks! This works exactly how I wanted to!