younesaassila / ttv-lol-pro

TTV LOL PRO removes most livestream ads from Twitch. This is free, don't expect it to be perfect.
GNU General Public License v3.0
1.39k stars 26 forks source link

not working with embedded player on lazygoat.tv #262

Closed garbb closed 8 months ago

garbb commented 9 months ago

Describe the bug When viewing a channel on twitch.tv with TTV LOL pro enabled pre-roll ads and "preparing your stream" pre-roll message are not displayed, however when viewing the same twitch channel in embedded player on lazygoat.tv or simultwitch.com, "preparing your stream" pre-roll message is displayed.

When using plain "player.twitch.tv" address by itself in a tab, "preparing your stream" pre-roll message is not displayed.

To Reproduce Steps to reproduce the behavior: Unfortunately ads may or not be displayed depending on your location, however this works for me:

Expected behavior I expect the pre-roll message to not appear on lazygoat.tv or simultwitch.com with the embedded twitch player.

Screenshots image

Desktop (please complete the following information):

Additional context I found some other old issues about support being added for embedded players with the "player.twitch.tv" host, however this still doesn't seem to be working on lazygoat.tv or simultwitch.com?

zGato commented 9 months ago

Twitch streams embedded into a web page always serves that ad, even if you don't have the adblocker enabled.

There's nothing that can be done here, as it's on Twitch's end and the developer of the website using their embedded stream API.

garbb commented 9 months ago

What I don't understand is that on that page that I have screencapped it appears that the embedded player is in an iframe?: image with src="https://player.twitch.tv?channel=imnotrightnetwork&controls=false&height=100%25&parent=simultwitch.com&referrer=https%3A%2F%2Fsimultwitch.com%2Fimnotrightnetwork&width=100%25/" So shouldn't this iframe behave the same as a separate tab that loads the url "https://player.twitch.tv?channel=imnotrightnetwork&controls=false&height=100%25&parent=simultwitch.com&referrer=https%3A%2F%2Fsimultwitch.com%2Fimnotrightnetwork&width=100%25/" directly (with regards to how TTV LOL PRO interacts with it)?

garbb commented 9 months ago

I guess you are right? I did some more testing: I hosted my own local web server and loaded an html page with just http://127.0.0.1/iframe_test.htm

<iframe src="https://player.twitch.tv?channel=imnotrightnetwork&parent=127.0.0.1"></iframe>

And it always gets that "preparing stream" pre-roll.

Whereas if I just go to the url "https://player.twitch.tv?channel=imnotrightnetwork&parent=127.0.0.1" it doesn't get the pre-roll. Seems like there should be some workaround for this? I assume the browser must be telling player.twitch.tv somehow in a request that it is being loaded into an iframe? Is there any way to make the browser not tell the host that the url is being loaded into an iframe? (i have a feeling that this has something to do with cross-stite scripting security or something like that?)

younesaassila commented 9 months ago

TTV LOL PRO doesn't support player.twitch.tv URLs (#206). Even if it did, as @zGato said, the embed player behaves differently from the normal player and often pushes purple ad screens.

zGato commented 9 months ago

If there's some bypass or something it's another whole thing, still for website security I don't think there's any and if there's, probably already patched.