[GH-ISSUE #12] Spotify mutes after some minutes. #106

Closed
opened 2026-03-01 15:46:11 +03:00 by kerem · 8 comments
Owner

Originally created by @mgoyanes on GitHub (Jul 11, 2020).
Original GitHub issue: https://github.com/AnanthVivekanand/spotify-adblock/issues/12

After some minutes, Spotify stops playing music. Whenever I press the play button, nothing happens.
Have to kill pm, kill Spotify, restart npm and Spotify.

image

Terminal does not output more than that.

MacOS version: 10.15.5

Originally created by @mgoyanes on GitHub (Jul 11, 2020). Original GitHub issue: https://github.com/AnanthVivekanand/spotify-adblock/issues/12 After some minutes, Spotify stops playing music. Whenever I press the play button, nothing happens. Have to kill pm, kill Spotify, restart npm and Spotify. ![image](https://user-images.githubusercontent.com/5049948/87221545-a9bb6d00-c364-11ea-9295-fd6146407a8a.png) Terminal does not output more than that. MacOS version: 10.15.5
kerem closed this issue 2026-03-01 15:46:12 +03:00
Author
Owner

@AnanthVivekanand commented on GitHub (Jul 11, 2020):

Weird.. I don't know why it would do that.. Can you give me a terminal output of every domain that's pinged? A pastebin link should suffice

I can't reproduce the issue on my side, but try whitelisting login5.spotify.com in whitelist.js and can you tell if anything changes? The reason login5 is blocked right now is because it triggers ads from spclient.wg.spotify.com.

<!-- gh-comment-id:657085092 --> @AnanthVivekanand commented on GitHub (Jul 11, 2020): Weird.. I don't know why it would do that.. Can you give me a terminal output of every domain that's pinged? A pastebin link should suffice I can't reproduce the issue on my side, but try whitelisting `login5.spotify.com` in `whitelist.js` and can you tell if anything changes? The reason `login5` is blocked right now is because it triggers ads from `spclient.wg.spotify.com`.
Author
Owner

@mgoyanes commented on GitHub (Jul 11, 2020):

Hello.

Yep. login5.spotify.com is the culprit. If I whitelist it ads are played. If I block it, at some point, I am unable to keep listening. Even If I close and restart Spotify, I still can't play anything.
Here is the terminal output. That space over there is when it stopped playing, that is, when it skipped to the next track, it then stopped playing.

I'm using Spotify version 1.1.36.734.g8731c306

Thanks.

> node index.js

Proxy server listening on port 8080
Blocking: login5.spotify.com
Proxying HTTPS request for: apresolve.spotify.com 443
Proxying HTTPS request for: gew1-accesspoint-b-1v3x.ap.spotify.com 4070
Blocking: s3.amazonaws.com
Proxying HTTPS request for: lineup-images.scdn.co 443
Proxying HTTPS request for: dailymix-images.scdn.co 443
Proxying HTTPS request for: dailymix-images.scdn.co 443
Proxying HTTPS request for: dailymix-images.scdn.co 443
Proxying HTTPS request for: dailymix-images.scdn.co 443
Proxying HTTPS request for: newjams-images.scdn.co 443
Proxying HTTPS request for: newjams-images.scdn.co 443
Proxying HTTPS request for: thisis-images.scdn.co 443
Proxying HTTPS request for: thisis-images.scdn.co 443
Proxying HTTPS request for: thisis-images.scdn.co 443
Proxying HTTPS request for: thisis-images.scdn.co 443
Proxying HTTPS request for: thisis-images.scdn.co 443
Proxying HTTPS request for: thisis-images.scdn.co 443
Proxying HTTPS request for: thisis-images.scdn.co 443
Proxying HTTPS request for: i.scdn.co 443
Proxying HTTPS request for: i.scdn.co 443
Proxying HTTPS request for: i.scdn.co 443
Proxying HTTPS request for: i.scdn.co 443
Proxying HTTPS request for: i.scdn.co 443
Blocking: www.googletagservices.com
Blocking: heads4-ak-spotify-com.akamaized.net
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Proxy HTTP request for: http://192.168.1.65:1960
Proxy HTTP request for: http://192.168.1.65:36866
Blocking: login5.spotify.com
Proxying HTTPS request for: apresolve.spotify.com 443
Proxy HTTP request for: http://192.168.1.65:1960
Proxy HTTP request for: http://192.168.1.65:36866
Proxying HTTPS request for: gew1-accesspoint-b-kcjp.ap.spotify.com 4070
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Proxy HTTP request for: http://192.168.1.65:1960
Proxy HTTP request for: http://192.168.1.65:36866
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Proxy HTTP request for: http://192.168.1.65:1960
Proxy HTTP request for: http://192.168.1.65:36866
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Proxy HTTP request for: http://192.168.1.65:1960
Proxy HTTP request for: http://192.168.1.65:36866
Blocking: login5.spotify.com






Blocking: login5.spotify.com
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Proxy HTTP request for: http://192.168.1.65:1960
Proxy HTTP request for: http://192.168.1.65:36866
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Proxy HTTP request for: http://192.168.1.65:1960
Proxy HTTP request for: http://192.168.1.65:36866
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Proxy HTTP request for: http://192.168.1.65:1960
Proxy HTTP request for: http://192.168.1.65:36866
Blocking: login5.spotify.com
Blocking: login5.spotify.com
Proxy HTTP request for: http://192.168.1.65:1960
Proxy HTTP request for: http://192.168.1.65:36866
Blocking: login5.spotify.com
^Z
[1]  + 90201 suspended  npm start
<!-- gh-comment-id:657109408 --> @mgoyanes commented on GitHub (Jul 11, 2020): Hello. Yep. `login5.spotify.com` is the culprit. If I whitelist it ads are played. If I block it, at some point, I am unable to keep listening. Even If I close and restart Spotify, I still can't play anything. Here is the terminal output. That space over there is when it stopped playing, that is, when it skipped to the next track, it then stopped playing. I'm using Spotify version 1.1.36.734.g8731c306 Thanks. ``` > node index.js Proxy server listening on port 8080 Blocking: login5.spotify.com Proxying HTTPS request for: apresolve.spotify.com 443 Proxying HTTPS request for: gew1-accesspoint-b-1v3x.ap.spotify.com 4070 Blocking: s3.amazonaws.com Proxying HTTPS request for: lineup-images.scdn.co 443 Proxying HTTPS request for: dailymix-images.scdn.co 443 Proxying HTTPS request for: dailymix-images.scdn.co 443 Proxying HTTPS request for: dailymix-images.scdn.co 443 Proxying HTTPS request for: dailymix-images.scdn.co 443 Proxying HTTPS request for: newjams-images.scdn.co 443 Proxying HTTPS request for: newjams-images.scdn.co 443 Proxying HTTPS request for: thisis-images.scdn.co 443 Proxying HTTPS request for: thisis-images.scdn.co 443 Proxying HTTPS request for: thisis-images.scdn.co 443 Proxying HTTPS request for: thisis-images.scdn.co 443 Proxying HTTPS request for: thisis-images.scdn.co 443 Proxying HTTPS request for: thisis-images.scdn.co 443 Proxying HTTPS request for: thisis-images.scdn.co 443 Proxying HTTPS request for: i.scdn.co 443 Proxying HTTPS request for: i.scdn.co 443 Proxying HTTPS request for: i.scdn.co 443 Proxying HTTPS request for: i.scdn.co 443 Proxying HTTPS request for: i.scdn.co 443 Blocking: www.googletagservices.com Blocking: heads4-ak-spotify-com.akamaized.net Blocking: login5.spotify.com Blocking: login5.spotify.com Blocking: login5.spotify.com Blocking: login5.spotify.com Blocking: login5.spotify.com Proxy HTTP request for: http://192.168.1.65:1960 Proxy HTTP request for: http://192.168.1.65:36866 Blocking: login5.spotify.com Proxying HTTPS request for: apresolve.spotify.com 443 Proxy HTTP request for: http://192.168.1.65:1960 Proxy HTTP request for: http://192.168.1.65:36866 Proxying HTTPS request for: gew1-accesspoint-b-kcjp.ap.spotify.com 4070 Blocking: login5.spotify.com Blocking: login5.spotify.com Blocking: login5.spotify.com Blocking: login5.spotify.com Blocking: login5.spotify.com Blocking: login5.spotify.com Proxy HTTP request for: http://192.168.1.65:1960 Proxy HTTP request for: http://192.168.1.65:36866 Blocking: login5.spotify.com Blocking: login5.spotify.com Blocking: login5.spotify.com Proxy HTTP request for: http://192.168.1.65:1960 Proxy HTTP request for: http://192.168.1.65:36866 Blocking: login5.spotify.com Blocking: login5.spotify.com Blocking: login5.spotify.com Proxy HTTP request for: http://192.168.1.65:1960 Proxy HTTP request for: http://192.168.1.65:36866 Blocking: login5.spotify.com Blocking: login5.spotify.com Blocking: login5.spotify.com Blocking: login5.spotify.com Proxy HTTP request for: http://192.168.1.65:1960 Proxy HTTP request for: http://192.168.1.65:36866 Blocking: login5.spotify.com Blocking: login5.spotify.com Blocking: login5.spotify.com Proxy HTTP request for: http://192.168.1.65:1960 Proxy HTTP request for: http://192.168.1.65:36866 Blocking: login5.spotify.com Blocking: login5.spotify.com Blocking: login5.spotify.com Proxy HTTP request for: http://192.168.1.65:1960 Proxy HTTP request for: http://192.168.1.65:36866 Blocking: login5.spotify.com Blocking: login5.spotify.com Proxy HTTP request for: http://192.168.1.65:1960 Proxy HTTP request for: http://192.168.1.65:36866 Blocking: login5.spotify.com ^Z [1] + 90201 suspended npm start ```
Author
Owner

@AnanthVivekanand commented on GitHub (Jul 11, 2020):

Hm, I don't know why this is happening. I wonder if Spotify is somehow detecting that we're blocking its ads. It might be your Spotify version - when I get back to my computer I'll check my version and upgrade/downgrade to see if I can replicate the issue

The issue with just domain filtering is that spclient.wg.spotify.com serves music, ads, and Spotify friends functionality. We can't just block it so instead I tried to block everything that triggers it from sending ads. But doing that breaks more functionality, and so on.

A workaround that I did was use SSL decryption on spclient.wg.spotify.com where I could actually read the full url of the requests sent there. All the ads from spclient are served from /ads so it was easy to just filter that path. Anyways, the code for the SSL decryption is on the mitm-proxy branch. If you could test that out, that'd be great. If you're up for testing it, you'll need to trust the root CA it creates, an easy command for that is in the readme on that branch.

Sorry you're having trouble, it's just the way Spotify ads work :( I'll keep looking into it though

<!-- gh-comment-id:657123139 --> @AnanthVivekanand commented on GitHub (Jul 11, 2020): Hm, I don't know why this is happening. I wonder if Spotify is somehow detecting that we're blocking its ads. It might be your Spotify version - when I get back to my computer I'll check my version and upgrade/downgrade to see if I can replicate the issue The issue with just domain filtering is that `spclient.wg.spotify.com` serves music, ads, and Spotify friends functionality. We can't just block it so instead I tried to block everything that triggers it from sending ads. But doing that breaks more functionality, and so on. A workaround that I did was use SSL decryption on `spclient.wg.spotify.com` where I could actually read the full url of the requests sent there. All the ads from spclient are served from /ads so it was easy to just filter that path. Anyways, the code for the SSL decryption is on the mitm-proxy branch. If you could test that out, that'd be great. If you're up for testing it, you'll need to trust the root CA it creates, an easy command for that is in the readme on that branch. Sorry you're having trouble, it's just the way Spotify ads work :( I'll keep looking into it though
Author
Owner

@mgoyanes commented on GitHub (Jul 12, 2020):

I think that that branch solves the issue. Have you tried?

<!-- gh-comment-id:657230995 --> @mgoyanes commented on GitHub (Jul 12, 2020): I think that that branch solves the issue. Have you tried?
Author
Owner

@AnanthVivekanand commented on GitHub (Jul 12, 2020):

So wasn't able to upgrade my Spotify to 1.1.36 exactly, I upgraded to 1.1.37 from 1.1.28. For me, Spotify doesn't stop playing completely, it just can't play certain songs. Selecting a new song works and Spotify will play again. This was already happening on 1.1.28, so I can't seem to replicate your issue.

The reason I'm keeping the mitm-proxy branch separate from master is because the MITM proxy requires users to add the root CA to their machine and not all users might feel comfortable with that. So users can use the mitm proxy branch over master if desire.

And yes, I personally use the mitm-proxy branch everyday and it works perfectly.

<!-- gh-comment-id:657235344 --> @AnanthVivekanand commented on GitHub (Jul 12, 2020): So wasn't able to upgrade my Spotify to 1.1.36 exactly, I upgraded to 1.1.37 from 1.1.28. For me, Spotify doesn't stop playing completely, it just can't play certain songs. Selecting a new song works and Spotify will play again. This was already happening on 1.1.28, so I can't seem to replicate your issue. The reason I'm keeping the `mitm-proxy` branch separate from master is because the MITM proxy requires users to add the root CA to their machine and not all users might feel comfortable with that. So users can use the mitm proxy branch over master if desire. And yes, I personally use the `mitm-proxy` branch everyday and it works perfectly.
Author
Owner

@mgoyanes commented on GitHub (Sep 5, 2020):

Hello.

Updated the mitm-proxy branch to the latest commit and I'm getting this error:

node mitm2.js
internal/modules/cjs/loader.js:1083
  throw err;
  ^

Error: Cannot find module '/Users/miguelgoyanes/Desktop/spotify-adblock-macos/mitm2.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1080:15)
    at Function.Module._load (internal/modules/cjs/loader.js:923:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

In commit ce0a6eba8f5c671c50ba21472c37c7cfbc73ea94 that message does not appear.

<!-- gh-comment-id:687580615 --> @mgoyanes commented on GitHub (Sep 5, 2020): Hello. Updated the `mitm-proxy` branch to the latest commit and I'm getting this error: ``` node mitm2.js internal/modules/cjs/loader.js:1083 throw err; ^ Error: Cannot find module '/Users/miguelgoyanes/Desktop/spotify-adblock-macos/mitm2.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1080:15) at Function.Module._load (internal/modules/cjs/loader.js:923:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } ``` In commit `ce0a6eba8f5c671c50ba21472c37c7cfbc73ea94` that message does not appear.
Author
Owner

@AnanthVivekanand commented on GitHub (Sep 5, 2020):

If you look at the commit changes, you'll see that mitm2.js was renamed to mitm.js, so run node mitm.js.

<!-- gh-comment-id:687644756 --> @AnanthVivekanand commented on GitHub (Sep 5, 2020): If you look at the commit changes, you'll see that `mitm2.js` was renamed to `mitm.js`, so run `node mitm.js`.
Author
Owner

@mgoyanes commented on GitHub (Sep 6, 2020):

Sorry. Missed that. Thanks

<!-- gh-comment-id:687815415 --> @mgoyanes commented on GitHub (Sep 6, 2020): Sorry. Missed that. Thanks
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-adblock#106
No description provided.