- The script will create a file with all the youtube ads found in hostsearch and from the logs of the Pi-hole
- it will append the list into a file called youtubeList.txt '/etc/pihole/blacklist.txt'
- this file will be added to the pihole adlists.txt
- The script will check all queriy logs for any Youtube ads and add it to the blacklist
it will be more effective if you add it the crontab
Steps:
1- Download the script from github using this command :
git clone https://github.com/kboghdady/youTube_ads_4_pi-hole.git
2- Create a scheduled task to run the script:
sudo crontab -e
Add this line to make it runs every 4 hours
0 */4 * * * sudo /home/pi/youTube_ads_4_pi-hole/youtube.sh >/dev/null
Where the script location is /home/pi/youTube_ads_4_pi-hole/youtube.sh
more information about crontab https://crontab.guru
Buy me a coffee via paypal