From c870400f9b1ac0b894577e2ecf05baa99c4fd0c5 Mon Sep 17 00:00:00 2001 From: Twilight <121682528+TG-Twilight@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:35:05 +0800 Subject: [PATCH] Update AdClose.py --- script/AdClose.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) 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)}