純網域清單不添加標頭

This commit is contained in:
踢低吸 2024-02-24 00:21:28 +08:00
parent 7ae7c71867
commit 0cca8bdece

View File

@ -100,19 +100,12 @@ for category in filterlist:
data = data.splitlines()
newdata = '\n'.join(data)
name = filename.split('.txt')[0].split('_')[0]
heads: str = HEAD().__getattribute__('abp')
newhead = heads.format(
name=name + ' domains',
version=newversion
)
with open(name+'_domains.txt', 'w') as output:
if name == 'hosts':
pattern = r'(?<=^\|\|)\S+\.\S{2,}(?=\^)'
newoutput = '\n'.join(re.findall(pattern, newdata, re.MULTILINE))
else:
newoutput = '\n'.join(data)
output.write(newhead)
output.write(newoutput)
if filename in filterlist['hosts']:
to_pure_domain(filename, data)