YouTube Reader

Parameters and methods of YouTubeReader, which reads YouTube video transcripts into documents.

YouTubeReader reads transcripts from YouTube videos.

Parameters

ParameterTypeDefaultDescription
chunking_strategyOptional[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.

ParameterTypeDefaultDescription
urlstrRequiredCanonical https://www.youtube.com/watch?v=VIDEO_ID URL. Normalize youtu.be share links and Shorts URLs first; the current parser only extracts v=.
nameOptional[str]NoneName override for the resulting documents

async_read()

Async variant of read(). Accepts url only.