mirror of
https://github.com/FutaGuard/LowTechFilter.git
synced 2025-08-27 15:06:58 +08:00
Compare commits
3 Commits
9c81426974
...
5f29a595f0
Author | SHA1 | Date | |
---|---|---|---|
|
5f29a595f0 | ||
|
ac3ac2b63a | ||
|
29c8a67b9e |
@ -79,9 +79,10 @@ async def to_hosts(filename: str, data: str, newversion: str):
|
||||
with open(newfilename, "w") as output:
|
||||
if name == "hosts":
|
||||
pattern = r"(?<=^\|\|)\S+\.\S{2,}(?=\^)"
|
||||
newoutput = "\n".join(
|
||||
"0.0.0.0 " + e for e in re.findall(pattern, newdata, re.MULTILINE)
|
||||
)
|
||||
newoutput = ""
|
||||
for e in re.findall(pattern, newdata, re.MULTILINE):
|
||||
if "*" not in e:
|
||||
newoutput += "0.0.0.0 " + e + "\n"
|
||||
else:
|
||||
newoutput = "\n".join("0.0.0.0 " + e for e in data)
|
||||
output.write(newhead)
|
||||
|
Loading…
x
Reference in New Issue
Block a user