---
name: youtube-processor
description: Download YouTube video with Russian subtitles, ready for Telegram
---

When the user wants to download a YouTube video with Russian subtitles burned in:

1. **Ask** for the YouTube URL if not provided.

2. **Ask** for the output directory (default: `~/Downloads`). Always confirm with the user before proceeding.

3. **Download the video** using the `download_video` MCP tool:
   - Pass the URL and output directory
   - If the tool returns an `error`, show it to the user and stop
   - Parse the returned JSON to get the video `path`

4. **Extract subtitles** using the `extract_subs` MCP tool:
   - Pass the URL and output directory
   - Parse the returned JSON:
     - If `error` is present → tell the user no subtitles found, ask if they want to proceed without subtitles (just keep the downloaded video) or cancel
     - If `needs_translation` is `false` (Russian subs found) → skip to step 6
     - If `needs_translation` is `true` → English subs found, proceed to step 5

5. **Translate subtitles** (AI does this in chat):
   - Take the `content` from `extract_subs` result
   - The content is an SRT file with lines like:
     ```
     1
     00:00:01,000 --> 00:00:04,000
     Hello world
     ```
   - Translate ONLY the text lines (not the index numbers or timestamps)
   - Preserve the exact SRT structure — all timestamps, blank lines, and numbering must remain unchanged
   - Pass the translated content to `save_subs` with a filepath like `original_en_path` but with `.ru.srt` extension (e.g., `video.en.ru.srt`)
   - The `save_subs` tool returns the path to the saved file

6. **Burn subtitles into video** using the `burn_subs` MCP tool:
   - Pass the video path from step 3, the subtitle path from step 4 or 5
   - If no output path specified, the tool auto-generates one with `_subbed` suffix
   - If the tool returns an `error`, show it to the user

7. **Inform the user** where the final video is saved.

## Edge cases

- **Age-restricted videos**: yt-dlp may need browser cookies. If download fails with a restriction error, suggest the user try `--cookies-from-browser` manually or add cookies to yt-dlp config.
- **No subtitles at all**: Offer to keep the video without subs or cancel the operation.
- **Long videos**: For very long videos the burn step may take a while. Warn the user beforehand.
- **Translation quality**: When translating English SRT to Russian in chat, use a conversational machine-translation style. Keep all formatting (bold, italics, etc.) intact in the translated output. Preserve timing and numbering exactly.
