How do I block ads on YouTube?

Assuming your information is correct, I couldn't resist the scripting opportunity. Here is what I came up with to generate the list:

# Array of fingerprints
# Add new ones here and the script below will generate the list
fingerprints=(sn-8xgp1vo-xfgk
sn-8xgp1vo-xfge7
sn-p5qlsnll
sn-a5mekner
sn-vgqs7nez
sn-vgqs7n7k
sn-vgqsenes)

# For each fingerpint, 
for ((i = 0; i < "${#fingerprints[@]}"; i++)); do
  # Generate the list based on https://discourse.pi-hole.net/t/how-do-i-block-ads-on-youtube/253/11?u=jacob.salmela
  echo r{1..20}---${fingerprints[$i]}.googlevideo.com
  echo r{1..20}.${fingerprints[$i]}.googlevideo.com
done

You can also continue to use the brace expansion to calculate every fingerprint possibility with something like this:

echo sn-{{a..z},{0..9}}{{a..z},{0..9}}{{a..z},{0..9}}{{a..z},{0..9}}{{a..z},{0..9}}{{a..z},{0..9}}{{a..z},{0..9}}{{a..z},{0..9}}

which will run through every possibility from sn-aaaaaaaa to sn-99999999. I think...

Not sure if dnsmasq could even handle all of those :question:...

1 Like