diff --git a/script/AdClose.py b/script/AdClose.py index 457d312..2d5eff4 100755 --- a/script/AdClose.py +++ b/script/AdClose.py @@ -1,18 +1,12 @@ +import json + def format_domain(List): - domain = [] + domain = ["#This rule is only used with AdClose", "", ""] for line in List: - domain_lines = f"{line.strip()}" + domain_lines = f"domain, {line.strip()}" domain.append(domain_lines) return domain -def format_regex(List): - regex = [] - for line in List: - regex_lines = f"{line.strip()}" - regex.append(regex_lines) - return regex - def build(rule): - list = format_domain(rule.domain_list) + format_regex(rule.regex_list) - return {'list': list, 'suffix': '.txt', 'comment': '!', 'total': len(list)} \ No newline at end of file + return {'list': format_domain(rule.domain_list), 'suffix': '.txt', 'comment': '#', 'total': len(rule.domain_list)}