first
This commit is contained in:
@@ -8,6 +8,11 @@ from app.core.files import import_root
|
||||
|
||||
|
||||
DOMAIN_PATTERN = re.compile(r"^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+(com|net)$", re.IGNORECASE)
|
||||
SOURCE_TYPE_LABELS = {
|
||||
6: "手工录入",
|
||||
7: "TXT 导入",
|
||||
9: "其它",
|
||||
}
|
||||
|
||||
|
||||
def normalize_domain(value: str) -> str | None:
|
||||
@@ -92,6 +97,8 @@ def import_domains_from_path(file_path: Path, source_type: int = 7) -> dict:
|
||||
}
|
||||
return {
|
||||
"filename": file_path.name,
|
||||
"source_type": source_type,
|
||||
"source_label": SOURCE_TYPE_LABELS.get(int(source_type or 7), "未知"),
|
||||
"stats": stats,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user