mirror of
https://github.com/StevenBlack/hosts.git
synced 2026-07-01 02:36:52 +00:00
add an optional blacklist file
The contents of this file (containing a listing of additional domains in 'hosts' file format) are appended to the unified hosts file during the update process.
This commit is contained in:
@@ -96,6 +96,7 @@ defaults = {
|
||||
"exclusionregexs" : [],
|
||||
"exclusions" : [],
|
||||
"commonexclusions" : ["hulu.com"],
|
||||
"blacklistfile" : os.path.join(BASEDIR_PATH, "blacklist"),
|
||||
"whitelistfile" : os.path.join(BASEDIR_PATH, "whitelist")}
|
||||
|
||||
def main():
|
||||
@@ -300,6 +301,11 @@ def createInitialFile():
|
||||
#Done in a cross-python way
|
||||
writeData(mergeFile, curFile.read())
|
||||
|
||||
if os.path.isfile(settings["blacklistfile"]):
|
||||
with open(settings["blacklistfile"], "r") as curFile:
|
||||
#Done in a cross-python way
|
||||
writeData(mergeFile, curFile.read())
|
||||
|
||||
return mergeFile
|
||||
|
||||
def removeDupsAndExcl(mergeFile):
|
||||
|
||||
Reference in New Issue
Block a user