Files
intl_news/continuation.md
T
2026-07-18 16:13:52 +08:00

147 lines
4.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# continuation.md — English Financial News 项目状态
> 最后更新:2026-07-17
---
## 2026-07-17 修复
### domestic_crawl_8g.sh 无参崩溃
- `"$1"` 触发 `set -u``"${1:-}"`
- 已同步 Pi,语法检查通过
---
## 当前进度
```
M0 ✅ 项目骨架
M1 ✅ 新闻抓取(12/12 源,Pi headful Playwright + HTTP 代理)
M2 ✅ 正文提取(trafilatura + MD 回退,增量跳过已处理)
M3 ✅ 三层去重(L1 URL / L2 Content / L3 SimHashSQLite 指纹库)
M4 ✅ 翻译+事件抽取(DeepSeek v4-flash,事件去重 Prompt 约束)
M5 ✅ 向量生成(DashScope text-embedding-v31024 维)
M6 ✅ Qdrant 入库(本地文件模式,语义搜索验证)
M7 ✅ 全链路管道 + 日报(事件级去重 + AI 摘要分批合并 + 防截断)
M8 ✅ MCP 服务(FastMCP 5 个 Tool
```
---
## 架构变更(2026-07-14
### 之前
```
海外 M1 (crawl) → pack → rsync → Pi M2→M6 → 日报
```
### 现在
```
Pi M1 (headful+proxy) → Pi M2→M6 → 日报
(海外服务器不再参与流水线)
```
### 修改文件
| 文件 | 改动 |
|------|------|
| `configs/profiles/8g_headful.yaml` | proxy URL: `socks5://1080``http://127.0.0.1:3128` |
| `configs/system.yaml` | 调度时间 `06:00/12:00/18:00/22:00`,同步段标为参考 |
| `scripts/domestic_full.sh` | 重写:移除海外 SSH 触发/sync,2 步:M1 抓取 → 管道+日报 |
| `scripts/domestic_crawl_8g.sh` | 注释更新 |
| `scheduler/jobs.py` | 移除海外 crontab,国内统一 domestic_full.sh 每日 4 次 |
### 抓取能力测试结果
| 源 | 结果 | 说明 |
|----|------|------|
| Forexlive | ✅ 13/13 Web 100% | headful 绕过 RSS 限制,获取正文 |
| MarketWatch | ✅ 3 篇 Web 新增 | DataDome 部分破解 |
| SeekingAlpha | ✅ RSS 稳定 | 30 篇增量跳过,无需 Web |
| WSJ | ✅ RSS 稳定 | Dow Jones RSS 兜底 |
| Barron's | ✅ RSS 稳定 | Dow Jones RSS 兜底 |
| CNBC/Yahoo/ZeroHedge/Economist | ✅ RSS 稳定 | 增量跳过 |
| **Reuters** | ❌ DataDome captcha | headful+proxy+stealth 均无法绕过 |
| **FT** | ❌ 超时 | RSS 超时,首页无可用链接 |
| **Investing.com** | ❌ Cloudflare 拦截 | RSS 403Web 被 Cloudflare JS 挑战拦截 |
---
## 2026-07-14 会话成果
### Pi Shadowsocks 客户端部署
- `shadowsocks-libev` + `v2ray-plugin v1.3.2`arm64)已安装
- `ss-local` 配置 `0.0.0.0:1088`SOCKS5),systemd 已启用
- `privoxy` 配置 `0.0.0.0:3128`HTTP → SOCKS5),已运行
- 配置文件 `/etc/shadowsocks-libev/config.json` 已创建(服务端信息待用户填入)
### 全链路独立化
- 海外服务器不再承担 M1 抓取任务
- Pi 通过 `8g_headful` profile`EN_NEWS_PROFILE`)执行 headful Playwright + HTTP 代理抓取
- `domestic_full.sh` 简化为 2 步:M1 抓取 → 管道(含日报)
---
## 服务器状态
| 角色 | 地址 | 路径 | 状态 |
|------|------|------|------|
| 海外 | `ecs-user@8.217.19.253` | `/opt/intlgrab` | ⏸️ 不再参与流水线,crontab 待停用 |
| 国内 | `pi@192.168.1.160` | `/home/pi/intlnews` | ✅ 全链路独立运行 |
---
## 定时任务(待设置)
### Pi crontab(需用户手动执行 `crontab -e`
```
# 全流程:M1 抓取 → M2→M6 管道 → 日报
0 6 * * * cd /home/pi/intlnews && bash scripts/domestic_full.sh >> logs/full.log 2>&1
0 12 * * * cd /home/pi/intlnews && bash scripts/domestic_full.sh >> logs/full.log 2>&1
0 18 * * * cd /home/pi/intlnews && bash scripts/domestic_full.sh >> logs/full.log 2>&1
0 22 * * * cd /home/pi/intlnews && bash scripts/domestic_full.sh >> logs/full.log 2>&1
# Xvfb 开机自启
@reboot Xvfb :99 -screen 0 1280x1024x24 -ac +extension RANDR &
```
### 海外服务器 crontab(待停用)
```
# 当前仍在运行,需停用
# 0 6 * * * overseas_crawl.sh
# 0 11 * * * overseas_crawl.sh
# 0 17 * * * overseas_crawl.sh
# 0 23 * * * overseas_crawl.sh
```
---
## 待办事项
1. **用户填入 Shadowsocks 服务端信息** → 启动 ss-local
2. **Pi crontab 设置** → 全流程定时 + Xvfb 开机自启
3. **海外 crontab 停用**`crontab -e` 注释掉抓取调度
4. **Reuters / FT / Investing.com** → 反爬问题未解决,需后续策略
5. **日报新闻源单一问题** → 前次分析已定位根因(域名映射、RSS 摘要质量),未修复
---
## CLI 命令速查
```
uv run en-news crawl M1 全量(默认 profile
uv run en-news crawl --profile 8g_headful M1 headful + proxy
uv run en-news pipeline M2→M6 全链路
uv run en-news report M7 日报
uv run en-news search "query" M6 搜索
uv run en-news mcp-server M8 MCP
bash scripts/domestic_full.sh 全流程(M1→M6→日报)
bash scripts/domestic_crawl_8g.sh 仅 M1 headful
```