Files
ai_wht_wechat/backend/config.dev.yaml

91 lines
3.8 KiB
YAML
Raw Permalink Normal View History

2026-01-06 19:36:42 +08:00
# 小红书Python服务配置 - 开发环境
# ========== 服务配置 ==========
server:
host: "0.0.0.0"
port: 8000
debug: true
reload: false # Windows环境不建议启用热重载
# ========== 数据库配置 ==========
database:
host: localhost
port: 3306
username: root
password: JKjk20011115
dbname: ai_wht
charset: utf8mb4
max_connections: 10
min_connections: 2
2026-01-10 21:46:50 +08:00
# ========== Redis配置 ==========
redis:
host: 127.0.0.1
port: 6379
password: ""
db: 0
pool_size: 10
2026-01-06 19:36:42 +08:00
# ========== 浏览器池配置 ==========
browser_pool:
idle_timeout: 1800 # 空闲超时(秒),已禁用自动清理,保持常驻
max_instances: 5 # 最大浏览器实例数
preheat_enabled: true # 是否启用预热
preheat_url: "https://creator.xiaohongshu.com/login" # 预热URL根据login.page自动调整
2026-01-23 16:27:47 +08:00
# ========== AdsPower指纹浏览器配置 ==========
adspower:
enabled: true # 是否启用AdsPower指纹浏览器用于小红书登录等场景
api_base: "http://127.0.0.1:50325" # AdsPower本地API地址
api_key: "e5afd5a4cead5589247febbeabc39bcb" # AdsPower API Key可选
user_id: "user_h235l72" # AdsPower用户ID可选
default_group_id: "0" # 默认分组ID
# 指纹配置
fingerprint:
automatic_timezone: true # 自动设置时区
language: ["zh-CN", "zh"] # 浏览器语言
user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" # User-Agent
2026-01-06 19:36:42 +08:00
# ========== 登录/绑定功能配置 ==========
login:
headless: false # 登录/绑定时的浏览器模式: false=有头模式(方便用户操作)true=无头模式
page: "home" # 登录页面类型: creator=创作者中心(creator.xiaohongshu.com/login), home=小红书首页(www.xiaohongshu.com)
# ========== 定时发布调度器配置 ==========
scheduler:
2026-01-23 16:27:47 +08:00
enabled: true # 是否启用定时任务
2026-01-06 19:36:42 +08:00
cron: "*/5 * * * * *" # Cron表达式(秒 分 时 日 月 周) - 每5秒执行一次(开发环境测试)
max_concurrent: 2 # 最大并发发布数
publish_timeout: 300 # 发布超时时间(秒)
max_articles_per_user_per_run: 2 # 每轮每个用户最大发文数
max_failures_per_user_per_run: 3 # 每轮每个用户最大失败次数(达到后暂停本轮后续发布)
max_daily_articles_per_user: 6 # 每个用户每日最大发文数(自动发布)
max_hourly_articles_per_user: 2 # 每个用户每小时最大发文数(自动发布)
headless: false # 浏览器模式: false=有头模式(可调试)true=无头模式(生产环境)
# ========== 防封策略配置 ==========
enable_random_ua: true # 启用随机User-Agent防指纹识别
min_publish_interval: 30 # 最小发布间隔(秒),模拟真人行为
max_publish_interval: 120 # 最大发布间隔(秒),模拟真人行为
# ========== 代理池配置 ==========
proxy_pool:
2026-01-23 16:27:47 +08:00
enabled: true # 启用大麦IP代理池每次登录使用不同IP
api_url: "https://api2.damaiip.com/index.php?s=/front/user/getIPlist&xsn=2912cb2b22d3b7ae724f045012790479&osn=TC_NO176707424165606223&tiqu=1"
# 大麦IP代理认证信息白名单模式可留空
username: "69538fdef04e1" # 代理用户名
password: "63v0kQBr2yJXnjf" # 代理密码
2026-01-06 19:36:42 +08:00
# ========== 阿里云短信配置 ==========
ali_sms:
access_key_id: "LTAI5tSMvnCJdqkZtCVWgh8R" # 从环境变量或配置文件读取
access_key_secret: "nyFzXyIi47peVLK4wR2qqbPezmU79W" # 从环境变量或配置文件读取
sign_name: "北京乐航时代科技" # 短信签名
template_code: "SMS_486210104" # 短信模板CODE
code_expire_minutes: 5 # 验证码有效期(分钟)
# ========== 日志配置 ==========
logging:
level: DEBUG
format: "[%(asctime)s] [%(levelname)s] %(message)s"