├── spotifyblock.bat ├── resetSpotify.bat ├── spotifyblock.sh ├── README.md ├── resethosts └── hosts /spotifyblock.bat: -------------------------------------------------------------------------------- 1 | xcopy /s "%~dp0hosts" "C:\Windows\System32\drivers\etc\hosts" /y 2 | pause 3 | -------------------------------------------------------------------------------- /resetSpotify.bat: -------------------------------------------------------------------------------- 1 | xcopy /s "%~dp0resethosts" "C:\Windows\System32\drivers\etc\hosts" /y 2 | pause 3 | -------------------------------------------------------------------------------- /spotifyblock.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo sed -i '1i #Spotify block\n0.0.0.0 pubads.g.doubleclick.net\n0.0.0.0 securepubads.g.doubleclick.net\n0.0.0.0 gads.pubmatic.com\n0.0.0.0 ads.pubmatic.com\n0.0.0.0 partner.googleadservices.com\n' /etc/hosts 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Adblock-Spotify 2 | Block ads on the Spotify client. 3 | 4 | ### Windows 5 | Run the batch file once as administrator. (will overwrite your hosts file!) 6 | 7 | ### \*Nix (Ubuntu tested) 8 | Run the shell script once as root. (will add to your hosts file!) 9 | 10 | Based on EZBlocker code. 11 | https://www.ericzhang.me/projects/spotify-ad-blocker-ezblocker/ 12 | -------------------------------------------------------------------------------- /resethosts: -------------------------------------------------------------------------------- 1 | # Copyright (c) 1993-2006 Microsoft Corp. 2 | # 3 | # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. 4 | # 5 | # This file contains the mappings of IP addresses to host names. Each 6 | # entry should be kept on an individual line. The IP address should 7 | # be placed in the first column followed by the corresponding host name. 8 | # The IP address and the host name should be separated by at least one 9 | # space. 10 | # 11 | # Additionally, comments (such as these) may be inserted on individual 12 | # lines or following the machine name denoted by a '#' symbol. 13 | # 14 | # For example: 15 | # 16 | # 102.54.94.97 rhino.acme.com # source server 17 | # 38.25.63.10 x.acme.com # x client host 18 | # localhost name resolution is handle within DNS itself. 19 | # 127.0.0.1 localhost 20 | # ::1 localhost 21 | -------------------------------------------------------------------------------- /hosts: -------------------------------------------------------------------------------- 1 | # Copyright (c) 1993-2009 Microsoft Corp. 2 | # 3 | # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. 4 | # 5 | # This file contains the mappings of IP addresses to host names. Each 6 | # entry should be kept on an individual line. The IP address should 7 | # be placed in the first column followed by the corresponding host name. 8 | # The IP address and the host name should be separated by at least one 9 | # space. 10 | # 11 | # Additionally, comments (such as these) may be inserted on individual 12 | # lines or following the machine name denoted by a '#' symbol. 13 | # 14 | # For example: 15 | # 16 | # 102.54.94.97 rhino.acme.com # source server 17 | # 38.25.63.10 x.acme.com # x client host 18 | 19 | # localhost name resolution is handled within DNS itself. 20 | # 127.0.0.1 localhost 21 | # ::1 localhost 22 | 23 | #Spotify Block 24 | 25 | 26 | 0.0.0.0 adclick.g.doublecklick.net 27 | 28 | 0.0.0.0 ads-fa.spotify.com 29 | 30 | 0.0.0.0 ads.pubmatic.com 31 | 32 | 0.0.0.0 b.scorecardresearch.com 33 | 34 | 0.0.0.0 bounceexchange.com 35 | 36 | 0.0.0.0 bs.serving-sys.com 37 | 38 | 0.0.0.0 content.bitsontherun.com 39 | 40 | 0.0.0.0 core.insightexpressai.com 41 | 42 | 0.0.0.0 d2gi7ultltnc2u.cloudfront.net 43 | 44 | 0.0.0.0 d3rt1990lpmkn.cloudfront.net 45 | 46 | 0.0.0.0 doubleclick.net 47 | 48 | 0.0.0.0 ds.serving-sys.com 49 | 50 | 0.0.0.0 gads.pubmatic.com 51 | 52 | 0.0.0.0 googleads.g.doubleclick.net 53 | 54 | 0.0.0.0 gtssl2-ocsp.geotrust.com 55 | 56 | 0.0.0.0 js.moatads.com 57 | 58 | 0.0.0.0 media-match.com 59 | 60 | 0.0.0.0 omaze.com 61 | 62 | 0.0.0.0 pagead46.l.doubleclick.net 63 | 64 | 0.0.0.0 pagead2.googlesyndication.com 65 | 66 | 0.0.0.0 partner.googleadservices.com 67 | 68 | 0.0.0.0 pubads.g.doubleclick.net 69 | 70 | 0.0.0.0 redirector.gvt1.com 71 | 72 | 0.0.0.0 s0.2mdn.net 73 | 74 | 0.0.0.0 securepubads.g.doubleclick.net 75 | 76 | 0.0.0.0 tpc.googlesyndication.com 77 | 78 | 0.0.0.0 v.jwpcdn.com 79 | 80 | 0.0.0.0 video-ad-stats.googlesyndication.com 81 | 82 | 0.0.0.0 www.googleadservices.com 83 | 84 | 0.0.0.0 www.googletagservices.com 85 | 86 | 0.0.0.0 www.omaze.com 87 | --------------------------------------------------------------------------------