mirror of
https://github.com/FutaGuard/LowTechFilter.git
synced 2025-06-21 05:21:02 +08:00
🐛 action 去除符號
This commit is contained in:
parent
ac9c78d80f
commit
12ec32f615
@ -1,5 +1,11 @@
|
||||
import re
|
||||
|
||||
with open('../hosts.txt', 'r') as files:
|
||||
data = files.read().splitlines()
|
||||
output = '\n'.join(e for e in list(filter(lambda x: not x.startswith('/') and not x.startswith('! regex'), data)))
|
||||
with open('../domains.txt', 'w') as newoutput:
|
||||
newoutput.write(output)
|
||||
newdata = '\n'.join(data[5:])
|
||||
desc = '\n'.join(x.replace('!', '#') for x in data[:5]) + '\n'
|
||||
|
||||
with open('../domains.txt', 'w') as output:
|
||||
pattern = r'(?<=^\|\|)\S+\.\S{2,}(?=\^)'
|
||||
desc += '\n'.join(re.findall(pattern, newdata, re.MULTILINE))
|
||||
output.write(desc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user