Skip to content
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

Closed
yesmar12 opened this issue Oct 14, 2020 · 9 comments
Closed

Ads on version 2.9.0 #148

yesmar12 opened this issue Oct 14, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@yesmar12
Copy link

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:

  1. Open twire version 2.90 fdroid
  2. Skip the loggin sequence
  3. Close the change log
  4. Open any of the streams on the top streams page
  5. Watch ad
@samfundev samfundev added the bug Something isn't working label Oct 14, 2020
@Disqu3-mirOir-qt
Copy link

same here prerrol ads for watch dogs (ubisoft) all streaming

appear today for me

@sh0wst0pper
Copy link

Yep Ad's now showing on twire - seems like a lot of programs have been affected.

@Perflyst
Copy link
Collaborator

Perflyst commented Nov 1, 2020

"Upstream" info: Twitch is injecting stream directly into the HLS stream, so filtering out the ads is very difficult

SebastianRask/Pocket-Plays-for-Twitch#34 (comment)

@Disqu3-mirOir-qt
Copy link

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() } }

@sh0wst0pper
Copy link

Is this app being updated, or the issue looked into? If not what are people using on android?

@samfundev
Copy link
Collaborator

@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.

@sh0wst0pper
Copy link

@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!

@HarambeKobe
Copy link

@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.

https://www.reddit.com/r/Twitch/comments/jjepg8/fix_for_ublock_origin_on_twitch_i_updated_the/?sort=new
this one is working for windows browser

@Perflyst
Copy link
Collaborator

There appears to be a working userscript too: https://greasyfork.org/en/scripts/416411-twitch-adblock/code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants