AdguardTeam / AdguardFilters

AdGuard Content Blocking Filters
https://adguard.com/
GNU General Public License v3.0
3.17k stars 631 forks source link

twitch.tv #163882

Closed adguard-bot closed 1 year ago

adguard-bot commented 1 year ago

Issue URL (Ads)

http://twitch.tv

Screenshots

Screenshot 1 ![Screenshot 1](https://cdn.adguard.info/sitereports/cy8lahynm5cks8kkk0480400occ0k849gobw8xjza4.png?nc=1)

System configuration

Information Value
AdGuard product: Браузерное расширение AdGuard v4.2.189
System version: Windows 11
Browser: Chrome
Stealth mode: disabled
Filters: Ad Blocking:
AdGuard Base
AdamWr commented 1 year ago

This issue is known to be solved with AdGuard Extra userscript.

If you’re using AdGuard for Windows, Mac or Android, please make sure that AdGuard Extra is enabled in the application settings.

If you’re using AdGuard Browser Extension, we suggest installing AdGuard Extra in addition to it.

uBlock-user commented 11 months ago

@AdamWr I'm using ||hls.ttvnw.net/v1/playlist$xhr,3p,replace=/#EXT-X-DATERANGE:ID="(stitched-ad|maf-ad|source|trigger)"\S+\n|#EXT-X-DATERANGE:ID=\S+?CLASS="twitch-(?:stream-source|trigger|maf-ad)"\S+\n|#EXT-X-DATERANGE:\S+?CLASS="twitch-ad-quartile".+?(?=(#EXT-X-DATERANGE|$))|(\n#EXT-X-DISCONTINUITY\s|#EXT-X-TWITCH-PREFETCH\S+)//gs to block the video ads but this filter also breaks the playlist which causes twitch stream to be shown offline, is there any way to avoid breaking the playlist and also continue to block video ads ?

You can test at https://www.twitch.tv/twitchmedia39

AdamWr commented 11 months ago

We had in AdGuard Experimental filter rule like this:

||video-weaver.*.hls.ttvnw.net/v*/playlist/*.m3u8$replace=/#EXT-X-DATERANGE:ID="stitched-ad[\s\S]*(#EXT-X-PROGRAM-DATE-TIME)(?![\s\S]*?#EXTINF:\d\.\d+\,live)[\s\S]*|(#EXT-X-DATERANGE:ID="stitched-ad[\s\S]*?(#EXT-X-PROGRAM-DATE-TIME)([\s\S]*?(#EXTINF:\d\.\d+\,live)))/\$5/

and it removed ads, but it still was necessary to wait until ads stop playing (during that, video player was blank for about 10-30 seconds (depends on how long ads were playing) and then it played correctly).

I'm not sure if it still works, but the solution from AdGuard Extra works correctly on my end.

uBlock-user commented 11 months ago

I'm not sure if it still works

It works, same as my filter above, but also brings other issues such as once you pause, and then un-pause, video won't play, so refinement needed as I did with my filter.

but the solution from AdGuard Extra works correctly on my end.

My issue with the script is it downgrades resolution from 720p to lower, when ads are playing, I dislike that.

AdamWr commented 11 months ago

My issue with the script is it downgrades resolution from 720p to lower, when ads are playing, I dislike that.

It's true, but I think that it's better than blank screen and waiting as ad stop playing with $replace rule.

uBlock-user commented 11 months ago

hat it's better than blank screen and waiting

That's why I'm asking you, is there a way to avoid that ?

AdamWr commented 11 months ago

I don't know. If I knew, then I would add a $replace rule to fix it.