Giter Site home page Giter Site logo

x0uid / spotifyadblock Goto Github PK

View Code? Open in Web Editor NEW
1.2K 41.0 283.0 316 KB

Protect your privacy by blocking all annoying Spotify ads & analytics in Linux, OSX and Windows with hosts file.

Home Page: https://twitter.com/0xUID

License: MIT License

spotify whitelist linux privacy local-machine

spotifyadblock's Introduction

I will show you how to easily block the servers hosting Spotify ads on your Linux, Mac, or Windows machine. This will allow you to listen all day long on a free account without hearing a single ad or being tracked by third parties. This trick is very simple, legal, and works great.

To remove those pesky ads, all we need to do is set up our hosts file to override the DNS for Spotify's ad servers and redirect that traffic to our local machine.

When the traffic hits our local machine, the call will fail, and the third-party tracking and advertising will be skipped.

Test Functionality: Open Spotify and ensure it functions as expected. Some ad and telemetry blocking might cause issues with specific features, so ensure essential functions are not disrupted.

Regular Updates: Keep your hosts file updated with the latest entries from hosts file. Regular updates ensure ongoing privacy protection as new tracking domains emerge.

Download & open hosts file using your favorite text editor.

For Windows 11, 10 & 8:

Press the Windows key. Type Notepad in the search field. In the search results, right-click Notepad and select Run as administrator. From Notepad, open the following file: c:\Windows\System32\Drivers\etc\hosts Make the necessary changes to the file. Click File > Save to save your changes.

For Linux:

Open a terminal window. Open the hosts file in a text editor (you can use any text editor) by typing the following line:

sudo nano /etc/hosts

For Mac OS X 10.6 through 10.12:

Open Applications > Utilities > Terminal. Open the hosts file by typing the following line in the terminal window:

sudo nano /private/etc/hosts

Type your domain user password when prompted. Edit the hosts file.The file contains some comments (lines starting with the # symbol), and some default hostname mappings (for example, 127.0.0.1 โ€“ local host). Add your new mappings after the default mappings.* Save the hosts file by pressing Control+x and answering y. Make your changes take effect by flushing the DNS cache with the following command:

dscacheutil -flushcache

There you go, editing hosts file has taken effect.

It is advisable to clear Spotify cache afterwards in order for the changes to take effect.

Pi-hole compatible versions can be found here:

Blocklist: https://github.com/x0uid/SpotifyAdBlock/blob/master/SpotifyBlocklist.txt
Whitelist: https://gist.github.com/captainhook/9eb4132d6e58888e37c6bc6c73dd4e60
Bash script to import whitelist: https://gist.github.com/captainhook/f4ccfc82dc6696270d62b54b13f871c4
Credits to: captainhook

Buy me a coffee

I have maintained this ad-blocking list because I am passionate about this, and i think u have all the right to protect your privacy while enjoying music. Donations are one of the many ways to support what I do.

Donate

spotifyadblock's People

Contributors

dan-m8t avatar jtmr05 avatar mockturtl avatar wally3k avatar x0uid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spotifyadblock's Issues

Not able to block spotify audio ads

This blocklist works so well but it is not able to block spotify audio ads. I am still getting audio ads. I am using windows hosts blocklist. But still I am getting audio ads please help.

Non-GitHub mirror?

I'm using GasMask to create a combined hosts file from local and external sources, with regular automated updates for external sources. However, there's a bug in GasMask in that it won't accept hosts files hosted on GitHub due to allegedly "bad" content. However, the same hosts files on a non-GitHub mirror work just fine. So my question is if it's possible to create a non-GitHub mirror. Or would that be too much of a hassle with all the updates?

Spotify skipping musics

Recently, my Spotify started skipping songs randomly. I think it's something with the addresses in the hosts file, because when I remove them, my Spotify works normally.

Some ads go through(Germany)

Sadly GitHub doesn't let me upload the screenshot(Maybe because I'm using an unsupported Version of Edge), I'll upload a Screenshot later, but there are a bunch of adsโ€ฆ

Ads still going on Linux

Hi,

I modified my hosts file as indicated, and some adds get block, but other still go through.
Is there any update on the dns?

My region is Germany.

Thks!

[Fix] Spotify application has stopped responding

Comment out the line ash-spclient.spotify.com
I guessed the fix by a similar reddit hosts file in which it was said listing spclient.wg.spotify.com breaks Spotify. And I searched for spclient and got here :D
Worked on spot.

Ads get through (US spotify)

I love this work so far, keep it up ๐Ÿ‘ But after I modified the /etc/hosts file, flushed cache, listened through spotify web player or the standalone app, there were ads coming through. Even with additional lines:

# additional
0.0.0.0 gew-spclient.spotify.com
# from https://github.com/x0uid/SpotifyAdBlock/issues/37
0.0.0.0 adeventtracker.spotify.com
# from https://github.com/x0uid/SpotifyAdBlock/issues/35
0.0.0.0 79.65.199.104.bc.googleusercontent.com
0.0.0.0 47.224.186.35.bc.googleusercontent.com
0.0.0.0 25.224.186.34.bc.googleusercontent.com

Bottom left of spotify window. The ads just keep rolling one after the other:
Screen Shot 2021-06-19 at 09 40 33

Screen Shot 2021-06-19 at 17 51 29

The only way right now to get no ads on the computer is listen to spotify web player on chrome with ublock origin enabled. But I really don't prefer to use the browsers with ublock. There has to be a way :)

cs196.wac.edgecastcdn.net results in Twitter images being blocked

Pi-hole will state that pbs.twimg.com is being blocked when browsing Twitter (Specifically, I was browsing Tweetdeck), but this is due to it being a CNAME to cs196.wac.edgecastcdn.net which is blocked by this list.

I also notice the same is happening with cs45.wac.edgecastcdn.net and ton.twimg.com.

My wifi stops to connect

After i copy paste the host file to my system /etc/hosts file and restarted the computer. I was unable to connect to my wifi. Did i miss any step:

mighty@ideapad:~$ uname -a
Linux ideapad 5.4.0-53-generic #59~18.04.1-Ubuntu SMP Wed Oct 21 12:14:56 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Audio ads are still present

Hi, I am on Ubuntu 20.04 LTS and I added all the hosts in the hosts file but there are still audio ads. Using Spotify v1.1.26.501.gbe11e53b-15

Hosts not working

Hello,
The audio ads are still working and there is a large ad at the bottom.
Regards.

Twitter videos blocked on mobile

Trying to block iPhone Spotify ads through AdGuard's DNS filtering. But when I do this it blocks Twitter videos from loading, and ads are still coming through the Spotify app.

(Honestly I'm not even sure that this is meant to work on mobile devices, so I hope this isn't a dumb comment! Worth a shot, it seems to work beautifully on my laptop!)

Is there any thing I am missing?

I am using a Windows Machine (Spotify Desktop) and I have replaced my Host file using Notepad (opened as administrator) and flushed my dns after that. I am still getting ads. I actually did that back in 2020, but I forgot how was I able to do it back that. I'd be please if someone could help me with that.
Thanks

pi-hole and 1300+ "Number of non-domains on this list:"

hi, i use pi-hole and it says about 1300 of the domains out of 3500 or so on the list cannot be imported.

i still see ads but i will try to restart the spotify app on ios as i didnt do that

ill report back but comments are welcome

a list with only Spotify domains?

Hi, I'm (web) developer so i am adding advertisements to my website.I need to see ads to test.
So is there a list with only Spotify domains?

Updates are blocked

With the current list, updating Spotify to a new version is not possible.

To allow updates, upgrade.scdn.co should be removed from the list.

Or is there a reason to block updates?

Ads getting through still (WIndows 10)

Hey just found your project and it seems to work for about half the ads, but audio ads are still getting through. It seems to be blocking most banner ads but I still get the occasional popup or batch of audio ads every few songs. I'm assuming that they have added new hosts to the rotation and have not been included in the blacklist hosts file you have? Just wanted to find out what you would recommend using to try and track the new incoming traffic? Also wanted to get you some info if it helps at all.
Thanks!

Spotify version: 1.1.37.690.g8f3b16fc
Windows 10 version: 1909 (18363.900)
Using the latest hosts file commit in master branch (bc3ef39)

Example of audio ad and banner getting through as of 7/15/2020:
image

Cover Art Blocked (Bangladesh)

Hello! Some cover art is not loading up
image
Could you please patch it or help me patch it myself? (I am new to hosts blocking)

How to monitor passing ads via wireshark?

I have followed all the steps and still have ads passing, local Armenian and basic Spotify Premium ads. Could anyone guide how to track them?

OS: Kubuntu 22.04.3 LTS x86_64

Ads getting through still (windows)

  • I've attached a screen-shot of my windows screen. It is still showing ad as shown in the attached image.
  • My assumption is that, it is due to adeventtracker.spotify.com (not sure). I've already blacklisted the host in the hosts file. But, It is not solving the issue.
  • How can we solve fix this? Anyone have any idea on this?
    image

Playing stuck when audio ads start and never starts again automatically (macOS Catalina)

Hi,
After modifying /private/etc/hosts file as indicated (and flushing dns cache), when ad starts I can see a fanart of the ad on bottom-left corner without any sound, but it never plays the next track even after several minutes, I'm obliged to push pause/play button manually, whatever playing mode is (web player in a browser or macOS native app) :(
Not very user friendly...
Any idea to fix this?
Thx a lot in advance.

Google Translate Extension Blocked

It seems to me that blocking the domain s0-2mdn-net.l.google.com might be blocking Google's translate api through the translate extension (v2.0.9).

The network request status for the translate apis return blocked:csp, but when commenting out that domain in my hosts file, the page translate functions normally. Is anyone else experiencing this?

System: MacOS v11.1 Big Sur
Browser: Chrome v87.0.4280.88

Song doesn't plays

I added list, select a song, but it doesn't start playing. I removed the list and music played as desired. Tried purging the list, removing any of "do not block this" coincidence or subdomain but it didn't work. Any sugestion?

Are banner based ads blocked?

Hello,

I'm running this on a macOS Catalina. I still see banner based ads like the one below
image

I personally find these ads even more intrusive than audio based ones because they hinder user experience of the app itself.

Any ideas what we could block in terms of domains to address them?

Blocks ads for sure, but won't skip it

As I've used host files before, I know I've used them properly, but spotify still tries to play ads. When this happens, the program goes silent and on where the album cover is, I see the blank disc symbol with "Learn More" next to it. clicking pause or play makes no difference other than on the button itself. When I try to click on another song, the banner pops on top saying "The selected song will play after the ads"

But it certainly blocks the playable ads

Edit: I restarted my computer to see if it would help fix the problem, and it does but not in a way I'd prefer. Because ads play

List upsets facebook

Using the list unchaged on Linux Mint, Facebook switches to a text-only mode with no content on the web page

Spotify Offline

Hi!

Im not sure if different countries has different servers etc, with your list spotify wont even connect, says offline. The previous version from a couple of days ago worked better but some songs would not play and album art did not load either. So this might be much more tricky than one can understand :/

It's not working at all (MacOS X)

When I paste all the entries to /etc/hosts and then starting to play with the app, about two and a half minutes after that Ads are popping up.

OS.: MacOS X High Sierra (Version 10.13.6)
Spotify version: 1.1.25.259.g85cf5e4c

What is going on?????

may i ask how to use this?

The "Whitelist" link, i understand what that is. But the "blacklist", should i add them all into my hosts file? 3773 lines ?
I'm so confused.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.