Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Block Youtube ads

I’m trying to block the annoying youtube ads with pihole but unfortunately it doesn’t work for me. The following is not viewed at all:

(rr[\d]{1}---[\s]{2}-[\s]{8}-[\w]{4})\.googlevideo\.com

Has anyone had similar experiences?

Examples look like this

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

rr1---sn-8xgn5uxa-quhl.googlevideo.com
rr1---sn-8xgn5uxa-quhl.googlevideo.com
rr3---sn-8xgn5uxa-quhz.googlevideo.com
rr6---sn-8xgn5uxa-quhl.googlevideo.com

>Solution :

Using [\s]{2} in the pattern (which can be written as \s{2} matches 2 whitespace chars, but in the example data there is sn

The single meta characters in this case do not have to be placed between square brackets.

Looking at some documentation on this page \w \s and \d are not supported.

You might use

rr[[:digit:]]---sn-[[:alnum:]]{8}-[[:alnum:]]{4}\.googlevideo\.com

The pattern matches:

  • rr[[:digit:]] Match rr and a single digit
  • ---sn- Match literally
  • [[:alnum:]]{8} Match 8 alphanumerics
  • -[[:alnum:]]{4} Match - and 4 alphanumerics
  • \.googlevideo\.com Match .googlevideo.com

See a regex demo.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading