1
0
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:
minoplhy 2021-09-29 22:10:01 +07:00
parent 033f815e61
commit cf9a976075
2 changed files with 4 additions and 46 deletions

View File

@ -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()

View File

@ -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()