- 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/youtubeList.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
sudo crontab -e
add this line to it to make it runs every 4 hours
0 */4 * * * sudo /home/pi/youtube.sh >/dev/null
Where the script location is /home/pi/youtube.sh
more information about crontab https://crontab.guru