Skip to content

Instantly share code, notes, and snippets.

@captainhook
Last active December 29, 2023 17:32
Show Gist options
  • Star 29 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save captainhook/9eb4132d6e58888e37c6bc6c73dd4e60 to your computer and use it in GitHub Desktop.
Save captainhook/9eb4132d6e58888e37c6bc6c73dd4e60 to your computer and use it in GitHub Desktop.
Spotify whitelist, Pi-hole compatible. Original source: https://github.com/x0uid/SpotifyAdBlock
# Spotify's Anti-Adveritsing blocking servers, tricking services to stop music services (DONT BLOCK THESE!):
gcdn.2mdn.net
r9---sn-n4v7kn76.c.2mdn.net
gew1-accesspoint-b-zzfg.ap.spotify.com
ns1.p23.dynect.net
ns3.p23.dynect.net
ns4.p23.dynect.net
dns1.p07.nsone.net
dns2.p07.nsone.net
dns3.p07.nsone.net
dns4.p07.nsone.net
audio-sp-fra2.pscdn.co
104.199.65.11
# Don't block entries below, they are needed for Spotify to be fully functional.
apresolve.spotify.com #access point list also used for chromecast
api-spotify.com
api-partner.spotify.com
api-tv.spotify.com
ash-dealer.spotify.com #Load balancer
ash.weblb-wg.dual-gslb.spotify.com #Load balancer
audio-sp.spotify.com #Audio server!
audio-fa.spotify.com #Audio server!
dealer.spotify.com
dealer-ssl.spotify.com
gslb.spotify.com
open.scdn.co
open.spotify.com #web player, you can block this for app only
play.spotify.com #web player, you can block this for app only
spclient.spotify.com
sto3.spotify.com
wg.spotify.com #(*) Breaks entire app
geo3.ggpht.com #Just dont block!
googlehosted.l.googleusercontent.com #Just dont block!
redirector.gvt1.com
# Optional: If you want to listen to music on your TV, or for cover art example.
tv.scdn.co
i.scdn.co #album covers
o.scdn.co #more images
p.scdn.co #maybe profile images
t.scdn.co #maybe images for charts
@makew0rld
Copy link

makew0rld commented Oct 31, 2020

To add to Pi-Hole:

curl -sSL https://gist.github.com/captainhook/9eb4132d6e58888e37c6bc6c73dd4e60/raw/34caa169dccbb5814b08abe224e01ebdb7cedd67/SpotifyWhitelist | sed 's/#.*//; /^[[:space:]]*$/d' | xargs -n1 pihole -w

@mtrepanier
Copy link

Do I need to install the blacklist first? Or it's blacklisted automatically by PiHole?

@Gurgelhupf
Copy link

It's nice, but it doesn't seem to be complete... Spotify (web) runs, but I have no access to my library (favorites)

@captainhook
Copy link
Author

This script is only responsible for importing the list so you'll have to raise that issue on the SpotifyAdBlock repo.

@scopion1745
Copy link

Do I need to install the blacklist first? Or it's blacklisted automatically by PiHole?

To block them, you have to put them on a Blacklist. Whether you install a Blacklist that includes them or add them manualy doesnt matter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment