New ads domain from youtube/google video

I've just found that Goolge and Youtube use

r4---sn-42u-i5ole.googlevideo.com
r6---sn-42u-i5ole.googlevideo.com

as a new domain for ads now

There's a whole thread dedicated to youtube ad serving hosts:

1 Like

I managed to come up with a regex for the googlevideo ones that will capture across all of the variants in the urls. listed below. It's not the prettiest thing in the world, but it gets the job done without being too greedy and without lookaheads or lookbehinds. Shouldn't be too aggressive as far as evaluating regex. feel free to correct me though. You can test in regex101 if you feel like tooling around with it. let me know if you come up with a better one.

regex:

PCRE (may work. ymmv)

^(r\d{1,2})(---|\.)(sn-)(([[:alnum:]]{1,8})|([[:alnum:]]{1,7}-[[:alnum:]]{1,4}))(\.googlevideo\.com)$
POSIX ERE (confirmed working but will block all googlevideo streaming sources per EDIT 2)

^r([0-9]{1,2})(---|\.)(sn-)(([A-Za-z0-9]{1,8})|([A-Za-z0-9]{1,7}\-[A-Za-z0-9]{1,4}))(\.googlevideo\.com)$

sample entries:

r1---sn-8xgp1vo-p5qe.googlevideo.com
r4---sn-p5qlsnz6.googlevideo.com
r4---sn-vgqs7nez.googlevideo.com
r4.sn-vgqs7nez.googlevideo.com
r17---sn-vgqsenes.googlevideo.com
r2---sn-vgqs7n7k.googlevideo.com
r1---sn-vgqsen7z.googlevideo.com
r1.sn-vgqsen7z.googlevideo.com
r20---sn-vgqs7ne7.googlevideo.com
r20.sn-vgqs7ne7.googlevideo.com

Edit: didn't read the docs and used PCRE regex instead of posix ere. Will update when fixed.

Edit 2: fixed the regex for POSIX ERE, but found out that youtube hosts the ads at the same domains as the videos themselves. basically they route your request to one of the googlevideo servers and the ad is injected directly into video stream as PART of the video. uBlock and pihole ftw on this one. I'm going to try doing some wireshark'ing on my home network to see if I can narrow it down further.