YouTube Reader
Parameters and methods of YouTubeReader, which reads YouTube video transcripts into documents.
YouTubeReader reads transcripts from YouTube videos.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
chunking_strategy | Optional[ChunkingStrategy] | RecursiveChunking() | Strategy used to chunk documents |
YouTubeReader also accepts the base Reader constructor parameters.
Methods
read()
Reads the transcript of a YouTube video and returns a list of documents.
| Parameter | Type | Default | Description |
|---|---|---|---|
url | str | Required | Canonical https://www.youtube.com/watch?v=VIDEO_ID URL. Normalize youtu.be share links and Shorts URLs first; the current parser only extracts v=. |
name | Optional[str] | None | Name override for the resulting documents |
async_read()
Async variant of read(). Accepts url only.