-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ALL twitch.tv issues #5184
Comments
The @pixeltris's solution has been broken. |
The next logical step is removing the ad chunks in the stream. This unfortunately can add quite a delay until the actual stream starts. See https://github.com/instance01/Twitch-HLS-AdBlock EDIT: If you play around with the params to the access_token request there seem to be more workarounds. Probably futile to do so though? Maybe implement something similar to Twitch-HLS-AdBlock and then add any additional workarounds as they are found? |
I've just noticed that the initial request, when entering a stream, to |
The platforms (aside from the regular site) are listed here, but I'm not sure what the actual values to use are for each: https://www.twitch.tv/p/platforms/ Might be worth trying though. I think it's odd that platform being undefined worked (for a while) to prevent ads, which means that was probably the default and that the other values are also meant to enable them. On reddit someone (supposedly) doesn't get ads via FireTV so that one may work. |
@stoically that request includes a "sig" param which looks like a SHA1 based on the length. The json request is probably hashed along with some server side secret so I don't think it's feasible to modify that request. @TheEnhas there is at least one value which can currently bypass the |
If it's by design on some platforms to save bandwidth or that already have other ads then I'm not sure if they'd "fix it", but I get the feeling it's more likely that they've just not updated those apps yet to work with the new system and they'll get the ads like everyone else once they do. |
@pixeltris Although you're probably right and the FWIW, I've also tried to redirect the request using the WebExtensions onBeforeRequest API, but that leads to a Network Error in the Twitch player and it also doesn't show the request at all in the Network log. The only reason I can think of that causes this, is that the |
@stoically https://gist.github.com/pixeltris/e659867516ed0be149bf5e9e22d7d6e0 something like this should work (I have been using it for tests, modifying the response on a locally hosted server so I don't have to deal with the pain of javascript). |
That works, thanks. Though rewriting the |
Hi guys, |
@pijcab Select advanced in the uBO dashboard, click the appearing cog, replace |
Wouldn't |
@stoically thank you very much, didn't know that Also this might help some people : I found a workaround by using a VPN and connecting to the countries outside of the SureStream available geos (Such as Romania or Hungary). |
Some people reportedly had success by changing their browser's user agent to Android while on Twitch. I tried it and ads still got through. |
https://gist.githubusercontent.com/pixeltris/e2d4194d7fd5bfa1df39470cb589a012/raw/523c2fa60547046bbd15122e5aa70489f5d8afde/twitch_hls_test.js this is a rough copy/paste of @instance01's https://github.com/instance01/Twitch-HLS-AdBlock for uBlock Origin. Last time I tested his extension I was getting reasonable load times (~5 seconds). Currently everything seems to take like 30+ seconds to load. I haven't looked too much into it yet and had to gut out some code which was causing spam requests. I tried making a "loading screen" .ts file but failed miserably. If anyone knows how to make a valid .ts file Twitch can load that would be useful. There is a base64 string where the .ts file should go at the bottom of that file. Otherwise the screen will be black for ~30 seconds while ads are displayed. |
Is there a value set anywhere that tells Twitch that you've seen an ad recently so as to not play another one? Because (one big thing I hate about the new pre-roll system) you end up behind the stream once the ad finishes and have to pause/play or reset the player to get back to the right latency, and you don't get another ad right away if you do that. Also, even if I reload or change streams after getting an ad I don't tend to get another for some time. This doesn't make a lot of sense because some people report getting an ad every time they load a stream no matter what, but in my case maybe it's setting some value somewhere that expires after like a half hour or whatever amount of stream loads (whichever comes first). |
@TheEnhas The ads are at least geo-aware, if not targeted. So it's probably some server-side logic that decides whether to include ads in your m3u8 playlists or not (hence the name SSAI). Something like: Some IP-ranges (or targeted users if you're logged in) are limited to a Pre-roll Ad every 15minutes, others are not - based on the options chosen by advertisers. Related or maybe even superseding issue: #1905 |
likely Ad blocking may break for me on April 2nd (older Amazon Prime/Twitch Prime and i guess? i was grandfathered into having ads disabled as i have even uBlock disabled and still get squat but i disabled since i made affiliate as to not even tempt to breaking contract,) for when i haveto let it expire briefly to renew w/ a gift of prime... Anyway.. maybe look into how Kodi & the twitch plugin does this because no ads play before or during a stream. I have a media center box in my gaming room setup with Kodi 18.1 and latest twitch plugin outside a few edge cases that streams either crash the box or wont load(a kodi fault/plugin fault) i dont get ads whatso ever, with or without logging into my twitch account. |
https://gist.githubusercontent.com/pixeltris/e2d4194d7fd5bfa1df39470cb589a012/raw/0c9f3d988d9cd0ef5f011ad8057a3d50ae23a38c/twitch_hls_test.js updated version of the adapted Twitch-HLS-AdBlock for uBlock Origin. It should load the stream in 5-10 seconds now rather than 30. Not sure about midroll ads though. Actually maybe 10-30 seconds? Pretty bad still. |
Is there any way to get the time length of the ad at the start, immediately skip to the end of that length and mark it as being "viewed" by Twitch so that you end up with very little (if any) downtime? |
@TheEnhas that's essentially what Twitch-HLS-AdBlock / the thing I linked are doing. There is one m3u8 per stream quality, as it polls the m3u8 file, normal stream segments will start showing up. As soon as they are available they are displayed (and all the ad segments removed). Unfortunately there is still quite a delay before the normal stream is available. Maybe you could spam the m3u8 some more but I doubt it would help. |
Just realized that the @pixeltris Regarding Pre-rolls, the m3u8 requests for me look like this when loading the stream:
So the Ad plays 14seconds but the first actual stream Stripping segments completely works for Pre-rolls, since the player didn't start yet and will start correctly with the first non-Ad segment - but it will break for Mid-rolls because the player already started and suddenly doesn't get segments anymore. Also it seems that Mid-rolls don't serve non-Ad segments early. (More information about my Mid-roll findings including attempts to create a placeholder Would be interesting to see other HAR's for Pre-rolls and Mid-rolls (here's how to obtain one: Firefox / Chrome). |
I'm not sure you can completely strip the m3u8 of all segment files as otherwise the twitch player will start spamming the server hard until it finds something to play. That's why I inserted a dummy .ts entry when there are only ads (it would be ideal if this would be an actual .ts file which displays a message about ads being blocked). Does the current solution I linked break when midrolls are played? I haven't had a chance to see a stream that has played midrolls. Is there a streamer who plays them often? |
@pixeltris try Shroud |
It seems as long as the m3u8 can get parsed (request result not empty), it will not result in the "Invalid variant" error and spam, but rather poll normally.
Did you try the linked ffmpeg command?
Hadn't a chance to test with Mid-rolls yet. I know that |
I tried your solution with a stream that does frequent mid-rolls, and it broke the feed. After switching tabs it restarted again when I switched back, but I think that's unrelated. It works fine for pre-rolls however. |
https://gist.githubusercontent.com/pixeltris/e2d4194d7fd5bfa1df39470cb589a012/raw/ddffe9cfabcf881a028a4a813817ade96f6bad17/twitch_hls_test.js this version should display a message in the top left corner "uBlock Origin is waiting for ads to finish..." and the stream should also now continue after midroll ads finish (though the video feed will freeze until the next stream segment is available, I could possibly modify it to go to black or something?). I might strip out some of the changes I made to support displaying custom .ts files as it really isn't necessary. But besides from that I think it should be good enough? @stoically Twitch seems to be very finicky about what it can load, I couldn't get anything from ffmpeg or vlc's convert tool to work. EDIT: https://gist.githubusercontent.com/pixeltris/e2d4194d7fd5bfa1df39470cb589a012/raw/58cf8f1e503f3b5323daf6c12caf986decc86e5e/twitch_hls_test.js this one should be a tiny bit smoother when midrolls play. Live segments take a while to show up during midrolls which is unfortunate. Also I think there is currently some issue when midrolls finish where it skips a couple of segments (possibly due to the sequence modifications). I have noticed that during some hours of the day simply refreshing can result in no ads so it might be possible to spam the access_token request until the result is ad-free (this would require a poll to access_token, followed by the main m3u8, then finally the stream m3u8 to see if ads there or not). |
@pixeltris Works fine for Pre-roll ads - have yet to test with Mid-rolls, I'll let you know. Though it might lead to unexpected behavior when switching streams, since To generate playable placeholder |
I've found streams under the "Always On" directory are a good resource for midroll ads (they show ads every 10 minutes or so). Is there a suitable place to reset |
today i can see ads on twitch |
Use |
Where do you put this sentence, goes red in my filters, and rules it doesn't save. |
add |
Ahh, I see. I had |
If ads are displayed I have a small timeout, but at least it's working till |
@repofodu An ad- and trackingblocker shold not eliminate age warnings by default or in any list not mentioning this. If you still want a filter for this and can't do yourself, I think r/uBlockOrigin is a place where volunteers often help with customization filters. |
URL(s) where the issue occurs
twitch.tv
Describe the issue
Embedded video ads are showing again after the fix from #5138 that lasted until now.
Screenshot(s)
Versions
Settings
Default settings.
Notes
Fix that was pushed as part of issue 5138 worked until a few hours ago, now getting embedded ads again. No changes made between then and now. Maybe a recent filter change broke this, or maybe Twitch patched this workaround?
The text was updated successfully, but these errors were encountered: