Closed adguard-bot closed 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.
@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
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.
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.
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.
hat it's better than blank screen and waiting
That's why I'm asking you, is there a way to avoid that ?
I don't know.
If I knew, then I would add a $replace
rule to fix it.
Issue URL (Ads)
http://twitch.tv
Screenshots
Screenshot 1
![Screenshot 1](https://cdn.adguard.info/sitereports/cy8lahynm5cks8kkk0480400occ0k849gobw8xjza4.png?nc=1)System configuration
AdGuard Base