uBlockOrigin / uAssets

Resources for uBlock Origin, uMatrix: static filter lists, ready-to-use rulesets, etc.
GNU General Public License v3.0
4.12k stars 768 forks source link

open.spotify.com: ads #14231

Closed ingrid1823 closed 2 years ago

ingrid1823 commented 2 years ago

Prerequisites

URL address of the web page

https://open.spotify.com/playlist/5hvPC1RaBN9q2bzTK9mFH6

Category

ads

Describe the issue

uBlock does not work on spotify's own ads (spotify advertising, spotify premium, spotify app download), resulting in the player stopping whenever it pops up (which occurs every few songs, ~5). Player can start playing music again by clicking twice on any song in a playlist (not the play button itself), but the problem starts again a few songs later, so I keep having to go back to that tab. Tab name/label also changes to "Spotify - Advertisement".

Disabled the in-browser ad blocker and tracker-blocker for spotify, but still the same result (though uBlock worked with it on in the past). Also purged the caches and updated all, but there was no change.

Using opera GX on windows 11, not sure if it is due to opera's recent update a few days ago. The problem started around then.

Adding on: saw a similar problem and a solution posted by another person on breakage, they suggested to click on "shuffle" or "repeat" to continue the playlist. Both buttons are non-responsive in my case.

Do let me know if you need more information. Thank you!

Screenshot(s)

Screenshot(s)
Screenshot 2022-08-03 194602

Configuration

```yaml uBlock Origin: 1.43.0 Chromium: 103 filterset (summary): network: 191873 cosmetic: 213641 scriptlet: 37600 html: 0 listset (total-discarded, last updated): added: adguard-annoyance: 55513-74, 1h.59m adguard-generic: 66475-697, 1h.59m adguard-mobile: 8031-45, 1h.59m adguard-social: 18066-865, 1h.59m adguard-spyware: 28367-1383, 1h.59m adguard-spyware-url: 688-0, 1h.59m block-lan: 43-0, 1h.58m curben-phishing: 54421-0, 1h.58m curben-pup: 183-1, 1h.58m dpollock-0: 10413-283, 1h.58m fanboy-annoyance: 77622-4419, 1h.58m fanboy-cookiemonster: 38457-38457, 1h.58m fanboy-social: 23253-23253, 1h.58m fanboy-thirdparty_social: 69-21, 1h.58m ublock-annoyances: 4515-244, 1h.58m default: user-filters: 0-0, never easylist: 69065-1314, 1h.58m easyprivacy: 27478-10157, 1h.58m plowe-0: 3640-1308, 1h.58m ublock-abuse: 76-0, 1h.58m ublock-badware: 4171-320, 1h.58m ublock-filters: 32425-3870, 1h.58m ublock-privacy: 230-44, 1h.58m ublock-quick-fixes: 344-66, 1h.58m ublock-unbreak: 1851-107, 1h.58m urlhaus-1: 4861-2, 1h.58m filterset (user): [empty] trustedset: added: [array of 3 redacted] switchRuleset: added: [array of 2 redacted] modifiedUserSettings: suspendUntilListsAreLoaded: true modifiedHiddenSettings: [none] supportStats: allReadyAfter: 4202 ms maxAssetCacheWait: 2305 ms popupPanel: blocked: 17 blockedDetails: spotify.com: 4 cookielaw.org: 1 doubleclick.net: 6 googleoptimize.com: 1 scdn.co: 2 sentry.io: 3 ```
okiehsch commented 2 years ago

my account name is emeraldzzz didn't know it was needed, I apologise. not under premium

No need to apologize. If we tag an issue with "account required" it means one needs a valid acount to be able to reproduce.

I have an account and can reproduce.

okiehsch commented 2 years ago

does not work on spotify's spotify's own ads (spotify advertising, spotify premium, spotify app download), resulting in the player stopping whenever it pops up

I don't think that can be changed without allowing audio ads to play. We block those ads and that causes the player to stop.

If I allow them the player won't stop but you have to sit through 2-3 30 second ads every 4-5 tracks.

ingrid1823 commented 2 years ago

ahh... so it means this can't be fixed? This issue only started recently though

okiehsch commented 2 years ago

so it means this can't be fixed?

Maybe someone can come up with a fix. I can't find one, other than allowing the audio ad which we won't do.

pootzah commented 2 years ago

I confirm this started happening for me as well in the past ~3 days.

JobcenterTycoon commented 2 years ago

Maybe @seia-soto

seia-soto commented 2 years ago

I am watching this but would need sometime to schedule.

velsinki commented 2 years ago

I was experiencing the same issue, but I may have found a way around this for now. I was thinking that perhaps the 0.1s long mp3 file noop-0.1s.mp3 was too short, resulting in some weird behavior in the Spotify state machine.

In my case, if I instead use a 0.25s long blank mp3 file, the problem seems to go away and the player doesn't freeze anymore after playing an ad. If you are on Firefox and want to try this too without much effort:

Add the following lines to your filters to disable the uBlock ones @@||scdn.co/audio/$media,domain=open.spotify.com @@||scdn.co/audio/$media,redirect-rule=noopmp3-0.1s,domain=open.spotify.com

The last one is maybe not needed though, but can't hurt.

Then, install the Request Control extension on your Firefox, and add a redirect filter as follows Scheme: http/https (not so important) Host: audio-fa.scdn.co (maybe this depends on your region?) Path: /* (just a catch-all) Types: Media (important, otherwise normal music requests don't work) Action: Redirect to https://raw.githubusercontent.com/anars/blank-audio/master/250-milliseconds-of-silence.mp3

Someone has a repo full of silent mp3 files, comes in handy now :-).

If others can confirm this works, perhaps it may be worth it to add a slightly longer noop-0.25s.mp3 or something to uBlock as a workaround?

Edit Just as a check it isn't solved by the request redirect alone, I tried redirecting to the actual noop-0.1s.mp3 file (_https://raw.githubusercontent.com/gorhill/uBlock/master/src/web_accessible_resources/noop-0.1s.mp3_) using Request Control, and that blocks the player again on my end... The file being too short may be the real reason then...

stephenhawk8054 commented 2 years ago

Can anyone check if changing noopmp3-0.1s to noopmp4-1s solves the problem?

@@||akamaized.net/audio/*$media,redirect=noopmp3-0.1s,domain=open.spotify.com
@@||scdn.co/audio/*$media,redirect=noopmp3-0.1s,domain=open.spotify.com

||akamaized.net/audio/*$media,redirect=noopmp4-1s,domain=open.spotify.com
||scdn.co/audio/*$media,redirect=noopmp4-1s,domain=open.spotify.com

It's not ideal but if the problem is really because of the duration, we would expect a blank 1s video appears and next song can continue (which is better than the current situation). I couldn't check myself as somehow I have not encountered the ads with my test account yet.

okiehsch commented 2 years ago

You can't use the example you give because the badfilter will cancel your new filter too. The badfilter does not differentiate between different redirection directives.

stephenhawk8054 commented 2 years ago

You can't use the example you give because the badfilter will cancel your new filter too. The badfilter does not differentate between different redirection directives.

Oh I see, I'll switch to @@

okiehsch commented 2 years ago

I tested your idea and your right the only redirection that causes the issue is noopmp3-0.1s even if I use noop.js you only get the 1 second blank videos and then the next track plays.

okiehsch commented 2 years ago

@ingrid1823 Can you verify that if you update your filter lists the issue is fixed for you too?

Ristovski commented 2 years ago

@okiehsch Just saw Spotify skip two ads without locking up, so the commit you pushed works.

However, given Spotify likes to chain ads, the delay is noticeable with noopmp4-1s. Is there a chance to push a noop-0.25s.mp3 as suggested?

In an ideal world, uBlock would have a way to generate such files or arbitrary length automatically, but alas..

okiehsch commented 2 years ago

Is there a chance to push a noop-0.25s.mp3

I'll ask.

gorhill commented 2 years ago

How about midway with 0.5s, in case 0.25s ends up being too short again?

uBlock-user commented 2 years ago

@okiehsch Need to add - open.spotify.com##[href^="https://adclick.g.doubleclick.net/"] to hide the ad-banner

okiehsch commented 2 years ago

That does not work for me, I suspect it will be different for users according to their location.

uBlock-user commented 2 years ago

okay so add the one which works for you.

okiehsch commented 2 years ago

I only get self advertisement, i.e. art covers of spotify playlists. If I click it I get redirected to a different spotify page.

okiehsch commented 2 years ago

I think this can be closed now.

uBlock-user commented 2 years ago

art covers of spotify playlists.

Inconceivable! Anyway, I see what OP sees in the first post.

uBlock-user commented 2 years ago

@okiehsch ||gae2-spclient.spotify.com/storage-resolve/files/audio/interactive/$xhr,domain=open.spotify.com bypasses the audio ad and its player completely(appears and disappears within a second moving on to the next track). Can you verify ?

velsinki commented 2 years ago

@okiehsch Will you add the noop-0.5s.mp3 to the filter when it makes it to stable uBlock main? The delay is noticeably longer with the 1s solution. For now, I have gone back to my 0.25s solution, which still works fine :-).

Thanks for taking up with my suggestion, glad it worked and made it into main even, @gorhill!

ingrid1823 commented 2 years ago

@ingrid1823 Can you verify that if you update your filter lists the issue is fixed for you too?

yep the issue is fixed for me now! thank you! :)

okiehsch commented 2 years ago

Will you add the noop-0.5s.mp3 to the filter when it makes it to stable uBlock main?

Of course.

stephenhawk8054 commented 2 years ago

@okiehsch ||gae2-spclient.spotify.com/storage-resolve/files/audio/interactive/$xhr,domain=open.spotify.com bypasses the audio ad and its player completely(appears and disappears within a second moving on to the next track). Can you verify ?

Yup, I confirm this one can bypass the ad without the need for redirection on my device. The json response of these connections contain the URLs of audio ads.

Can anyone else test it? If it works, we can use it and let the redirection be a backup in case spotify changes something again.

okiehsch commented 2 years ago

On my end such a request does not exist. I get ||gew4-spclient.spotify.com/storage-resolve/v2/files/audio/interactive/*$xhr but blocking it will lead to the player skipping a few tracks, so that can't be used.

stephenhawk8054 commented 2 years ago

On my end such a request does not exist. I get ||gew4-spclient.spotify.com/storage-resolve/v2/files/audio/interactive/*$xhr but blocking it will lead to the player skipping a few tracks, so that can't be used.

As far as I see, v2 contains normal audios. You mean the audio ads on your end still appear without /storage-resolve/files/ connections?

okiehsch commented 2 years ago

Yes, here's my logger filtered for that request after skipping through the playlist until an ad appeared. 😉 image

stephenhawk8054 commented 2 years ago

I see. Maybe some A/B testing or region-specific from spotify.

okiehsch commented 2 years ago

I tried a different playlist and with that I get a - slightly different - request. ||gew4-spclient.spotify.com/storage-resolve/files/audio/interactive/*$xhr blocking that request does result in the ads quickl dissapearing.

okiehsch commented 2 years ago

We could add ||spotify.com/storage-resolve/files/audio/interactive/*$xhr,domain=open.spotify.com it does not break anything as far as I can see.

uBlock-user commented 2 years ago

it will lead to the player skipping a few tracks

How did you verify that ? I don't see any track skipping except the audio ad .

stephenhawk8054 commented 2 years ago

it will lead to the player skipping a few tracks

How did you verify that ? I don't see any track skipping except the audio ad .

/storage-resolve/v2/files/ skips other audios for me too. The ones without v2 are the only ones used for audio ads.

uBlock-user commented 2 years ago

Yes, my filter doesn't have v2 in the path.

/storage-resolve/files/audio/interactive/ is a static path used for storing audio ads only.

stephenhawk8054 commented 2 years ago

Yeah, I think what he meant was he didn't see /storage-resolve/files/ in the log, only v2 but those are for normal audios.

krystian3w commented 1 year ago

It is possible that longer mp3s than 1-second mp4s will soon be needed: https://github.com/uBlockOrigin/uAssets/issues/18148 How it can't be rewritten into a scriptlet.