mirror of
https://github.com/TG-Twilight/AWAvenue-Ads-Rule.git
synced 2025-11-04 14:49:47 +08:00
添加ipv6规则API&&修复 #71 错误
This commit is contained in:
parent
6cc145b92b
commit
d7900beb72
5
main.py
5
main.py
@ -11,6 +11,7 @@ OUT_PATH = os.getcwd() + "/out"
|
||||
domain_file=RULE_PATH + "/domain.txt"
|
||||
regex_file=RULE_PATH + "/domain_regex.txt"
|
||||
ip_file=RULE_PATH + "/ip.txt"
|
||||
ip6_file=RULE_PATH + "/ip6.txt"
|
||||
|
||||
if not os.path.exists(OUT_PATH):
|
||||
print(f"{OUT_PATH} 目录不存在!")
|
||||
@ -24,8 +25,10 @@ class RuleList:
|
||||
self.regex_list = file.readlines()
|
||||
with open(ip_file, 'r') as file:
|
||||
self.ip_list = file.readlines()
|
||||
with open(ip6_file, 'r') as file:
|
||||
self.ip6_list = file.readlines()
|
||||
|
||||
rule = RuleList(domain_file, regex_file, ip_file)
|
||||
rule = RuleList(domain_file, regex_file, ip_file, ip6_file)
|
||||
|
||||
def WriteFile(name, text, suffix):
|
||||
try:
|
||||
|
||||
@ -8,4 +8,6 @@ fork本分支,修改本目录的文件
|
||||
|
||||
`domain_regex.txt` 文件为`domain.txt`的正则表达式版本(并不是所有插件都会调用此规则)
|
||||
|
||||
`ip.txt` 文件为ip列表(并不是所有插件都会调用此规则)
|
||||
`ip.txt` 文件为ipv4列表(并不是所有插件都会调用此规则)
|
||||
|
||||
`ip6.txt` 文件为ipv6列表(并不是所有插件都会调用此规则)
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
123.56.23.22
|
||||
182.254.116.116
|
||||
203.205.137.89
|
||||
123.56.23.22/32
|
||||
182.254.116.116/32
|
||||
203.205.137.89/32
|
||||
0
rule/ip6.txt
Normal file
0
rule/ip6.txt
Normal file
Loading…
Reference in New Issue
Block a user