Youtube ads not being blocked by AG Home

streamsurfer

New Member
Need help, AG Home not blocking youtube ads. My friend using Pi-Hole added a Regex filter and it worked for him. He suggested to try one of the two to work, but in his case 1st one worked.

Please tell me correct syntax for Regex for below for AdGuard Home or include this in my custom filter or add it to AdGuard Blocking filter list.

Need to try for YT Ads (1st one worked for my friend using Pi-Hole) :
^r[0-9]{1,99}-sn-[a-z0-9]{1,99}-[a-z0-9]{1,99}\.googlevideo\.com$
^r[0-9]{1,99}-sn-[a-z0-9]{1,99}[a-z0-9]{1,99}\.googlevideo\.com$

Please put this on priority. Need this for the benefit of AdGuard Community. I am not a good RegEx coder as my trials failed.
Or make AdGuard Home accept Pi-Hole like RegEx syntax so it can be a copy paste.


Admin : Please delete this or the reply i posted in another thread as you see fit or move to correct subforum. [ https://forum.adguard.com/index.php?threads/does-adguard-block-youtube-ads.42371/#post-214736]
 

Boo Berry

Moderator + Beta Tester
Moderator
AG Home can't block YouTube ads, as Google serves ads using the same domains they serve video content for, so blocking the ads breaks the videos.

Chances are your friend is using another ad blocker (e.g. browser extension ad blocker which can do cosmetic filtering) alongside Pi-Hole.
 

streamsurfer

New Member
I understand your point mod. I also understand that Google is using the same servers but Ad blocking is working for him.My Friend isn't using anything else besides Pi-Hole list on his server in chrome/edge. Atleast try should be done instead of giving up.

This regex below identifies the ad server & blocks it per him.
I am not a RegEx Expert hence asking help in this forum.
I need help in what to write in AdGuard Home > Filters > Custom Filtering Rules.
Can you please tell me what should i put in for two rules. One of them should work. Hence i need it so i can simply paste it and try. If not i can remove these custom filtering rules but kindly request you to not simply close this post. at least give me the regex syntax to check myself.

Need to try for YT Ads (1st one worked for my friend using Pi-Hole) :
^r[0-9]{1,99}-sn-[a-z0-9]{1,99}-[a-z0-9]{1,99}\.googlevideo\.com$
^r[0-9]{1,99}-sn-[a-z0-9]{1,99}[a-z0-9]{1,99}\.googlevideo\.com$
 

Snapsz

New Member
Hello!
This is my Pi-Hole regex entry. I developed this. I just switched to AdGuard Home and it works fine for me too. It blocks ads from a dns server that is not the same as youtube video. It blocks about 50% of ads from Youtube videos.

Copy this: AdGuard Home > Filters > Custom Filtering Rules

! Youtube blacklist by Snapsz
/^r[0-9]+-+sn-+[a-z0-9]+-+[a-z0-9]+\.googlevideo\.com$/
 

Boo Berry

Moderator + Beta Tester
Moderator
Unfortunately you have to be careful blocking anything with the googlevideo.com domain, as doing so can just as easily break the videos too. Just because it may work for you (which could rely on geolocation, your Google account, etc.) doesn't mean it will work for everyone else.

That's why it's not recommended to attempt blocking YouTube ads via HOSTS or DNS. If anyone decides to try this, do know you're on your own doing so, and that it could break videos.
 

WeirdG

New Member
Update:

! Youtube blacklist by Snapsz
/^[a-z0-9]+-+sn-+[a-z0-9]+-+[a-z0-9]+\.googlevideo\.com$/

View attachment 22711
View attachment 22712
Thanks for sharing, this worked to get rid of SOME ads. When going through the Query Log, I noticed some YouTube ad URLs were displayed a little differently and not being blocked. I made a minor change to your rule and quickly realized why you did things the way you did. If you try to block ALL YouTube ads, YouTube won't work properly. The best you can do is use the rule you shared.

I guess blocking SOME ads is better than no ads at all. I was testing using the YouTube app on my LG smart TV.
 

Boo Berry

Moderator + Beta Tester
Moderator
Honestly, if you want to block YouTube ads, especially on smart TVs, Google/Android TV devices, etc. getting a YouTube Premium subscription is probably the best option.
 

WeirdG

New Member
Honestly, if you want to block YouTube ads, especially on smart TVs, Google/Android TV devices, etc. getting a YouTube Premium subscription is probably the best option.
I wouldn't use YouTube Premium enough to justify the cost. Plus, I don't agree with a lot of YouTube's changes over the years which have negatively impacted content creators and viewers, so the last thing I want to do is give them money by subscribing to their service.

So far with that one added rule to AGH, the YouTube ads have been reduced so the experience is much more tolerable. If I get annoyed enough or things start to break, then I'll just sideload SmartTubeNext onto my Firestick and use that instead of the YouTube app.
 
Top