Uassets: Twitch.tv ads

Created on 8 Sep 2018  路  25Comments  路  Source: uBlockOrigin/uAssets

URL(s) where the issue occurs

https://www.twitch.tv/cohhcarnage and any other live stream

Describe the issue

Ads on Twitch get inserted for me on every Twitch stream I'm watching, right at the beginning. They are played, I think, inside the same data stream as the actual stream. They cover the actual steam window.
To reproduce this issue you'll have to have Twitch account, be logged in, don't have any subscriptions on twitch (so no Twitch prime/turbo or be subscribed to the streamer you're watching).
It won't also happen for new accounts right away as apparently Twitch sets some cookie with ID and keeps track of it so new users won't be spammed with ads right away.

Versions

  • Browser/version: Firefox Developer Edition 63.0b4 (Build ID 20180906162647)
  • uBlock Origin version: uBlock Origin v1.16.20

Settings

  • I've only enabled extended list for my country. All the rest is set to the defaults after the installation.

Notes

https://www.reddit.com/r/uBlockOrigin/comments/9d6ytl/ads_on_twitch/ << reddit topic with other people experiencing the issue.
It started happening recently in Europe in general because Twitch haven't rolled out that feature there yet. It might happen right now only in European countries. At least that's what I heard but don't quote me anywhere on this.

All 25 comments

It started happening recently in Europe in general because Twitch haven't rolled out that feature there yet.

To make it clear this feature has been rolled out in 2016...

uBO has been blocking those inserted ads for quite some time see https://github.com/uBlockOrigin/uAssets/issues/719 it is just now that twitch inserts ads also without "bread" parameters present in some cases. All depends on region, channel and ad provider.

Only the ones who login with accounts are suffering from this, someone with an account will need to investigate.

Most likely if you have a cookie with id that is old enough for Twitch to notice you'll get ads as well without being logged in. I believe users like that gets ads as well, else they would deprive themselves or more than a half of ads revenue. Though it's just common sense. I don't have anything to back it up.

you'll get ads as well without being logged in

I don't have a personal account and I never get ads as a guest whatsoever. I have tested on several and several streams before, video plays as expected.

Logged in with a disposable account, no ads either. can't reproduce.

if you have a cookie with id that is old enough for Twitch to notice

I purge all cookies every month(third-party cookies are blocked by default, so only first-party cookies are allowed), is that old enough ?

The only details I have are form the top comment on reddit linked in OP.

Does the filter twitch.tv##+js(cookie-remover.js, unique_id) work for you?

Right now for some reason I'm not getting ads either with uBO enabled or disabled. Haven't changed anything. When I'll start getting ads again I'll try that filter.

EDIT: Seems that someone on Reddit already suggested this filtre and this failed for them because that cookie is apparently not set by JavaScript (I'm sorry but I don't know how this filter is even supposed to work)? https://www.reddit.com/r/uBlockOrigin/comments/9d6ytl/ads_on_twitch/e5hr0mv

Ok, tested it. I've applied the filter (added the twitch.tv##+js(cookie-remover.js, unique_id) to my filters list, saved it and refreshed the page). It does not work. I'm still getting ads.

Complete newbie here but from doing a bit of research and tinkering around with the HTML and I think I've found the culprit but I don't know how to deal with it.

event

error twitchcdn.net/assets/core-2d37e74b122d97f17af5.js:1
function() {
a.o.adBlockDetector.setBlockDetectedToTrue(), i()
}

load twitchcdn.net/assets/core-2d37e74b122d97f17af5.js:1
function() {
window.apstag && window.apstag.init && window.apstag.init(o, n)
}

Tried adding those places to my filters but it does nothing.

P.S. Keep in mind I am a newbie here so I may be 100% wrong.

@furai Try with ||twitch.tv^$csp=default-src 'self' 'unsafe-inline' 'unsafe-eval' wss: blob: *.twitch.tv www.google.com www.gstatic.com *.jtvnw.net *.ttvnw.net *.twitchcdn.net recaptcha.net

Nope, didn't work. Just added it in 'my filters' tab. Saved, restarted browser, went to Twitch and first thing I got after checking out one of the steams was amazon ad.

got after checking out one of the steams

Link ? Do a cache-free reload, if the ad was already cached, the filter won't have any effect.

https://www.twitch.tv/summit1g (It would happen on any first steam I visit, literally. Just gave you the one it happened for me.)
I'm going to test more.

EDIT: I've cleared all cache/cookies/history related to that site. Can't test it extensively right now but I'll eventually report back.

Cant reproduce with/without an account. Video plays as expected. With that CSP filter any 3rd party URL which is not mentioned in the filter won't be able to connect, which helps narrow down the source of the ads, so if you're still facing ads, it must be from inside the twitch network.

Hmm, so because of that FFZ (FrankerFazeZ) extension stopped working. I was wondering as to why. It has to contact their CDN to get the newest version. https://github.com/FrankerFaceZ/FrankerFaceZ https://ffzap.com/ https://www.frankerfacez.com/ (These last 2 are the add-on I use for Twitch).
I have some stream in the background playing and after that filter was applied - I got some weird sound stuttering.

Twitch extensions can also pull ads, so it goes without saying to disable all extensions except for uBO when testing filters.

They're not really from Twitch just fan add-ons. But noted.

So, I've had this filter on all the time. Started up stream today - got an ad. https://www.twitch.tv/anthony_kongphan

someone made an extension to solve this: https://github.com/instance01/Twitch-HLS-AdBlock maybe it serves as a source on how this could be fixed with uBlock

so i did a bit of testing, leave gstatic unblocked, and block adservice.google.com and pagead2.googlesyndication.com. for some reason, that stops it from loading ads at all for me.

@svnhddbst probably coincidence, I stopped getting ads today for some reason

Looks like the ads are coming down from https://video-weaver.***.hls.ttvnw.net/ (where * is the closest edge on the cdn) in the form of HLS.
Here's a line from the HLS that has some telling data, maybe the response data could be inspected by ublock?
#EXT-X-DATERANGE:ID="stitched-ad-1538546979-30186999985",CLASS="twitch-stitched-ad",START-DATE="2018-10-03T06:09:39.352Z",DURATION=30.187,X-TV-TWITCH-AD-URL="https://www.twitch.tv/primevideo"

Looks like the extension 3 posts up is using #EXT-X-SCTE35-IN/OUT as the trigger
https://github.com/instance01/Twitch-HLS-AdBlock/blob/master/extension/injected.js#L43

Stripping out whatever is between the tags, then doing some cleanup to fix the sequence number after stripping.

Is anything close to this possible in ublock?

@tomkel did you tried this https://github.com/uBlockOrigin/uAssets/pull/3517#issuecomment-423752570 ?

If you are on Chrome, forcing filters update (purge -> update) should update to this fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

patrickdrd picture patrickdrd  路  3Comments

terrorist96 picture terrorist96  路  3Comments

sebastianbell picture sebastianbell  路  3Comments

ghost picture ghost  路  3Comments