Send YouTube Transcripts to LlamaIndex
Get any YouTube transcript into LlamaIndex in seconds
Or just change youtube.com to 2outube.com in your browser
Swap 'youtube.com' to '2outube.com' in any video URL to instantly grab the full transcript. Paste it into LlamaIndex as a document and start querying, summarizing, or building a RAG pipeline over YouTube content — no API keys needed.
The Trick
youtube.com/watch?v=VIDEO_ID
2outube.com/watch?v=VIDEO_ID
Just change 'y' to '2'
Works with any YouTube video that has captions
Using Transcripts with LlamaIndex
Grab the transcript from 2outube
Find the YouTube video you want to index. Replace 'youtube.com' with '2outube.com' in the URL and hit enter. The full transcript appears on the page — copy it all with one click.
Create a LlamaIndex Document
In your Python environment, import Document from llama_index.core and wrap the transcript text: doc = Document(text=transcript_text, metadata={'source': 'youtube', 'video_id': 'VIDEO_ID'}). This preserves source attribution in your index.
Build a VectorStoreIndex
Pass the document to VectorStoreIndex.from_documents([doc]) to chunk, embed, and index the transcript automatically. LlamaIndex handles tokenization and embedding using your configured LLM and embedding model.
Query over the video content
Create a query engine with index.as_query_engine() and start asking questions: response = query_engine.query('What are the key takeaways from this video?'). LlamaIndex retrieves relevant chunks and synthesizes an answer grounded in the transcript.
Quick Start
Get the transcript
Navigate to the YouTube video you want to work with and copy its URL from the browser address bar.
Change youtube to 2outube
In the URL, replace 'youtube.com' with '2outube.com' — for example, youtube.com/watch?v=abc123 becomes 2outube.com/watch?v=abc123. The full transcript loads instantly.
Index it in LlamaIndex
Copy the transcript text and pass it to LlamaIndex as a Document. Use VectorStoreIndex.from_documents() to build a queryable index, then call as_query_engine() to start asking questions over the video content.
Ready-Made Template
from llama_index.core import VectorStoreIndex, Document
# Paste transcript from 2outube.com/watch?v=VIDEO_ID
transcript_text = """
[PASTE TRANSCRIPT HERE]
"""
# Create document with metadata
doc = Document(
text=transcript_text,
metadata={
"source": "youtube",
"video_id": "VIDEO_ID",
"video_url": "https://youtube.com/watch?v=VIDEO_ID",
"retrieved_via": "2outube.com"
}
)
# Build index
index = VectorStoreIndex.from_documents([doc])
# Query the video
query_engine = index.as_query_engine()
response = query_engine.query("What are the main points covered in this video?")
print(response)
Questions
Does this work with any YouTube video?
Yes, any video with captions. This includes auto-generated captions and manually added subtitles. If a video has no captions at all, no transcript will be available.
Is it really free?
Completely free. No account, no limits, no API key required for 2outube. You just change the URL and get the transcript.
Can I index multiple YouTube videos into the same LlamaIndex index?
Yes. Grab transcripts from multiple videos via 2outube, create a separate Document for each, and pass them all as a list to VectorStoreIndex.from_documents([doc1, doc2, doc3]). LlamaIndex will chunk and index all of them together, and metadata fields like video_id help you trace which chunk came from which video.
What LlamaIndex version does this work with?
This works with llama-index-core 0.10+ (the modular package structure). For older versions using the monolithic llama-index package, the same Document and VectorStoreIndex classes apply — just import paths differ slightly.
Does the transcript include timestamps?
2outube provides the full transcript text. If you need precise timestamps for chunk metadata, you can use the raw transcript format which includes timing data — useful for linking LlamaIndex responses back to specific moments in the video.
What embedding model should I use for YouTube transcripts in LlamaIndex?
OpenAI's text-embedding-3-small is a solid default for most transcript use cases. For local/offline indexing, nomic-embed-text via Ollama works well. LlamaIndex lets you configure this with Settings.embed_model before building your index.
How do I handle long transcripts that exceed token limits?
LlamaIndex automatically chunks documents using its node parser before indexing. The default chunk size is 1024 tokens with 20-token overlap. For very long transcripts (lectures, full courses), you can tune this with SentenceSplitter(chunk_size=512, chunk_overlap=50) for more granular retrieval.
Can I build a RAG chatbot over a YouTube channel using this method?
Yes. Collect video IDs from a channel, grab each transcript via 2outube, create one Document per video, and index them all together. Add the video title and URL to each Document's metadata so your chatbot can cite sources. This is a common pattern for building knowledge bases from educational YouTube channels.
Start indexing YouTube videos in LlamaIndex — free
Free, no signup required
Try It Free