Twitch new Ads mechanism

AugustineWei

New Member
Dear Adguard,

Please could you kindly see the information as follows:

1. Website: https://www.twitch.tv/

2. The adverts are intrusive and sometimes there are 6 adverts in a row and each of them can take up to 30 seconds.

1601379916751.png

3. This new ad mechanism has started since today on 29th September 2020 (The previous ad filter for Twitch had worked well since the end of May 2019).

4. I am using ADGUARD 7.5.1. for Windows.


Thank you very much for your service in anticipation and hope this can be sorted soon : ).

If there is any further information needed, please kindly let me know.
 
Last edited:

Blaz

Moderator & Translator
Staff member
Moderator
Equivalent to this would be this rule, though Twitch is rarely showing ads to me:

Code:
twitch.tv#%#!function(){var c;!1!==/(^|\.)twitch\.tv$/.test(document.location.hostname)&&(c=window.fetch,window.fetch=function(t,e){var n;return 2<=arguments.length&&"string"==typeof t&&t.includes("/access_token")&&((n=new URL(t)).searchParams.forEach(function(t,e){n.searchParams.delete(e)}),t=n.href),c.apply(this,arguments)})}();
 

BourbonCrow

New Member
edit: think it works just had to clear cache or something atleast no ads now.. or im just lucky jumping streams like crazy and no ads that usually caused ads to show up before
 
Last edited:

ukheather

New Member
So annoying now that adguard doesn't block ads on Twitch.

Still not blocking them today, hope it gets fixed soon.
I use base filter and annoyances filter on firefox
 

Blaz

Moderator & Translator
Staff member
Moderator
Please add rule to user filter:
Code:
twitch.tv#%#(function(){if("function"==typeof fetch){var a=window.fetch;window.fetch=function(b){if(2<=arguments.length&&"string"==typeof b&&b.includes("/access_token")){var d=new URL(arguments[0]);d.searchParams.delete("player_type"),d.searchParams.delete("platform"),arguments[0]=d.href}return a.apply(this,arguments)}}})();
FireFox cannot get Javascript rules via updates (only via Extension update).
 

ukheather

New Member
Please add rule to user filter:

FireFox cannot get Javascript rules via updates (only via Extension update).
Did that, not working. Latest filters with that in user filter and I tried 3 channels and got 3 ads.

Same for 3 friends, doesn't work
 

AugustineWei

New Member
Please be noticed that the same issue has occurred again since 30th October 2020 due to the current filters no longer work for the ads on Twitch.tv.

Thank you for your help in anticipation :).
 

BourbonCrow

New Member
A updated version of the script has been posted here it just needs to be converted to Adguard.. Like the other one I posted. I don't know how to do this so someone knowledgeable have to.

Updated twitch ad script on reddit

direct link to his github

edit: i think it might be this simple to convert the js into adguard? just twitch.tv#%# in front of the code? and remove unnecessary spaces and make it 1 line (i used a minifier on the script) based on what ive seen how they done above testing it out my self but someone who knows more should be doing it :p But i think it seems to work cause i havnt seen any ads yet.
if you try code below remember to disable the old code in AdGuard Base filter first so new one dont get messed up by old version of it
---
edit2: been testing code below for a few hours now and it seems to work fine no ads
Code:
twitch.tv#%#const origFetch=window.fetch;window.fetch=((e,o,...c)=>{if("string"==typeof e)if(e.includes("/access_token"))e=e.replace("player_type=site","player_type=facebook");else if(e.includes("/gql")&&o&&"string"==typeof o.body&&o.body.includes("PlaybackAccessToken")){const e=JSON.parse(o.body);e.variables.playerType="facebook",o.body=JSON.stringify(e)}return origFetch(e,o,...c)});
Please be noticed that the same issue has occurred again since 30th October 2020 due to the current filters no longer work for the ads on Twitch.tv.

Thank you for your help in anticipation :).
 
Last edited:

BourbonCrow

New Member
rule i posted above has been updated to and remember to disable old rule when adding this one can only have 1 active
Code:
twitch.tv#%#const origFetch=window.fetch;window.fetch=((e,i,...s)=>{if("string"==typeof e)if(e.includes("/access_token"))e=e.replace("player_type=site","player_type=embed");else if(e.includes("/gql")&&i&&"string"==typeof i.body&&i.body.includes("PlaybackAccessToken")){const e=JSON.parse(i.body);e.variables.playerType="embed",i.body=JSON.stringify(e)}return origFetch(e,i,...s)});
replace old one with this the only change is the 2 words facebook has been replaced by embed go to his git linked in post above to see changes
 

BourbonCrow

New Member
Ye stuff only work for like a day then they fix but I think the reload works but it only works on midroll ads not preroll .. I hope a more permanent solution is found soon.. I will post as soon as I find one somewhere
 
Last edited:

Boo Berry

Moderator + Beta Tester
Moderator
If I had to personally guess, I'd say ad blocking on Twitch's days are numbered. They're obviously setting it up where ads can't easily be blocked and if they are it breaks HD quality.
 
Top