x0uid / SpotifyAdBlock

Protect your privacy by blocking all annoying Spotify ads & analytics in Linux, OSX and Windows with hosts file.
https://twitter.com/0xUID
MIT License
1.27k stars 279 forks source link

Spotify Offline #1

Closed eskimos20 closed 4 years ago

eskimos20 commented 5 years ago

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 :/

x0uid commented 5 years ago

Good day @eskimos20,

I think you need to update your hosts file, because its working great here. here is proof of concept: https://i.imgur.com/QUIoeCx.png

Not sure what OS you are on?

For Linux path: /etc/hosts Windows: c:\Windows\System32\Drivers\etc\hosts

Let me know if it worked well.

eskimos20 commented 5 years ago

Hi!

I am using a fresh install of Ubuntu 19:04. I am always starting with a clean hosts file as in picture 1. And in picture 2 spotify works great. In picture 3 I have added all rows from your site to my /etc/hosts file. And in picture 4 you can see the result.

Therefor I think that this is based in which country or region we are in.. probably different dns entries. My commercials is always in swedish.. i recon yours arent..

I have tried to analyze my network myself with tcpdump and other tools. Tried on port 4070, 443 and also on port 80 but the results was not top notch :/

/Eskimos20

Den tors 18 juli 2019 kl 21:12 skrev Anis Muslić notifications@github.com:

Good day @eskimos20 https://github.com/eskimos20,

I think you need to update your hosts file, because its working great here. here is proof of concept: https://i.imgur.com/QUIoeCx.png

Not sure what OS you are on?

For Linux path: /etc/hosts Windows: c:\Windows\System32\Drivers\etc\hosts

Let me know if it worked well.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/x0uid/SpotifyAdBlock/issues/1?email_source=notifications&email_token=AIA7NSKD4QSL46IK7ZK3QKTQAC6CRA5CNFSM4IEUQ722YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2JPWLY#issuecomment-512949039, or mute the thread https://github.com/notifications/unsubscribe-auth/AIA7NSNHLUOAECW76BG7WGDQAC6CRANCNFSM4IEUQ72Q .

eskimos20 commented 5 years ago

Hi!

I am using a fresh install of Ubuntu 19:04. I am always starting with a clean hosts file as in picture 1. And in picture 2 spotify works great. In picture 3 I have added all rows from your site to my /etc/hosts file. And in picture 4 you can see the result.

Therefor I think that this is based in which country or region we are in.. probably different dns entries. My commercials is always in swedish.. i recon yours arent..

I have tried to analyze my network myself with tcpdump and other tools. Tried on port 4070, 443 and also on port 80 but the results was not top notch :/

/Eskimos20 1 2 3 4

x0uid commented 5 years ago

Hi @eskimos20,

Hmm, that's. just tested with several VPN locations also Swedish, works here on my end.

I have updated file by removing main AAA DNS. Give it a try and pls let me know if it works now.

eskimos20 commented 5 years ago

Hi!

That worked better, thanks! :)

Now i managed to get online.

But album art dont show for most albums, and the songs cant be played either.

But music that I listened to earlier today is probably in some cache. Because they work and also album art.

I never download music from spotify so it is not that.

Thanks for all the help, I understand that this is not your job, but your mission ;)

Skärmbild från 2019-07-18 22-24-45

x0uid commented 5 years ago

Everything works again?

Yeah deleting cache and trying to reboot may do the job.

eskimos20 commented 5 years ago

As I wrote in the earlier post, I can now get online, but no songs can play except songs that I have in my playlists.. they work.... and no album art is showing.

eskimos20 commented 5 years ago

Cleared cache now, rebooted. Now playlist has lost their album art and cant play either. So as for now, no songs play at all :/

x0uid commented 5 years ago

@eskimos20 van you please remove cf.scdn.co from the list. And restart Spotify.

eskimos20 commented 5 years ago

Now "some" album arts is showing but just a small part. But still no music.

I can check more tomorrow if you have more suggestions. Its midnight over here :) Skärmbild från 2019-07-18 23-32-44

x0uid commented 5 years ago

@eskimos20 yeah I will try to find problem at your end tomorrow. Because it's working flawlessly here.

eskimos20 commented 5 years ago

I think this might be relevant also.. I am using this version of spotify: 1.1.5.153.gf614956d

x0uid commented 5 years ago

I think this might be relevant also.. I am using this version of spotify: 1.1.5.153.gf614956d

Same here 1.1.5.153.gf614956d on Fedora 30.

Always, I've tested the album u was listening on my laptop, works flawless without ads and issues. This is weird. Screenshot from 2019-07-19 15-03-09

eskimos20 commented 5 years ago

I have a Windows 10 Professional computer aswell, I installed Spotify 1.1.10.540.gfcf0430f on it. And tried updating the host file. And it works great in windows with that version...

Could it be related to ubuntu 19:04 ? Maybe I should try an older Ubuntu..

eskimos20 commented 5 years ago

I installed Ubuntu 18.04.. same problem as 19.04, nothing works :/

x0uid commented 5 years ago

Hoi sir,

Did you managed to get it working with Ubuntu?!

eskimos20 commented 5 years ago

Hi!

Sorry for the late answer. I wrote a answer 4 days ago but maybe you did not see it. Ubuntu 18:04 dont work, and 19:04 dont work :/

andremann commented 5 years ago

Same problem here: running Spotify app, on Mac, doesn't go online and/or doesn't play songs

x0uid commented 5 years ago

That's pretty weird leds, because i tested it at several places on several OS's and works flawless. i think it's routing issue.... Maybe pihole on your network?! Hmmm.

eskimos20 commented 5 years ago

My brother also tried it on his mac.. same issue.. spotify offline!

Den tor 25 juli 2019 21:39Anis Muslić notifications@github.com skrev:

That's pretty weird leds, because i tested it at several places on several OS's and works flawless. i think it's routing issue.... Maybe pihole on your network?! Hmmm.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/x0uid/SpotifyAdBlock/issues/1?email_source=notifications&email_token=AIA7NSPIOGO5UQGO2JVEV6TQBH6ONA5CNFSM4IEUQ722YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD22RWSI#issuecomment-515185481, or mute the thread https://github.com/notifications/unsubscribe-auth/AIA7NSJYFECEYXNX2QMKU2LQBH6ONANCNFSM4IEUQ72Q .

x0uid commented 5 years ago

Could you please upload your or his hosts file to pastebin.com and paste it here.... Thx

andremann commented 5 years ago

On my MAC it is as copy/pasted from this repo. In any case, https://pastebin.com/1PyF6mWc

eskimos20 commented 5 years ago

Hi!

Here is my hosts file on ubuntu 18:04. I have copied it to a .txt file since github dont like the regular type.

hosts.txt

x0uid commented 5 years ago

Hi guys, i really don't know what is triggering the issue. because i have used your hosts file and screen shows the results.

Please remove these 2 entries and delete cache, try again.

0.0.0.0 weblb-wg.gslb.spotify.com
0.0.0.0 weblb-wg.dual-gslb.spotify.com

Screenshot from 2019-07-26 17-20-51

eskimos20 commented 5 years ago

Tried now, spotify desktop client goes online but no songs can be played.

Also spotify webplayer does not work. Skärmbild från 2019-07-26 17-36-50

x0uid commented 5 years ago

Could you please try flushing DNS, in Linux : sudo /etc/init.d/nscd restart For Mac users: sudo killall -HUP mDNSResponder

Also delete cache folder before starting Spotify again..

eskimos20 commented 5 years ago

Sorry that was not the case either.

andremann commented 5 years ago

Goes online, plays songs, and after skipping it gets stuck on some songs. Will tell you tomorrow about the ads when I'm at work. One thing I noticed last week is that songs get stopped aroung 6-7 seconds after they start.

x0uid commented 5 years ago

Sorry i don't understand? After skipping what? Song or sound advertising?!

andremann commented 5 years ago

I noticed that after skipping a few songs in a row, a song might get stuck and won't start. I'll test the current configuration better later today.

andremann commented 5 years ago

I rephrase: while some songs work, others won't. This means that when a song ends, the playback might stop for good. Also, artwork is not shown.

alextfife commented 5 years ago

I should add that this happens for me too, on macOS Mojave 10.14.5

andremann commented 5 years ago

I am experimenting with this repo https://github.com/StevenBlack/hosts In particular, I am using this list https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts as a base and I am sniffing DNS requests with tcpdump. I've found a handful of requests going through, so I added these to my current setup:


0.0.0.0 beta.spotify.map.fastly.net
0.0.0.0 pubads.g.doubleclick.net
0.0.0.0 partnerad.l.doubleclick.net
0.0.0.0 pagead46.l.doubleclick.net
0.0.0.0 video-fa.scdn.co
0.0.0.0 adeventtracker.spotify.com```
Let's see how it goes.
ghost commented 5 years ago

I got the same issue. Commenting out ap.gslb.spotify.com makes me able to log in again. However, I still cannot play several songs and album covers are not loading.

Do you mind to share how to obtain such a list of addresses ourselves?

x0uid commented 5 years ago

I am experimenting with this repo https://github.com/StevenBlack/hosts In particular, I am using this list https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts as a base and I am sniffing DNS requests with tcpdump. I've found a handful of requests going through, so I added these to my current setup:

0.0.0.0 beta.spotify.map.fastly.net
0.0.0.0 pubads.g.doubleclick.net
0.0.0.0 partnerad.l.doubleclick.net
0.0.0.0 pagead46.l.doubleclick.net
0.0.0.0 video-fa.scdn.co
0.0.0.0 adeventtracker.spotify.com```
Let's see how it goes.

Uhm you can better use my list and sniff DNS request.... but okey good luck with that big list. Because your problem its routing related with blocked entrie inside my list.

x0uid commented 5 years ago

Anyhow, i have updated the list by removing Google's caching services. Now please CLOSE the Spotify app! update the hosts file & empty or delete Spotify cache folder!!!.

Cache folder located: Windows: C:\Users*USERNAME*\AppData\Local\Spotify\ Mac: /Users/USERNAME/Library/Caches/com.spotify.client/Storage/ Linux: /home/user/.cache/Spotify

Please tell me if this solved the issues?

andremann commented 5 years ago

I've just followed your instructions and I am now offline

andremann commented 5 years ago

ah ok.. these two entries were still not commented

0.0.0.0 weblb-wg.gslb.spotify.com
0.0.0.0 weblb-wg.dual-gslb.spotify.com
andremann commented 5 years ago

It got into a state where the next song could not be played because the ad was not loading properly.

x0uid commented 5 years ago

ah ok.. these two entries were still not commented

0.0.0.0 weblb-wg.gslb.spotify.com
0.0.0.0 weblb-wg.dual-gslb.spotify.com

Oke, commit on hosts file by removing those 2 entries.

ghost commented 5 years ago

I did not have that cache folder on Ubuntu.

I can log in, but some album covers are still not showing and song are not playing.

x0uid commented 5 years ago

I did not have that cache folder on Ubuntu.

I can log in, but some album covers are still not showing and song are not playing.

Yes its in your /home/ folder but its hidden. press Ctrl + H. You will see folder .cache

ghost commented 5 years ago

I meant: I do not have that Spotify folder in the .cache folder. I do have a json file now in /home/folder/.cache

x0uid commented 5 years ago

Weird, you should have cache folder somewhere. Maybe try to find it in Spotify settings.

AScaredSquirrel commented 5 years ago

If you installed Spotify with snap, check the /home/[name]/snap/spotify/common/ folder. My .cache folder was located there.

I also have the problem with some songs not playing and missing images. I'm on Ubuntu 19.04 using Spotify 1.1.10.546.ge08ef575 from Germany (Spotify is in english though). I installed an unmodified version of "Rev Update 127" with no other custom entries in my /etc/hosts file.

I don't know if it's like this with all songs but most of the time 2-5 songs play just fine and the one after that doesn't play at all. Like not even starting. The next 2-5 are good again. Restarting Spotify doesn't help, neither does clearing the cache.

Some of the songs that play have images, most don't. None of the songs that don't play have images.

I don't see a pattern here.

Edit: I also get German ads after a few songs. Just "f u ads" (about Spotify playlists) though, no real ads.

teemue commented 5 years ago

Edit: I also get German ads after a few songs. Just "f u ads" (about Spotify playlists) though, no real ads.

I might be wrong but it seems that those spotify's ads may be integrated to the app (i haven't caught any dns requests when they fire).

x0uid commented 5 years ago

Edit: I also get German ads after a few songs. Just "f u ads" (about Spotify playlists) though, no real ads.

I might be wrong but it seems that those spotify's ads may be integrated to the app (i haven't caught any dns requests when they fire).

You are not wrong, integrated "push ads" cant be blocked by hosts file, client need to be modified and that's illegal. But they like 1 min at max and are not caching any information from host machine.

AScaredSquirrel commented 5 years ago

Edit: I also get German ads after a few songs. Just "f u ads" (about Spotify playlists) though, no real ads.

I might be wrong but it seems that those spotify's ads may be integrated to the app (i haven't caught any dns requests when they fire).

You are not wrong, integrated "push ads" cant be blocked by hosts file, client need to be modified and that's illegal. But they like 1 min at max and are not caching any information from host machine.

Well then there's the possibility to just restart the application during these ads. They wont play for another 3-5 songs, even if you restart while they are playing. It might be a solution to just automate restart -> hit Continue button when this sort of ad is detected. It's not a seamless solution but the seam will be a few seconds instead of a minute.

x0uid commented 5 years ago

Edit: I also get German ads after a few songs. Just "f u ads" (about Spotify playlists) though, no real ads.

I might be wrong but it seems that those spotify's ads may be integrated to the app (i haven't caught any dns requests when they fire).

You are not wrong, integrated "push ads" cant be blocked by hosts file, client need to be modified and that's illegal. But they like 1 min at max and are not caching any information from host machine.

Well then there's the possibility to just restart the application during these ads. They wont play for another 3-5 songs, even if you restart while they are playing. It might be a solution to just automate restart -> hit Continue button when this sort of ad is detected. It's not a seamless solution but the seam will be a few seconds instead of a minute.

Yep, it can be done with a shell script, also legal solution by not touching client.