All Projects → foae → pihole-youtube-block

foae / pihole-youtube-block

Licence: MIT License
Scan pihole logs and block YouTube ads domains

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to pihole-youtube-block

mobiletrackers
A repository of telemetry domains and URLs used by mobile location tracking, user profiling, targeted marketing and aggressive ads libraries.
Stars: ✭ 118 (+107.02%)
Mutual labels:  pihole, pihole-blocklists, pihole-ads-list
Social-media-Blocklists
Social media DNS Blocklist for Pihole and AdGuard
Stars: ✭ 60 (+5.26%)
Mutual labels:  pihole-blocklists, youtube-blocker
youtube ad blocklist
This is an open project to maintain a list of domain names that serve YouTube ads
Stars: ✭ 541 (+849.12%)
Mutual labels:  youtube-ads, pihole
mifitxiaomipiholelist
MiFit/Xiaomi PiHole Bock List
Stars: ✭ 28 (-50.88%)
Mutual labels:  pihole, pihole-blocklists
pihole-blocklists
Domain blocklists for Pi-Hole that are free and open for use by everyone.
Stars: ✭ 13 (-77.19%)
Mutual labels:  pihole, pihole-blocklists
Windows.10.DNS.Block.List
Windows DNS Block List
Stars: ✭ 18 (-68.42%)
Mutual labels:  pihole, pihole-blocklists
raspbian10-buster
Raspbian 10 (Buster) Lite Setup: with Wireguard, Pi-hole, Unbound
Stars: ✭ 54 (-5.26%)
Mutual labels:  pihole
PiHoleWidgets
PiHole Widgets using JAVAFX
Stars: ✭ 67 (+17.54%)
Mutual labels:  pihole
yout
🔥 YouTube playlist player for desktop. Free, no YouTube ads, floating window. Available for Linux, Mac and Windows.
Stars: ✭ 82 (+43.86%)
Mutual labels:  youtube-ads
ansible-pihole
Bootstrap a Raspberry Pi with Ansible and install Docker + Pi-hole
Stars: ✭ 52 (-8.77%)
Mutual labels:  pihole
pi-hole-android-private-dns
Script to auto-install & configure Android Private DNS For Pi-Hole
Stars: ✭ 61 (+7.02%)
Mutual labels:  pihole
CodeDrop
Collection of scripts, libraries, and other quick go to grabs
Stars: ✭ 19 (-66.67%)
Mutual labels:  pihole
PiHole
This contains an ever-growing list of domains to be blocked using the Pi-Hole ad-blocker.
Stars: ✭ 56 (-1.75%)
Mutual labels:  pihole-blocklists
CyberSecurity-Box
Firewall-System based on OpenWRT or Pi-Hole with UnBound, TOR, optional Privoxy, opt. ntopng and opt. Configuration of the AVM FRITZ!Box with Presets for Security and Port-List. Please visit:
Stars: ✭ 20 (-64.91%)
Mutual labels:  pihole
xiaomi-dns-blocklist
PiHole DNS Blocklist Xiaomi Domains
Stars: ✭ 102 (+78.95%)
Mutual labels:  pihole-blocklists
pihole-antitelemetry
A research-based starter pihole list to improve your privacy
Stars: ✭ 286 (+401.75%)
Mutual labels:  pihole
Whitelist
A simple tool to add commonly white listed domains to your Pi-Hole setup.
Stars: ✭ 3,033 (+5221.05%)
Mutual labels:  pihole
kawai-scripts
Awesome user scripts
Stars: ✭ 15 (-73.68%)
Mutual labels:  youtube-blocker
macOS-PiholeShortcuts
Manage and monitor your Pi-hole® instance through your status bar
Stars: ✭ 43 (-24.56%)
Mutual labels:  pihole
pihole-stuff
blocklists, scripts, etc.
Stars: ✭ 28 (-50.88%)
Mutual labels:  pihole

Warning: it might block YouTube completely.

Ads are served through the same domains as normal video clips. Until I find a better solution, please be mindful of this issue and consider this as experimental.

pihole-youtube-block

Scans logs generated by pihole and extracts domains used to serve ads on YouTube

  • scans log files, including archived logs
  • can process multiple files in parallel
  • compiles a unique list with the extracted domains
  • offers the option to add (blacklist) the extracted domains directly to pihole
  • low memory footprint and extremely fast
  • no dependencies
  • you don't need to install anything (check bin folder)
Getting started
$ git clone https://github.com/foae/pihole-youtube-block.git
$ cd pihole-youtube-block
How to run if you have go installed
$ go run main.go
How to run it without having go installed
For ARM (Raspberry Pi and alternatives)
$ cd bin
$ ./ytblock-rpi
For all others
$ cd bin
$ ./ytblock

All gathered domains will be written to compiled_domains.txt
You can easily tweak the configuration; it has sensible defaults.

File config.json

  • "PIHOLE_LOGS_DIR": "/var/log/", – path to your pihole logs
  • "COMPILED_FILE_NAME": "./compiled_domains.txt", – name of the file used to collect all domains from logs
  • "LOG_FILE_NAME_PREFIX": "pihole.log" – if your pihole log files bear a different name, change this with the common prefix of your log files that you want scanned
  • "POP_CONFIRMATION_DIALOGUE": true – change to false to skip the confirmation dialogue and send the found domains directly to pihole without asking. Useful for scripting.
Example output
blana@raspberrypi:~/pihole-youtube-block/bin $ ./ytblock-rpi 
>>> Waiting for all jobs to finish...
2018/11/30 19:19:14 Finished processing file (/var/log/pihole.log) in (1.964928163s).
2018/11/30 19:19:16 Finished processing file (/var/log/pihole.log.1) in (3.518280066s).
2018/11/30 19:19:18 Finished processing file (/var/log/pihole.log.2.gz) in (5.431282712s).
>>> Done: (125) unique extracted domains written to (./compiled_domains.txt) in (5.48431123s)
-----------
Would you like to stick those (125) collected domains into *your* pihole? (y/n)
-----------
n
2018/11/30 19:19:20 No is a no. Bye.
License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].