mirror of
https://github.com/minoplhy/filters-maker.git
synced 2024-12-22 18:18:13 +00:00
Maker Fix
This commit is contained in:
parent
033f815e61
commit
cf9a976075
@ -10,7 +10,7 @@ def linecounter(incoming):
|
||||
pass
|
||||
return i + 1
|
||||
|
||||
def domainsbuilding(excluded ,incoming,Version):
|
||||
def DNQbuilding(excluded ,incoming,Version):
|
||||
ankstanop = linecounter(incoming)
|
||||
with open(excluded ,'r') as f:
|
||||
exclude = f.read().split()
|
||||
@ -21,37 +21,16 @@ def domainsbuilding(excluded ,incoming,Version):
|
||||
f.write('# Description : My Very Personal DNS Blocklist plus crawling from the source\n')
|
||||
f.write('# Source : Resources/Source.txt\n')
|
||||
f.write('# Rule Counter : ' + str(ankstanop) +' Rules\n')
|
||||
f.write('# Format : Domains\n')
|
||||
f.write('# Format : Dnsmasq\n')
|
||||
f.write('# Type : Blocklist\n')
|
||||
f.write('# Version : ' + str(Version) +'\n')
|
||||
f.write('# Licenses : MIT\n')
|
||||
f.write('# Compiled Date : ' + str(date) +'\n\n')
|
||||
for line in lines:
|
||||
if line.strip() and not line in exclude and not line.startswith('#'):
|
||||
f.write('\n'.join([line + '\n']))
|
||||
f.write('\n'.join(['server=/' + line + '/\n']))
|
||||
elif line.startswith((';','$','@',' IN')):
|
||||
f.write('\n'.join([line + '\n']))
|
||||
elif not line.strip():
|
||||
f.write('\n'.join([line + '\n']))
|
||||
f.close()
|
||||
|
||||
def DNQallowlist(incoming, output,Version):
|
||||
ankstanop = linecounter(incoming)
|
||||
with open(incoming ,'r') as f:
|
||||
lines = f.read().splitlines() # read lines
|
||||
with open(output ,'w') as f:
|
||||
f.write('# Title : Minoplhy Personal Blocklist\n')
|
||||
f.write('# Description : My Very Personal DNS Blocklist plus crawling from the source\n')
|
||||
f.write('# Source : Resources/Source.txt\n')
|
||||
f.write('# Rule Counter : ' + str(ankstanop) +' Rules\n')
|
||||
f.write('# Format : Dnsmasq\n')
|
||||
f.write('# Type : Allowlist\n')
|
||||
f.write('# Version : ' + str(Version) +'\n')
|
||||
f.write('# Licenses : MIT\n')
|
||||
f.write('# Compiled Date : ' + str(date) +'\n\n')
|
||||
for line in lines:
|
||||
if line.strip() and not line.startswith(';'):
|
||||
f.write('\n'.join(['server=/' + line + '/\n']))
|
||||
elif line.startswith((';','$','@',' IN')):
|
||||
f.write('\n'.join([line + '\n']))
|
||||
f.close()
|
@ -28,30 +28,9 @@ def UNBbuilding(excluded ,incoming,Version):
|
||||
f.write('# Compiled Date : ' + str(date) +'\n\n')
|
||||
for line in lines:
|
||||
if line.strip() and not line in exclude and not line.startswith('#'):
|
||||
f.write('\n'.join([line + '\n']))
|
||||
f.write('\n'.join(['local-zone: "' + line + '" always_refuse\n']))
|
||||
elif line.startswith((';','$','@',' IN')):
|
||||
f.write('\n'.join([line + '\n']))
|
||||
elif not line.strip():
|
||||
f.write('\n'.join([line + '\n']))
|
||||
f.close()
|
||||
|
||||
def DMallowlist(incoming, output,Version):
|
||||
ankstanop = linecounter(incoming)
|
||||
with open(incoming ,'r') as f:
|
||||
lines = f.read().splitlines() # read lines
|
||||
with open(output ,'w') as f:
|
||||
f.write('# Title : Minoplhy Personal Blocklist\n')
|
||||
f.write('# Description : My Very Personal DNS Blocklist plus crawling from the source\n')
|
||||
f.write('# Source : Resources/Source.txt\n')
|
||||
f.write('# Rule Counter : ' + str(ankstanop) +' Rules\n')
|
||||
f.write('# Format : Unbound\n')
|
||||
f.write('# Type : Allowlist\n')
|
||||
f.write('# Version : ' + str(Version) +'\n')
|
||||
f.write('# Licenses : MIT\n')
|
||||
f.write('# Compiled Date : ' + str(date) +'\n\n')
|
||||
for line in lines:
|
||||
if line.strip() and not line.startswith(';'):
|
||||
f.write('\n'.join(['local-zone: "' + line + '" always_refuse\n']))
|
||||
elif line.startswith((';','$','@',' IN')):
|
||||
f.write('\n'.join([line + '\n']))
|
||||
f.close()
|
Loading…
Reference in New Issue
Block a user