Skip to content

Commit

Permalink
修改 domain_suffix 逻辑错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Toperlock authored Dec 24, 2023
1 parent a35ea03 commit 0aeb330
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ def parse_list_file(link, output_directory):
result_rules = {"version": 1, "rules": []}

for pattern, addresses in df.groupby('pattern')['address'].apply(list).to_dict().items():
rule_entry = {pattern: [address.strip() for address in addresses]}
if pattern == 'domain_suffix':
rule_entry = {pattern: ['.' + address.strip() for address in addresses]}
else:
rule_entry = {pattern: [address.strip() for address in addresses]}
result_rules["rules"].append(rule_entry)

# 使用 output_directory 拼接完整路径
Expand Down

0 comments on commit 0aeb330

Please sign in to comment.