清理代码
This commit is contained in:
18
config.py
18
config.py
@@ -262,6 +262,13 @@ class AppConfig(BaseSettings):
|
||||
sentinel_api_key: Optional[str] = Field(default=None, description="API Key")
|
||||
sentinel_module_name: Optional[str] = Field(default=None, description="模块名称")
|
||||
|
||||
# Sentinel 内部配置
|
||||
sentinel_debug: bool = Field(default=False, description="Sentinel 调试模式")
|
||||
sentinel_sdk_path: str = Field(
|
||||
default="sdk/sdk.js",
|
||||
description="Sentinel SDK JS 文件路径(相对于项目根目录)"
|
||||
)
|
||||
|
||||
# ========== TLS 指纹配置 ==========
|
||||
tls_impersonate: Literal["chrome110", "chrome120", "chrome124"] = Field(
|
||||
default="chrome124",
|
||||
@@ -337,6 +344,17 @@ class AppConfig(BaseSettings):
|
||||
module_name=self.sentinel_module_name,
|
||||
)
|
||||
|
||||
@property
|
||||
def fingerprint_config(self) -> Dict[str, Any]:
|
||||
"""获取指纹配置"""
|
||||
return {
|
||||
"user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36",
|
||||
"screen_width": 1920,
|
||||
"screen_height": 1080,
|
||||
"languages": ["en-US", "en"],
|
||||
"hardware_concurrency": 8,
|
||||
}
|
||||
|
||||
def validate_config(self) -> List[str]:
|
||||
"""
|
||||
验证配置完整性,返回警告列表
|
||||
|
||||
Reference in New Issue
Block a user