yt-transcript
/yt-transcript
Zamienia transkrypcje filmów YouTube i B站 w ustrukturyzowane notatki Obsidian, z podsumowaniem i rozdziałami.
- Repozytorium
- jarvis-skills-and-prompts ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 05.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 5
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 2
Brak sygnałów. Repozytorium zmienione 05.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Zamienia transkrypcje filmów YouTube i B站 w ustrukturyzowane notatki Obsidian, z podsumowaniem i rozdziałami.
Wyzwalacze z opisu
Oryginalny opis (EN)
Process YouTube and Bilibili video transcripts into structured Obsidian notes. Triggers when the user provides YouTube or Bilibili URL(s) and asks to process, structure, or summarize the transcript. Also triggers on: 'YouTube transcript', 'YouTube结构化', 'B站结构化', '视频转录', 'podcast结构化', '处理YouTube', '处理B站视频', '/yt-transcript', or any request involving converting YouTube / Bilibili videos into notes. Even if the user just pastes a YouTube or Bilibili URL with minimal instruction like '帮我处理一下' or 'structure this', use this skill.
Jak działa
- How It Works
- Usage
- Step-by-step Instructions for Claude
- Important Notes
Podgląd SKILL.md
---
name: yt-transcript
description: "Process YouTube and Bilibili video transcripts into structured Obsidian notes.
Triggers when the user provides YouTube or Bilibili URL(s) and asks to process, structure,
or summarize the transcript. Also triggers on: 'YouTube transcript',
'YouTube结构化', 'B站结构化', '视频转录', 'podcast结构化', '处理YouTube', '处理B站视频', '/yt-transcript', or any
request involving converting YouTube / Bilibili videos into notes. Even if the user just
pastes a YouTube or Bilibili URL with minimal instruction like '帮我处理一下' or 'structure
this', use this skill."
metadata:
copilot-enabled-agents: claude,opencode,codex
---
# yt-transcript
Process YouTube and Bilibili video transcripts into structured Obsidian notes using the **Verbal Content Input Structuring** workflow. A Python script structures each transcript. Your job is to run it, QC each note, append a `## Jarvis Interpretation` section to each note through one sub-agent per note, and report the results.
## How It Works
The script at `.scripts/yt_transcript_processor.py` does everything end-to-end. It detects the platform from the URL (`bilibili.com` / `b23.tv` / `BV…` id → Bilibili, everything else → YouTube):
1. **Fetches video metadata** (`yt-dlp --dump-json`): real title, channel, and **`upload_date`**. The `upload_date` is the authoritative source for the note's date — never the LLM's guess. YouTube: plain invocation first, cookies + remote-components fallback. Bilibili: always with browser login cookies from the browser named in `YTDLP_COOKIES_BROWSER` (bilibili answers 412 without them).
2. **Fetches transcript**:
- YouTube: `youtube-transcript-api` → `yt-dlp` subtitles. Supports English, Chinese (Simplified/Traditional), and auto-generated subtitles.
- Bilibili: `yt-dlp` subtitles with browser cookies (`ai-zh` = Bilibili AI subtitles; they only appear with login cookies and are absent from `--dump-json`'s subtitle list) → Soniox ASR fallback (best audio uploaded via `/v1/files`, `stt-async-v6`; needs `SONIOX_API_KEY`).
3. **Processes via OpenRouter API** (DeepSeek V4.1 Flash `deepseek/deepseek-v4.1-flash-1017`, 1M context window, reasoning effort `high`, provider routing sorted by throughput):
- Step 1: Structures the transcript per the Verbal Content Input Structuring - CN prompt
- Step 2: Quality check + detail enrichment in the same conversation
- The `temperature` values passed (0.7 / 1.0) have no effect in DeepSeek's thinking mode; they only apply if effort is set to `none`
- Override per run with `STRUCTURING_MODEL` / `STRUCTURING_EFFORT` / `STRUCTURING_MAX_TOKENS` env vars (rollback example: `STRUCTURING_MODEL=google/gemini-2.5-flash STRUCTURING_MAX_TOKENS=65536`)
4. **Generates title**: Separate API call producing `<Platform> - Author - Chinese title - YYYYMMDD`. Two deterministic overrides follow: the trailing date is overwritten with the real `upload_date` (the LLM cannot see it and hallucinates training-era dates), and the first segment is forced to `YouTube` or `Bilibili` (any `B站`/`哔哩哔哩` variant the model wrote is replaced, never duplicated).
5. **Trims output**: Extracts content from the real, line-anchored `### Key Logic` heading onwards. The `(?m)^` anchor is essential — it skips any *quoted* "### Key Logic" mention inside the model's self-check preamble (which would otherwise leak meta-commentary into the note).
6. **Repairs Obsidian syntax** (`fix_syntax`): deterministically fixes the systematic errors the structuring model emits — `==text]]` → `==text==` (highlight closed with the wikilink delimiter), `**==X==**` → `==X==` (bold fully overlapping a highlight), `<b>`/`</b>` → `**` (HTML→markdown bold), and collapses accidental `====`. Then `validate_syntax` prints `⚠` warnings for residual issues that need manual review (unbalanced `**`, year/date wrapped in `[[wikilink]]`, etc.) — these are not safely auto-fixable.
7. **Prepends the note header**: a `create_time` frontmatter block rendered at save time, then the source heading, then `### Key Logic`:
```
---
create_time: YYYY-MM-DD HH:mm
tags: []
---
## [<real video title> - YouTube|Bilibili](<video url>)
### Key Logic
```
Square brackets in the title are escaped so titles like `Foo [Part 2]` don't break the link.
8. **Saves** the final `.md` note to `※INBOX/`.
The script reads prompt templates directly from vault files at runtime (`smart prompts/Input Structuring/Verbal Content Input Structuring - CN.md` and `caret/CoT Prompting for caret.md`), so any prompt updates in the vault are automatically reflected.
## Usage
Run the script from the vault root with Python 3.10+ that has the required packages (see `README.md` in this folder; a venv such as `~/.venvs/jarvis-skills/bin/python` works). `OPENROUTER_API_KEY` must be set in the environment:
```bash
# Single URL (YouTube or Bilibili)
python3 .scripts/yt_transcript_processor.py "https://www.youtube.com/watch?v=VIDEO_ID"
python3 .scripts/yt_transcript_processor.py "https://www.bilibili.com/video/BVxxxxxxxxxx/"
# Multiple URLs (sequential)
python3 .scripts/yt_transcript_processor.py "URL1" "URL2" "URL3"
# Multiple URLs (parallel, up to 3 workers)
python3 .scripts/yt_transcript_processor.py "URL1" "URL2" "URL3" --parallel
# Custom parallelism
python3 .scripts/yt_transcript_processor.py "URL1" "URL2" --parallel --max-workers 5
```
If you structure a transcript by any other route (e.g. a hand-fixed ASR transcript), use `copilot/skills/audio-transcribe/scripts/structure_verbal_content.py` with `--platform YouTube|Bilibili --source-title "<real video title>" --source-url "<url>" --upload-date YYYYMMDD`. It produces the same frontmatter, filename prefix and heading.
## Step-by-step Instructions for Claude
1. **Extract YouTube / Bilibili URLs** from the user's message. Accept any format: full URLs (tracking params like `?vd_source=` are fine), shortened youtu.be / b23.tv links, or video IDs.
2. **Decide execution mode**:
- 1 URL → run directly (no flags)
- 2-3 URLs → use `--parallel`
- 4+ URLs → use `--parallel --max-workers 5`
3. **Run the script** using Bash. The script typically takes 2-5 minutes per video (longer for podcasts 2+ hours). Use `run_in_background=true` if processing multiple URLs or if the user wants to continue working.
```bash
python3 .scripts/yt_transcript_processor.py "URL"
```
4. **QC the saved note** before reporting:
- Line 1–4 is the ctime frontmatter, line 5 is `## [<real title> - <Platform>](url)`, and the filename starts with `YouTube - ` / `Bilibili - ` and ends with the real upload date. A heading that shows the raw URL means metadata failed: re-fetch it and fix heading + filename.
- Delete any prompt-template text that leaked into the Key Logic paragraph (e.g. "此对话/演讲/录音的 core message…").
- Check speaker / entity names against the video title, description and context; ASR and AI subtitles mishear names (e.g. a speaker's Chinese name fused with his English name) and the model turns them into invented `[[Pinyin Name]]` entities. Verify unclear speakers online and unify each entity to one link target.
- Run the post-run QC checklist: wikilink direction (target is the English formal name, Chinese goes in the alias, `[[World Model|世界模型]]`, never `[[世界模型|World Model]]`), noun-spam links (unlink lowercase common nouns, especially inside verbatim quotes), numbers inside wikilinks (`[[30]]`, `[[1990s]]`, `[[两年]]` become `==highlight==`; `validate_syntax` only catches `[[2025]]`-style years), bold structure (no line may start with `**- `, which breaks the list; whole-bullet bold marks only the important bullets, not every line).
- **Flag speaker errors in the body with a warning callout.** When a speaker (guest or host) states a wrong fact, wrong arithmetic, or a number that conflicts with another source, keep the bullet verbatim and add a callout right after the group that contains it. The reader then sees both the original words and the fact-check result. This applies to errors found at QC and to errors that the interpretation step finds.
- Write every callout line at column 0 (`> `), never indented. An indented callout renders as a code block and swallows the next bullet.
- Place it after the last line of the top-level bullet's group (the top-level `- ` line plus all its TAB-indented children), so it sits before the next top-level `- `, heading or blank line. Never insert it between TAB-indented children: the children after it lose their parent and render wrong. Put one blank line before and after it. When several callouts belong to the same group, stack them in body order with a blank line between them.
- Do not change the indentation of any body line while you insert callouts.
- Title by type: `> [!warning] 事实核对:<主题>` (wrong fact, give the correct value), `> [!warning] 口径核对:<主题>` (internal inconsistency or arithmetic, show the calculation), `> [!warning] 存疑:<主题>` (conflicting evidence that cannot be settled, list the candidate explanations).
- Body: one to three sentences, or `> - ` bullets for several points. State the correct value or the check result, highlight numbers, label derived numbers 「(我的计算)」, end with `(来源:…)`. A vault source is a `[[note title|短名]]` link.
- Never "correct" a value inside the speaker's verbatim bullet. Only the callout carries the correction.
5. **Write the Jarvis Interpretation** for every note that passed QC. Skip this step only if the user says so.
- **Prepare inputs**: create the batch folder with `python3 .scripts/tmpdir.py new <batch task name>`. Dump each raw transcript (`youtube_transcript_api`, or the Soniox text) and each video description (`yt-dlp --print`) into `.tmp/<batch task name>/raw/`. The QC step can share these files.
- **Decide 101 per note** (`101 = YES` adds a 101 解读 block before the core-logic part). Check vault coverage first:
- Search the vault for the video's main topic and the speaker's company: a semantic search tool if you have one (for example the Miyo plugin), plus Grep/Glob for exact names, tickers and Chinese–English variants.
- Answer `101 = YES` when one of these is true: the topic has no thematic notes (only passing mentions, or roughly ≤5 notes); the speaker's company is new to the vault; or the content is technical beyond the user's working knowledge (e.g. quantum cryptography, a CRE lending structure).
- Answer `101 = NO` for topics the vault already covers densely. The user already knows that background.
- When only part of a video is unfamiliar, set `101 = YES` and scope it to that part, telling the sub-agent what to skip.
- **Spawn one sub-agent per note, all in one message** (`general-purpose`, background). Each prompt is the task block at the end of `references/interpretation.md`, filled in with: note keyword, video id and raw transcript path, the 101 decision and its scope, the batch name for the image folder, and 2–4 claims or consensus views worth testing against the vault. The brief carries every rule the sub-agent needs. Wait for all of them; if one fails or stalls, report its state and do not present partial results as complete.
- **Verify centrally** after all sub-agents return. Check every note with Python, and match the note by its full filename, because a speaker's name alone also matches older vault notes:
- exactly one `\n## Jarvis Interpretation`, placed after the tag line;
- `[[`/`]]` and `==` pairing, even `**` on every line, no mixed delimiters, no 破折号 outside wikilinks;
- every `![[image]]` exists;
- every note-title wikilink resolves to an existing file;
- every speaker error listed in the sub-agent reports has a `[!warning]` callout after its top-level group. Insert any missing ones yourself. Assert that no line matches `^\t+>` and that no callout line is followed by a TAB-indented line (blank lines skipped).
Open at least one chart and one 101 opening with Read to check readability.
6. **Report results** to the user:
- Which videos succeeded/failed
- The saved file path(s) in `※INBOX/` using wikilink format: `[[※INBOX/title.md]]`
- Which transcript source was used (platform subtitles or Soniox ASR) and any low-confidence corrections
- For failures, explain the error (transcript unavailable, API error, etc.)
- The 101 decision per note and its basis (vault coverage)
- Per note: the most important interpretation findings (factual errors found in the speaker's claims, counter-consensus points with their conviction)
- The speaker errors flagged with `[!warning]` callouts, one line each (what was said → check result)
- Errors found in other vault notes along the way. Do not edit those notes on your own; report the note, the wrong value and the correct value with its source, and fix them when the user says so
- After delivery, clean up with `python3 .scripts/tmpdir.py done <batch task name>`, unless the user wants to review the QC backups first.
## Important Notes
- **Long content works fine**: DeepSeek V4.1 Flash has a 1M token context window, so even 3+ hour podcasts are handled.
- **API keys come from the environment**: `OPENROUTER_API_KEY` (required) and `SONIOX_API_KEY` (optional, Bilibili ASR fallback). The script exits with a clear message when the OpenRouter key is missing. Never write a key into a note or onto a command line.
- **Cookies**: set `YTDLP_COOKIES_BROWSER` (e.g. `chrome`, `edge`, `firefox`, `safari`) to a browser where you are logged in to Bilibili/YouTube. Unset means no cookies, which is fine for most public YouTube videos.
- **Duplicate handling**: The script automatically appends a number suffix if a file with the same title already exists.
- **Dependencies**: Python 3.10+, `youtube-transcript-api`, `yt-dlp`, `requests` (all pip-installable). The script auto-installs `requests` if missing; when the interpreter refuses (`externally-managed-environment`), it exits with venv instructions.
- **Timeout**: Each API call has a 600-second timeout. For very long transcripts, the script may take up to 10 minutes total.
- **Sub-agents**: the structuring script runs without sub-agents. The Jarvis Interpretation step uses one sub-agent per note (step 5). QC can also be split across sub-agents, with one per 1–2 notes and a shared written brief.
Pliki w paczce (5)
- README.en.md 9 KB
- README.md 9 KB
- SKILL.md 14 KB
- evals/evals.json 1 KB
- references/interpretation.md 13 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · jasonzhang-obsharing/jarvis-skills-and-prompts | 100 | MIT |
| nibzard/skills-kit | 100 | MIT |
| nibzard/skills-kit | 100 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki c2d781d08901 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100youtube-transcript
Pobiera transkrypcję filmu YouTube, gdy użytkownik prosi o tekst, napisy lub streszczenie treści z linku. - 100youtube-transcript
Pobiera transkrypcje filmów YouTube po podaniu adresu URL, także napisy do transkrypcji. - 100youtube-transcript
Wyciąga transkrypty filmów YouTube z metadanymi i zapisuje jako Markdown w vaulcie Obsidian, bez pobierania plików wideo i audio. - 90openakita/skills@bilibili-watcher
Pobiera napisy i transkrypcje z filmów na Bilibili i YouTube, także na potrzeby pytań o treść wideo. - 100youtube-transcript
Pobiera transkrypcje z filmów YouTube po podaniu linku, z opcją znaczników czasu lub bez nich. - 100youtube-transcript
Wyciąga transkrypcje filmów YouTube z podanego linku z opcją znaczników czasu albo bez nich.