AWAvenue-Ads-Rule/script/hosts.py
2024-09-14 19:05:15 +08:00

11 lines
352 B
Python
Executable File

def format_domain(List):
domain = ["127.0.0.1 localhost", "::1 localhost", "", ""]
for line in List:
domain_lines = f"127.0.0.1 {line.strip()}"
domain.append(domain_lines)
return domain
def build(rule):
return {'list': format_domain(rule.domain_list), 'suffix': '.txt', 'comment': '!', 'total': len(rule.domain_list)}