# exotic-amazon-v2 **Repository Path**: kazzz/exotic-amazon-v2 ## Basic Information - **Project Name**: exotic-amazon-v2 - **Description**: AI Agent 驱动的 Amazon 数据采集系统 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2026-04-18 - **Last Updated**: 2026-05-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Exotic Amazon V2 Amazon 数据采集编排服务。当前运行路径固定为 Playwright 连接 AdsPower 远程指纹浏览器 profile;代理由 AdsPower profile 自身管理,后端不再配置或注入代理。 ## 架构 ```text REST API (:8182/api) ├── /v2/crawl 任务提交、队列、调度控制 ├── /v2/data 产品、卖家、评论查询与清理 └── /v2/system 健康、指标、日志 │ ▼ SmartScheduler PENDING ──原子领取──▶ RUNNING ──执行租约──▶ 超时回收 │ ▼ PlaywrightCrawlEngine AdsPower profile → 页面加载 → 资源拦截 → 数据提取 → 质检 → 持久化 → 子任务生成 │ ▼ MongoDB · Redis · Metrics ``` 核心数据流:任务通过 REST API 创建,进入 MongoDB 队列;`SmartScheduler` 原子领取并分发给 `PlaywrightCrawlEngine`;引擎完成采集后可生成子任务,形成任务 workflow。 提取策略支持 `AUTO_FALLBACK`(Auto → LLM)、`AUTO_ONLY`、`LLM_ONLY`、`LLM_AUTO_HYBRID`,默认 `AUTO_FALLBACK`。 ## 项目结构 ```text src/main/kotlin/ai/platon/exotic/v2/ api/ REST 控制器、WebSocket、安全、CLI browser/playwright/ Playwright、AdsPower profile 连接和页面加载 core/ budget/ 浏览器打开流量预算 engine/ PlaywrightCrawlEngine、任务链生成 freshness/ 扫描目标新鲜度/缓存命中 scheduler/ SmartScheduler、恢复、限流、背压 extractor/ 提取调度 pipeline/ 数据持久化 quality/ 质量检查 extraction/ auto/ Auto Extraction llm/ LLM Extraction infrastructure/ Mongo Repository、Redis、事件、监控 shared/ 配置绑定、领域模型、工具类 ``` ## 技术栈 Kotlin 2.3 · Java 21 · Spring Boot 3.5 · Playwright · AdsPower · MongoDB 8.2 · Redis 8.6 · Maven ## 快速开始 ### 本地开发 依赖:JDK 21+、MongoDB、Redis、AdsPower 可访问 API、已配置代理的 AdsPower profile、LLM API Key。 ```powershell .\mvnw.cmd test .\mvnw.cmd spring-boot:run "-Dspring-boot.run.profiles=dev" ``` ### Docker Compose ```bash # .env MONGO_ROOT_PASSWORD=xxx REDIS_PASSWORD=xxx LLM_API_KEY=xxx EXOTIC_ADMIN_TOKEN=xxx FINGERPRINT_BROWSER_PROFILE_ID=k1chyvcv docker compose up -d --build ``` ### 端点 | 端点 | 地址 | | --- | --- | | API | `http://localhost:8182/api` | | Actuator | `http://localhost:8183/actuator/health` | | Swagger UI | `http://localhost:8182/api/swagger-ui.html` | ### 典型请求 ```bash BASE=http://localhost:8182/api TOKEN= curl -X POST "$BASE/v2/crawl/tasks" \ -H "X-Exotic-Admin-Token: $TOKEN" \ -H "Content-Type: application/json" \ -d '{"taskType":"ASIN_DETAIL","targetUrl":"https://www.amazon.com/dp/B08PNWG993"}' curl -H "X-Exotic-Admin-Token: $TOKEN" "$BASE/v2/crawl/queue/status" curl -H "X-Exotic-Admin-Token: $TOKEN" "$BASE/v2/data/products/B08PNWG993" ``` API 细节见 Swagger UI。管理端项目:`D:\workspace\python\adc-webapp`。 ## 关键配置 | 配置 | 默认 | 说明 | | --- | --- | --- | | `playwright.enabled` | `true` | 固定启用 Playwright | | `playwright.connect-mode` | `remote-profile` | 固定连接 AdsPower 远程 profile | | `fingerprint-browser.profile-id` | 空 | 单 profile;当前测试使用 `k1chyvcv` | | `fingerprint-browser.profile-ids` | 空 | 多 profile 轮转,逗号分隔 | | `playwright.browser.max-contexts` | `1` | 同时占用的 profile 槽位数 | | `playwright.resources.block-images` | `true` | 节省流量 | | `playwright.resources.block-media` | `true` | 节省流量 | | `playwright.resources.block-fonts` | `true` | 节省流量 | | `playwright.resources.block-stylesheets` | `true` | 节省流量 | | `exotic.browser-open-budget.enabled` | `true` | 浏览器打开流量预算 | | `exotic.scan-target-freshness.enabled` | `true` | CN_SELLER_SCAN 成功后写入扫描状态并支持缓存命中跳过 | | `exotic.scheduler.max-domain-qps` | `1` | 单域名 QPS 限制 | | `exotic.scheduler.max-child-tasks-per-parent` | `50` | 父任务子任务上限 | 代理相关配置已经从后端移除。需要更换代理时,直接在 AdsPower profile 中调整并重新测试。 ## 任务类型 `BEST_SELLERS` / `MOST_WISHED_FOR` / `NEW_RELEASES` / `MOVERS_SHAKERS` → 派生 `ASIN_DETAIL` → 派生 `REVIEW`、`SELLER_DETAIL` `CN_SELLER_SCAN` → 派生 `ASIN_SELLER_SCAN` → 派生 `SELLER_DETAIL` 另有 `PRICE_MONITOR`、`CUSTOM` 等类型。