Ok, a few hours after the first tests comes again more frequent advertising. I have now created a list. I will try to keep them as up-to-date as possible. Feel free to test them.
At the moment I am using the list on the top of this thread and I have noticed that not all ads are blocked.
I will try out your updated list, thank you very much @Henning.
Yes it is and I think even with regex support we will end up in a over blocking dead end, because we can not be sure that all domains serve ads maybe some of them are vital to play the videos.
So it is. I am currently collecting my YT data to see if there are overlaps. Currently I have a domain which apparently transmits advertising and normal videos. But could also be a mistake on my part.
Using both dnsdumpster method from @Giblet and @Henning's list has worked well for me the last few days. Thanks
For dnsdumpster I use cron to update the list btw: 3 * * * * { /usr/local/bin/googlevideo-dns.py > /var/www/html/youtube.txt && /usr/local/bin/pihole -g; } >/dev/null 2>&1
And I added http://localhost/youtube.txt to /etc/pihole/adlists.list and added Henning's not-block-this.txt to /etc/pihole/whitelist.txt
You cannot use file:///youtube.list in adlists.list because gravity.sh uses cut -d'/' -f3 to determine the filename of the list
Previously I used a script to grep all googlevideo.com domains from pihole logs but as stated they also contain content. In case anyone still wants it: https://git.io/vyHPi
P.S. Some of these domains seems pretty ... interesting
$ whois $( host -4 -t a r2.sn-oxmua5txg-8pxe.googlevideo.com | awk '{ print $NF }' ) | grep '\(descr\|country\)'
descr: Google Node Server
country: AT
descr: Provider Local Registry Block
descr: next layer Telekommunikationsdienstleistungs- GmbH
$ host $( host r1.sn-j5ou8-cghs.googlevideo.com | awk '{ print $NF }' )
12.78.248.201.in-addr.arpa domain name pointer 201-248-78-12.dyn.dsl.cantv.net.
$ whois $( host r4.sn-qxau5-btqz.googlevideo.com | awk '{ print $NF }' ) | grep '\(descr\|country\)'
descr: DELTA Wimax Network
country: AZ
descr: Delta Telecom IP Range
descr: International Communication Operator
Hey so I have noticed that many of the domains that google uses for their ads are very similar except for the first section. See these examples that I pulled from ads that came up on youtube:
I would block one exactly like so: "r4---sn-ni5f-t8gl.googlevideo.com" only to have the same ad show up later with this domain: "r7---sn-ni5f-t8gl.googlevideo.com".
Seeing this pattern I decided to try using a wildcard like so: "sn-ni5f-t8gl.googlevideo.com" and it seems to have worked quite well. Currently I am only using these blacklisted wildcard domains to block youtube ads. I deactivated the adlist that was posted here just to verify and it still works quite well. I think that if this doesn't end up causing problems with desired video content then it could be a porwerful tool to help us weed out these ads.
Might have had a bit of a breakthrough here. check out this Reddit thread.
They have a list of domains, some of which aren't on any adlists that I have been using.
Using this list (minus the www.youtube.com/api/ entry cause that blocks access to the site entirely) in addition to the googlevideo.com entries we have collected I have had a much greater success rate in blocking ads.
It seems that google has a way of detecting when a specific googlevideo.com domain doesn't load and then tries to load an alternate. I noticed that an ad wouldn't load for 3-5 seconds like it does when it's blocked, but then the ad would play anyways after that pause. looking in the Query section of the ad console i could see it trying to load different domains before it found one that went through successfully as seen here:
Blocking absolutely everyrxxxsnxxxx.googlevideo.com prevented me from playing any videos on youtube (Win10 & Android). All the images and comments load, but if played the buffering circle keeps going for like a minute, followed by an error.
I compiled dnsmasq with regex patch especially to test this.