Skip to content

Commit

Permalink
Update AdClose.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TG-Twilight authored Nov 15, 2024
1 parent 94ec615 commit c870400
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions script/AdClose.py
Original file line number Diff line number Diff line change
@@ -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)}
return {'list': format_domain(rule.domain_list), 'suffix': '.txt', 'comment': '#', 'total': len(rule.domain_list)}

0 comments on commit c870400

Please sign in to comment.