Files
StudioLift/skills/youtube-studio-csv-download/references/troubleshooting.md

25 lines
2.0 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.

# 故障排查
## 登录态相关问题
- **运行后跳到 Google 登录页**URL 含 `accounts.google.com`):未复用登录态。改用 `--user-data-dir`(方式 A`--connect`(方式 B
- **报错 "user data directory ... is already in use" / "ProcessSingleton"**:该浏览器还没关。完全退出 Chrome/Edge 后再用方式 A。
- **`connect ECONNREFUSED 127.0.0.1:9222`**:调试端口没开。先 `chrome.exe --remote-debugging-port=9222`Edge 同理)再 `--connect`
- **连上了但仍未登录**`--channel``--user-data-dir` 品牌不匹配(例如 chrome 的目录配了 `--channel msedge`),或指向了没登录过的 profile。换正确的浏览器/目录。
## 环境与依赖
- **`playwright` / `sync_playwright` 找不到**:环境未同步。项目根执行 `uv sync`,或直接用 `uv run python <脚本>`;详见 `uv-env-setup` 技能。复用系统 Chrome/Edge 时无需 `playwright install chromium`
- **系统找不到浏览器**:确认本机装了 Chrome 或 Edge`--channel` 显式指定 `chrome``msedge`
## 运行过程
- **找不到「导出当前视图」按钮 / 点击超时**URL 不是 explore 页,或页面尚未加载完。务必用用户提供的 explore URL别用 overview URL。
- **没打印「已保存」(未捕获 csv_export 响应)**:导出未被触发,或登录态已失效。重试步骤 2必要时重新登录后重跑。
- **文件名变成 `export.zip` 而非标准命名**:请求体解析失败触发兜底,内容仍完整;检查日期范围与账号名是否正常。
- **中文/特殊字符文件名**:已把 Windows 非法字符 `\/:*?"<>|` 自动替换为 `_`,不会因文件名失败。
## 产物与去重
- **下载目录不存在导致写盘失败**:脚本不自动建目录。先建 `D:\Downloads`,或用 `--download-dir` 指定已存在目录。
- **重名文件**:自动按 `名称 (1).zip``名称 (2).zip` 递增;这是脚本自己的 dedup_path 逻辑,不依赖浏览器。