Open rezapci opened 5 years ago
Sure!
If you do "crontab -e" on your Linux machine, you can add the following line:
* * * * * /bin/bash /home/link/to/file.sh
This will run the file every minute and it will look for new Ad URLS and add them to be blocked.
how to block you tube ad using raspberry pi (pi-hole)? please give steps
Hi need some help with this plz. I have downloaded your script & have it set up in my crontab but ads still come threw? Did I miss a step or something? Script ----
BL=/var/www/html/bl.txt mv $BL $BL.bak || echo "unable to move $BL to $BL.bak" cat /var/log/pihole.log | grep -o ".*.googlevideo.com" | cut -d" " -f6 | sort -t r -k 2 -n | uniq > $BL cat $BL $BL.bak | sort -t r -k 2 -n | uniq > $BL.temp rm -rf $BL mv $BL.temp $BL chown pihole:pihole $BL pihole -g systemctl restart pihole-FTL
Crontab - e = */home/pi/youtube
Thanks
It's been awhile since I've used this so things could have changed. But there are a few things to keep in mind. As new google urls are found it will take time for the cronjob to add them. You may need to compare what google is using for ad urls and what the script is using since its a few years old. I don't remember this part, but quickly looking at the script I'm not sure if the script is sending the URLs to be blocked in PiHole or if PiHole needs to be pointed to look at the file. It's been a long time since I used this when I made it more for a PoC.
would you please direct us by more description on PiHoleDNS_script_autoblock_youtube_ads.txt