integrated_scraper.py 和 product_ai_analysis.py 两个文件合并

This commit is contained in:
2025-11-28 22:07:11 +08:00
parent 33f0e48bf5
commit 8fcf3bcfe2
23 changed files with 10998 additions and 18069 deletions

52
product/config.py Normal file
View File

@@ -0,0 +1,52 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
全功能产品系统配置文件
"""
import os
# 数据库配置
DATABASE_CONFIG = {
'tophub_db_path': os.path.join(os.path.dirname(os.path.dirname(__file__)), "tophub_data.db"),
'product_db_path': os.path.join(os.path.dirname(__file__), "products.db"),
}
# Chrome调试配置
CHROME_CONFIG = {
'debug_port': 9222,
'headless': False,
'timeout': 30,
}
# AI分析配置
AI_CONFIG = {
'api_url': "http://localhost:11434/api/generate",
'model': "qwen3:8b",
'timeout': 60,
'retry_count': 3,
'retry_delay': 5,
}
# 抓取配置
SCRAPING_CONFIG = {
'default_limit': 0, # 0表示不限制
'skip_duplicates': True,
'batch_size': 10,
'delay_between_requests': 2,
}
# 日志配置
LOGGING_CONFIG = {
'log_file': "integrated_product_system.log",
'log_level': "INFO",
'log_rotation': "10 MB",
'log_format': "<green>{time:YYYY-MM-DD HH:mm:ss}</green> | <level>{level: <8}</level> | <cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>",
}
# 分析配置
ANALYSIS_CONFIG = {
'max_products': None, # None表示分析所有产品
'batch_size': 1, # 每次分析的产品数量
'delay_between_analyses': 2, # 分析间隔(秒)
}