Skip to content

Search the pihole logs for youtube advertisement urls and add them to the blocklist.

Notifications You must be signed in to change notification settings

eLVee1991/youtubeblock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • r1---sn-
  • r2---sn-
  • r3---sn-
  • r4---sn-
  • r5---sn-
  • r6---sn-
  • r7---sn-
  • r8---sn-
  • r9---sn-
  • r10---sn-
  • r11---sn-
  • r12---sn-
  • r13---sn-
  • r14---sn-
  • r15---sn-
  • r16---sn-
  • r17---sn-
  • r18---sn-
  • r19---sn-
  • r20---sn-
  • .sn-

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):

About

Search the pihole logs for youtube advertisement urls and add them to the blocklist.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages