Simple ad blocker using the hosts file.
- You can block as many ad providers as you want.
- Your cat can use this code.
import pyads
adblock = pyads.Adblock(hostDic, hostSrc)
adblock.parseHosts(adblock.getHosts())
-
hostDic : Location of the system hosts file.
-
hostSrc : List, tuple or set containing urls with hosts raw data see test.py.
-
if you want to revert the hosts file back:
adblock.cleanHosts()
MUST RUN THIS SCRIPT WITH ADMIN PRIVILEGES