Repository navigation
feat: read chapters from the video description - #17
Merged
Merged
Conversation
Adds a chapters array of {start, end, title}, parsed from the
description with YouTube's own rules: starts at 0:00, at least three,
strictly increasing, each at least 10 seconds, one block of lines. The
Markdown transcript gets a "## Title" heading at each chapter.
Closes #16
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FPou7f8nRjX78T2qR7hTjb
This was referenced Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #16. This PR ships as 1.2.0.
Changes
New
chaptersfield with[{start, end, title}]in seconds.endis the next chapter's start, or the video's duration for the last chapter, ornullfor a live stream. It is[]when a video has none. It is filled with--metadata-onlytoo, and appended as the last field so the existing order is unchanged.Parsing.
ParseChaptersreads the description, which ytx already fetches, and applies YouTube's rules:0:00A list that breaks a rule gives
[]. The block rule allows blank lines, but any other line ends the list. This stops later prose like "Follow me at 99:00" from being added as a chapter.Line layouts.
0:00 Intro,0:00 - Intro,(00:00) - Intro,[1:02:03] Intro,• 3:12 | Intro,03:12: Intro,75:00 Intro,Intro - 12:34andIntro (1:00:00). Both regexes are source-generated, so the code stays AOT-safe.Markdown sections.
transcriptand-f mdget a## Titleheading at each chapter. A chapter with no captions of its own still gets its heading, so the outline matcheschapters.Verification
nullend without a duration, timestamps before the list, heading placement, and golden JSON with chapters (indented) and[](compact).NYFGCESmikA(5h15m): 23 chapters, fromEpisode highlightat 0 s to the last at 18338–18951 s, matching the description. The Markdown starts each chapter with## Title.iG9CE55wbtY:[], with no headings.-c NYFGCESmikA,-f md NYFGCESmikAand--metadata-only iG9CE55wbtY.Left out
Docs
docs/investigations/2026-10-ytx-review-to-1.1.0.md.Release
Merge with
[skip ci], then run "Publish NuGet (ytx)" manually withminorto publish 1.2.0.🤖 Generated with Claude Code
https://claude.ai/code/session_01FPou7f8nRjX78T2qR7hTjb