eLVee1991 / youtubeblock

Search the pihole logs for youtube advertisement urls and add them to the blocklist.
25 stars 5 forks source link

youtubeblock.py

This python file will search the pihole logs for youtube advertisement urls and adds them to the blocklist. Run this script once a day or after seeing advertisement.

For now it searches the logs for:

For me it seems that if I block all domain with "sn-5hne" in it, video's wont load. So this script skips these. Some adds will come through, but most will be blocked. Feedback is welcome!

as described in https://discourse.pi-hole.net/t/how-do-i-block-ads-on-youtube/253/237

run this command on pihole (over ssh):