thzxx
471818074d
feat(v2.4.0): 新增 E_BLOCKED 错误码——细分 fetch 403 反爬拦截
真实环境问题: 抓取被墙/反爬站点 (如 baike.baidu.com) 返回 403 时,
classify_error 统一归为 E_AUTH, AI Agent 会误判为凭证问题而做无效的
认证重试。被封锁不是认证失败。
改动:
- common.py: 新增 E_BLOCKED 错误码 + recovery_hint (提示换 URL/镜像/
用 Wayback 兜底/--exclude-domain); 新增 classify_fetch_error() 与
_extract_status_code(): fetch 场景 403→E_BLOCKED, 401→E_AUTH,
其余委托 classify_error (搜索场景 403 仍为 E_AUTH, 不变)
- fetch.py main(): 错误路径改用 classify_fetch_error (替代 classify_error)
- search.py: fetch_page 与 fetch_top_results 线程错误路径同样切换
- 新增 11 个测试 (test_v240_blocked_code.py), 全量 572 测试通过
- 真实环境验证: baike 403 → E_BLOCKED, 正常站点不受影响
- 文档同步 (SKILL.md/README.md 错误码表, 版本号 2.4.0)
2026-08-05 20:24:25 +08:00
..
2026-08-01 17:02:34 +08:00
2026-08-01 21:34:57 +08:00
2026-08-01 21:44:58 +08:00
2026-08-01 19:02:44 +08:00
2026-08-03 17:14:33 +08:00
2026-08-01 17:02:34 +08:00
2026-08-01 21:34:57 +08:00
2026-08-01 19:02:44 +08:00
2026-08-01 18:01:32 +08:00
2026-08-01 19:02:44 +08:00
2026-08-01 21:44:58 +08:00
2026-08-01 17:02:34 +08:00
2026-08-01 17:40:14 +08:00
2026-08-01 17:40:14 +08:00
2026-08-03 17:14:33 +08:00
2026-08-01 17:02:34 +08:00
2026-08-01 17:40:14 +08:00
2026-08-01 17:40:14 +08:00
2026-08-03 12:54:27 +08:00
2026-08-03 12:54:27 +08:00
2026-08-01 19:02:44 +08:00
2026-08-01 20:50:42 +08:00
2026-08-05 20:14:07 +08:00
2026-08-05 20:24:25 +08:00
2026-08-01 17:40:14 +08:00
2026-08-01 21:44:58 +08:00
2026-08-03 12:54:27 +08:00