Skip to content

elmoiv/PyAds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyAds

Simple ad blocker using the hosts file.

Features

  • You can block as many ad providers as you want.
  • Your cat can use this code.

How to Use

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