odensc / ttv-ublock

Blocking ads on that certain streaming website
MIT License
896 stars 61 forks source link

Purple warning screen showing up when using extension #21

Open ShaNam69 opened 3 years ago

ShaNam69 commented 3 years ago

https://i.imgur.com/TtSqjGa.png this is what's happening

strong-code commented 3 years ago

This script is working under my userResourcesLocation in uBO (I use dev, but it's prob not necessary): https://raw.githubusercontent.com/Drizzlefrizzle/twitch/main/twitch4.js I think you need ffz

This is the same code as this repository.

When the purple ad gets displayed

<div data-test-selector="sad-overlay" class="tw-absolute tw-bottom-0 tw-left-0 tw-right-0 tw-top-0"></div>
t.prototype.render = function() {
    return this.props.stitchedAdUrl ? r.createElement(Bt.a, {
        attachTop: !0,
        attachLeft: !0,
        attachBottom: !0,
        attachRight: !0,
        position: Ht.o.Absolute
    }, r.createElement("div", {
        "data-test-selector": "sad-overlay",
        onClick: this.onClick
    })) : null
}

Maybe a potential solution is to watch for DOM changes for when the purple screen is placed, and then prevent/remove it. I'm not sure if the original player element is still there and just backgrounded/muted or if it is replaced entirely by the purple screen element.

r3ndd commented 3 years ago

The purple screen is actual video data being streamed. The overlay div is simply the link that takes you to Twitch when you click on the video.

r3ndd commented 3 years ago

Okay I think I've cracked it. Testing for a bit, I should have a pull request soon if all goes well.

negatratoron commented 3 years ago

Okay I think I've cracked it. Testing for a bit, I should have a pull request soon if all goes well.

famous last words

r3ndd commented 3 years ago

Yeah...it's going to need a bit more reverse engineering.

mystyq commented 3 years ago

@r3nderer Would you post your findings?

r3ndd commented 3 years ago

Okay, I've determined with high confidence that the purple screen is being streamed server-side and that no amount of reverse-engineering of the client code will let you skip it. The client code only seems to handle tracking of how long you've viewed an ad. I disabled the client code that manages the gql requests for the ads and it does not affect the display of the purple screen.

The new solution is probably going to have to come from pretending to be some sort of player that doesn't receive ads or the purple screen.

negatratoron commented 3 years ago

One workaround that's working for me so far is to use streamlink and VLC (It's really easy, install both and follow the instructions on the streamlink page). I can still chat via Twitch. VLC shows a 15-second "ad break" screen when it first starts up but after that it's not showing a purple screen. (I have twitch and VLC open side by side, so far the purple screens are 3-0).

raszpl commented 3 years ago

@RightToBearArmsLOL

It baffles me that if Twitch is using this method to serve 3rd party embed sites with this screen, when they could serve the same embeds paid ads,

Twitch cant serve ads on embeds - anyone could embed Twitch on a nazi hardcore animal porn website and BAM advertisers get mad their content is associated with maga russian viagra bots, and they paid for it.

xzyxzy commented 3 years ago

Okay ya'll probably will say that I'm bringing wrong thing or something, but in my case daum potplayer with this plugin https://github.com/23rd/TwitchPotPlayer/ doesn't show ads or purple screens ever. Not sure how it works but maybe it is possible to copy the way it works?

Geczy commented 3 years ago

@r3nderer

The purple screen is actual video data being streamed. The overlay div is simply the link that takes you to Twitch when you click on the video.

It's more than the link, it's the entire purple color and forced background. The javascript removes the twitch player div, and replaces it with this.

You can freeze the player div from modification ;)

kinsi55 commented 3 years ago

Even if the purple screen is injected into the main Video feed there has to be some way to view the stream (Be it probably in 480p which is better than nothing) while the ad is rolling since they allow you to continue viewing the stream in the corner - So somehow you gotta be able to detect an ad is supposed to roll and switch to the picture by picture view.

I understand this probably isnt easy but possible.

Geczy commented 3 years ago

@xzyxzy you probably don't see purple ads because of the stream you're on. Try some of the ones posted here

Geczy commented 3 years ago

Even if the purple screen is injected into the main Video feed there has to be some way to view the stream (Be it probably in 480p which is better than nothing) while the ad is rolling since they allow you to continue viewing the stream in the corner - So somehow you gotta be able to detect an ad is supposed to roll and switch to the picture by picture view.

I understand this probably isnt easy but possible.

Can you share an image of the pip view? I haven't seen that, maybe because of my adblockers. But if the stream is showing in pip, we could just mute the ad and make the pip large using css

xzyxzy commented 3 years ago

@xzyxzy you probably don't see purple ads because of the stream you're on. Try some of the ones posted here

I'm literally watching same stream I constantly having purple screens in chrome. https://www.saltybet.com/

In potplayer there are no purple screens. I would've used potplayer to watch if I didn't had to use two separate windows, because betting and chat is in chrome.

Geczy commented 3 years ago

I don't have any ads on saltybet.com , maybe they showed you all the ads you were suppose to see for the day on chrome. Now the windows app doesn't show you any ;)

xzyxzy commented 3 years ago

Just keep watching then?

Geczy commented 3 years ago

How long did you leave potplayer open? You said you don't watch in the app

xzyxzy commented 3 years ago

Same amount as salty is open in chrome. I just have to do stupid amount of additional movement because of that.

It is either I make it always on top to comfortably chat and bet but have to turn it off to check tournament page and exhibs, or I don't make it always on top and have to focus potplayer window back each time I bet or chat.

pixeltris commented 3 years ago

@kinsi55 I made a prototype thing a little while ago which does exactly that. It's just a prototype though, more work needs to be done to improve segment matching https://gist.github.com/pixeltris/77c676ef65b0b76e7aa56d8a0e0b3897

@xzyxzy I looked at the code for the requests that TwitchPotPlayer makes. There isn't anything different that should make it behave differently (I tested using their exact requests, and I got ad segments, but I guess there could be a small thing I missed).

netstx commented 3 years ago

This purple screen issue only started today (12/22/20) for me, in the last few days I had not seen it yet... Twitch might have rolled this out slowly.

Aziks0 commented 3 years ago

Even if the purple screen is injected into the main Video feed there has to be some way to view the stream (Be it probably in 480p which is better than nothing) while the ad is rolling since they allow you to continue viewing the stream in the corner - So somehow you gotta be able to detect an ad is supposed to roll and switch to the picture by picture view. I understand this probably isnt easy but possible.

Can you share an image of the pip view? I haven't seen that, maybe because of my adblockers. But if the stream is showing in pip, we could just mute the ad and make the pip large using css

@Geczy https://help.twitch.tv/s/article/picture-by-picture-ads?language=en_US

I don't think that pre-roll ads are in picture by picture tho.

Edit: well, i'm dumb, "pre-rolls will not deliver in a Picture-by-Picture experience", it's literally written in the FAQ section.

kinsi55 commented 3 years ago

I don't think that pre-roll ads are in picture by picture tho.

They are not, but you can block Pre-Rolls with the embed player as we know, at least for now - just that doing that seems to trigger a lot of mid rolls which need a solution first.

raszpl commented 3 years ago

it looks broken https://github.com/23rd/TwitchPotPlayer/blob/eb2de3d2f340a084418beb2adf7706f72284b553/Media/PlayParse/MediaPlayParse%20-%20Twitch.as#L331

+ ".m3u8?allow_source=true&p=7278365player_backend=mediaplayer&playlist_include_framerate=true&allow_audio_only=true";

the p=7278365player_backend=mediaplayer part

xzyxzy commented 3 years ago

Works for me just fine, but as I already mentioned, usability suffers.

Geczy commented 3 years ago

If an android emulator works to remove all ads, what about just running the twitch apk in https://archon-runtime.github.io/

https://twitch.en.uptodown.com/android/download

RoyRiv3r commented 3 years ago

If an android emulator works to remove all ads, what about just running the twitch apk in https://archon-runtime.github.io/

https://twitch.en.uptodown.com/android/download

I don't think people coming here want to use third app to watch Twitch, also this is nothing to do with this topic.

brian6932 commented 3 years ago

@strong-code the script in this repo is not the same This repo: https://raw.githubusercontent.com/odensc/ttv-ublock/extension/firefox/background.js The one I'm using: https://raw.githubusercontent.com/Drizzlefrizzle/twitch/main/twitch4.js (it requires you to purge filter list cache and update) It works, if it doesn't work for you try using cookie autodelete and set the 2 uid cookies to auto delete

xzyxzy commented 3 years ago

@strong-code the script in this repo is not the same This repo: https://raw.githubusercontent.com/odensc/ttv-ublock/extension/firefox/background.js The one I'm using: https://raw.githubusercontent.com/Drizzlefrizzle/twitch/main/twitch4.js (it requires you to purge filter list cache and update) It works, if it doesn't work for you try using cookie autodelete and set the 2 uuid cookies to auto delete

https://github.com/odensc/ttv-ublock/raw/extension/chrome/background.js identical to twitch4.js

brian6932 commented 3 years ago

hmmm, ok I guess the firefox script is slightly different, I'm not sure why this script is working for me, it might be because it's somehow detecting the extensions and not the script, this is really weird, this does not only work for me, I tested it out on a friends PC and it seemed to work too, it could also be the combination of using uBO dev and the script in conjunction

netstx commented 3 years ago

hmmm, ok I guess the firefox script is slightly different, I'm not sure why this script is working for me, it might be because it's somehow detecting the extensions and not the script, this is really weird, this does not only work for me, I tested it out on a friends PC and it seemed to work too, it could also be the combination of using uBO dev and the script in conjunction

is this a script for uBlock Origin?

brian6932 commented 3 years ago

I can try giving a more detailed post about my config if you can't get it to work for you

netstx commented 3 years ago

I can try giving a more detailed post about my config if you can't get it to work for you

That'd be nice, I am not too familiar with custom uBlock stuff. Is adding the script as a custom list enough? Or does the script go elsewhere in the extension settings?

Geczy commented 3 years ago

I enabled the uBO userResourcesLocation script you posted and still receive pre-roll ads @brian6932

pixeltris commented 3 years ago

@brian6932 that script has nothing to do with uBlockOrigin. It will be ignored by uBlockOrigin. Anything you're experiencing with that applied is a placebo.

brian6932 commented 3 years ago

I wonder how I am not getting ads then 🤔 must be something else then

Geczy commented 3 years ago

@pixeltris it used to work, and used to be a valid method for disabling ads https://www.reddit.com/r/Twitch/comments/jjepg8/fix_for_ublock_origin_on_twitch_i_updated_the/

brian6932 commented 3 years ago

hmm, well maybe someone will figure out how to replicate it, either way this is what my userResourcesLocation looks like: image I use all native/optional uBO filterlists + these imported ones (I'm on uBO dev 1.31.3rc4): image I set these 2 uid cookies to auto delete in cookie autodelete: image I also use NextDNS with this config (this blocks ads on Twitch mobile for me, shouldn't effect desktop, but could help): image image Sorry if this doesn't work, I really don't know what it could be

r3ndd commented 3 years ago

@r3nderer

The purple screen is actual video data being streamed. The overlay div is simply the link that takes you to Twitch when you click on the video.

It's more than the link, it's the entire purple color and forced background. The javascript removes the twitch player div, and replaces it with this.

You can freeze the player div from modification ;)

No it does not, the purple screen is a video being streamed in the original player.

I don't think that pre-roll ads are in picture by picture tho.

They are not, but you can block Pre-Rolls with the embed player as we know, at least for now - just that doing that seems to trigger a lot of mid rolls which need a solution first.

Pre-roll ads do get displayed in pip, here's a screenshot:

image

brian6932 commented 3 years ago

Ok as of about a minute ago I am receiving ads again, Twitch is watching monkaW

Geczy commented 3 years ago

@r3nderer

No it does not, the purple screen is a video being streamed in the original player.

It does though, inspect the player element while receiving a purple :)

r3ndd commented 3 years ago

@Geczy What claim are you making again? That the purple screen isn't a part of the video stream?

Geczy commented 3 years ago

That twitch.tv js replaces video stream element with purple ad element

I'll get some pics for you next time it happens @r3nderer

r3ndd commented 3 years ago

@Geczy You must be confused, my video element remains completely unchanged during the purple screen and even after it disappears. Deleting the video element deletes the purple screen, as well as any video that plays after it. I have also disabled all client side scripts that manage ads and the screen still appears, which makes sense because it is well known Twitch is injecting ads (or the purple screen) directly into the video feed.

pixeltris commented 3 years ago

https://github.com/pixeltris/TwitchAdSolutions I have made a repo here with 4 solutions to blocking ads (uBlock Origin scripts). None of them are perfect, but they are something.

raszpl commented 3 years ago

@brian6932

I put https://raw.githubusercontent.com/Drizzlefrizzle/twitch/main/twitch4.js in userResourcesLocation, in uBO dev, go to filterlists and purge cache and update, and finally make sure you have ttv adblock disabled

that does nothing, its not how ubo scriptlets work. You are a victim of placebo effect, or trolling judging by pepe

brian6932 commented 3 years ago

@raszpl Well ads were being blocked so something was working, I was just explaining my config, which is literally why I fucking posted it, I clarified that I didn't know if it was specifically that, it's not working anymore. I'm not trolling, @pixeltris solution is pretty good though

r3ndd commented 3 years ago

The purple screen is fairly inconsistent, which is likely intentional. Twitch knows pretty much everyone will prefer the purple screen over watching an ad, so they are not gaining any money by having it. They are simply doing it to spite us and are actually losing money by paying someone to implement this feature.

DKnightX91 commented 3 years ago

IDK if this helps or not. I still use ttv-ublock no purple screens at all. Im on Brave and on Twitch I turn off the JavaScript under site setting. Also I don't use the Chrome Store version of ttv-ublock as well. I downloaded the code and run it with dev mode. Don't know if the small changes do anything or not.

Edit: after Testing in 3 affiliates and 2 partner channels can 100% confirmed whatever combo of stuff I did is working.

Edit 2: I think with the JavaScript blocked they can't read what you have installed on your browsers so give that a try.

Edit 3: Just came to mind that I am running a PiHole so don't know if that to is doing something :/ So once I find a good way to fully test all I done will report back.

Geczy commented 3 years ago

@DKnightX91 try running for 1hr on https://www.twitch.tv/hasanabi

I bet you'll get an ad, but if you don't let us know !