-
Notifications
You must be signed in to change notification settings - Fork 60
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
Ads on version 2.9.0 #148
Comments
same here prerrol ads for watch dogs (ubisoft) all streaming appear today for me |
Yep Ad's now showing on twire - seems like a lot of programs have been affected. |
"Upstream" info: Twitch is injecting stream directly into the HLS stream, so filtering out the ads is very difficult |
const origFetch = window.fetch window.fetch = (url, init, ...args) => { let newUrl = url if (typeof newUrl === 'string') { if (newUrl.includes('/access_token')) { newUrl = newUrl.replace('player_type=site', 'player_type=thunderdome') } else if ( newUrl.includes('/gql') && init && typeof init.body === 'string' && init.body.includes('PlaybackAccessToken') ) { const newBody = JSON.parse(init.body) newBody.variables.playerType = 'thunderdome' init.body = JSON.stringify(newBody) } } return origFetch(newUrl, init, ...args) } const findVideoPlayer = () => { const videoPlayer = document.querySelector('[data-a-target="video-player"]') if (videoPlayer) { attachMutationObserver(videoPlayer) } } const attachMutationObserver = (videoPlayer) => { const dblclick = new MouseEvent('dblclick', { bubbles: true, cancelable: true, view: window }) const options = { childList: true, subtree: true } const adObserver = new MutationObserver(function (mutations) { mutations.forEach((mutation) => { mutation.addedNodes.forEach((node) => { if (node.nodeType === Node.ELEMENT_NODE) { const ad = node.querySelector('[data-test-selector="ad-banner-default-text"]') if (ad) { const resetButton = document.querySelector('[data-a-target="ffz-player-reset-button"]') const videoPlayerElement = document.querySelector('video') const currentVolume = videoPlayerElement.volume if (resetButton) { resetButton.dispatchEvent(dblclick) setTimeout(() => { videoPlayerElement.volume = currentVolume }, 2000) } else { window.location.reload() } } } }) }) }) adObserver.observe(videoPlayer, options) } window.onload = function () { findVideoPlayer() const { pushState } = history history.pushState = function () { pushState.apply(history, arguments) findVideoPlayer() } } |
Is this app being updated, or the issue looked into? If not what are people using on android? |
@sh0wst0pper Twire is still being updated but I've been busy recently so I haven't had time to look into what methods are actually working to block ads. It seems like Twitch has been fixing a lot of the methods to block ads recently but I'll see if I can find something that works. If you know of a method that works, please let me know. |
@samfundev no problem at all - i was just wondering as i haven't seen any replies. I certainly cant help either!! I know alternate player for twitch browser addon works, not sure if that helps though! |
https://www.reddit.com/r/Twitch/comments/jjepg8/fix_for_ublock_origin_on_twitch_i_updated_the/?sort=new |
There appears to be a working userscript too: https://greasyfork.org/en/scripts/416411-twitch-adblock/code |
Description
Version: 2.9.0
When I start a stream I get ads every time. I have tested this in version 2.519 and do not receive ads. Both versions are the fdroid version. In both cases I am not logged into an account. Please let me know with any details that I am missing from this bug report.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: