Quark Subtitle Rescue
High-success, low-risk workflow for Quark 网盘字幕批处理。
What this skill solves
- - One-click style recovery for: “给电影文件夹所有子目录补字幕”
- Resume from partial progress after interruptions/429/timeout
- Reduce bad matches via strict retries and staged fallback
- Keep an auditable trail: progress, failures, and final completion report
Use this skill when
- - User asks for batch subtitles across many Quark subfolders
- Previous run is partially done and needs rescue/retry
- Need to switch subtitle providers for better hit rate
- Need safe rollback/checks after suspected wrong matches
Don’t use this skill when
- - User only needs subtitle for a single local file
- There is no valid Quark login/cookie context
Quick Start
- 1. Confirm tool root exists:
quark_subtitle_tool/. - Ensure config exists:
~/.config/quark_subtitle.json with valid cookie. - Activate venv:
source quark_subtitle_tool/venv/bin/activate. - Run staged workflow (below), do not jump directly to aggressive retries.
Minimal inputs expected
- - Quark target path (example:
全部文件/来自:分享/电影) - Subtitle preference (default: bilingual zh+en)
- Whether to allow Chinese-only fallback when bilingual is unavailable
Staged Workflow
Stage 1 — Baseline batch run
Run:
CODEBLOCK0
Check output:
Stage 2 — Strict retry on failures
Run strict retry (avoid broad fuzzy terms like director names):
CODEBLOCK1
Rule: prioritize title + year; avoid generic query terms.
Stage 3 — Folder-specific rescue
If one folder remains stubborn, run dedicated script for that folder with filename-derived queries (example scripts in
quark_subtitle_tool/*_retry.py).
Stage 4 — Final two/small-tail manual precision
For 1–5 leftovers, use explicit aliases (English original title + year), then run a targeted retry script.
Provider Order and Matching Policy
Default order:
- 1. OpenSubtitles
- SubHD (射手系)
- YIFY
- Legacy providers (podnapisi/subtis/tvsubtitles)
Policy:
- - If provider N hits, stop and do not query lower-priority providers.
- Default success target: bilingual (zh+en). If bilingual is unavailable, fall back to Chinese-only only when user allows it.
- Treat “search page hit” and “download hit” separately; only download hit counts as success.
Safety Guardrails (Mandatory)
- 1. Never use broad person-name queries (e.g., director name) for batch upload.
- If many files suddenly “succeed” with same query, run hash-based spot check before declaring success.
- If wrong-match batch is found, rollback before continuing.
- Produce a clear report: total / success / failed / pending folders.
Use helper:
CODEBLOCK2
Troubleshooting
Read references/troubleshooting.md when you see:
- - OpenSubtitlesCom Bad Request
- dogpile RegionNotConfigured
- 429 rate limits
- folder enter failures due to special chars
- delete/rollback auth failures
Resources
- -
scripts/report_progress.py: summarize completion from generated JSON reports. - INLINECODE11 : reusable decision flow for batch rescue.
- INLINECODE12 : common failures and mitigations.
Quark 字幕救援
针对夸克网盘字幕批处理的高成功率、低风险工作流。
本技能解决的问题
- - 一键式风格恢复:为电影文件夹所有子目录补字幕
- 从中断/429/超时后的部分进度恢复
- 通过严格重试和分阶段回退减少错误匹配
- 保留可审计的轨迹:进度、失败和最终完成报告
使用本技能的时机
- - 用户要求跨多个夸克子文件夹批量处理字幕
- 之前的运行部分完成,需要救援/重试
- 需要切换字幕提供商以获得更高命中率
- 在疑似错误匹配后需要安全回滚/检查
不使用本技能的时机
- - 用户只需要单个本地文件的字幕
- 没有有效的夸克登录/cookie上下文
快速开始
- 1. 确认工具根目录存在:quarksubtitletool/
- 确保配置文件存在:~/.config/quarksubtitle.json 包含有效的 cookie
- 激活虚拟环境:source quarksubtitle_tool/venv/bin/activate
- 按分阶段工作流执行(如下),不要直接跳到激进重试
最小输入要求
- - 夸克目标路径(例如:全部文件/来自:分享/电影)
- 字幕偏好(默认:双语 zh+en)
- 是否允许在双语不可用时回退到仅中文
分阶段工作流
阶段 1 — 基线批量运行
运行:
bash
python quarksubtitletool/batchsubtitlerunner.py
检查输出:
- - quarksubtitletool/quarkwork/batchprogress.json
- quarksubtitletool/quarkwork/batchfailures.jsonl
阶段 2 — 对失败项严格重试
运行严格重试(避免使用导演姓名等宽泛模糊术语):
bash
python quarksubtitletool/stricttop10retry.py
python quarksubtitletool/strictremainingretry.py
规则:优先使用标题 + 年份;避免通用查询术语。
阶段 3 — 特定文件夹救援
如果某个文件夹仍然顽固,使用基于文件名的查询为该文件夹运行专用脚本(示例脚本在 quark
subtitletool/*_retry.py 中)。
阶段 4 — 最终两/小尾巴手动精准处理
对于 1-5 个剩余文件,使用明确的别名(英文原标题 + 年份),然后运行针对性重试脚本。
提供商顺序和匹配策略
默认顺序:
- 1. OpenSubtitles
- SubHD(射手系)
- YIFY
- 传统提供商(podnapisi/subtis/tvsubtitles)
策略:
- - 如果提供商 N 命中,停止且不查询优先级更低的提供商。
- 默认成功目标:双语(zh+en)。如果双语不可用,仅在用户允许时回退到仅中文。
- 将搜索页面命中和下载命中分开处理;仅下载命中计为成功。
安全护栏(强制)
- 1. 批量上传时绝不使用宽泛的人名查询(例如导演姓名)。
- 如果许多文件突然使用相同查询成功,在宣布成功前运行基于哈希的抽查。
- 如果发现错误匹配批次,在继续前进行回滚。
- 生成清晰报告:总计/成功/失败/待处理文件夹。
使用辅助工具:
bash
python skills/quark-subtitle-rescue/scripts/report_progress.py
故障排除
当出现以下情况时,阅读 references/troubleshooting.md:
- - OpenSubtitlesCom 错误请求
- dogpile RegionNotConfigured
- 429 速率限制
- 因特殊字符导致文件夹进入失败
- 删除/回滚认证失败
资源
- - scripts/report_progress.py:从生成的 JSON 报告汇总完成情况。
- references/workflow.md:批量救援的可复用决策流程。
- references/troubleshooting.md:常见失败及缓解措施。