You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def __isConfigFile(self, filename):
file_stats = os.stat(filename)
if file_stats.st_size >= 4 * 1024:
return True
with open(filename, 'r', encoding='utf-8', errors='ignore') as f:
non_comment_lines = 0
for line in f:
line = line.strip()
if not line or line.startswith('!') or line.startswith('#'):
continue
non_comment_lines += 1
if non_comment_lines > 10:
return False
if (line.startswith('||') or line.startswith('@@') or '##' in line or
re.match(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s+\S+', line)):
return True
return False
The text was updated successfully, but these errors were encountered:
这块判断是不是粗暴了一些,一些小的规则如https://osint.digitalside.it/Threat-Intel/lists/latestdomains.piHole.txt 无法正确地被识别。设想是不是可以通过响应内容是不是html/json或者直接根据响应头和响应码来精确判断一下。
以下是某AI生成的代码,通过规则的特征判断的,考虑到小体积订阅规则数量不多,性能影响应该不大:
The text was updated successfully, but these errors were encountered: