Skip to main content
Building chat or QA applications on YouTube videos is a topic of high interest. Below we show how to easily go from a YouTube url to audio of the video to text to chat! We wil use the OpenAIWhisperParser, which will use the OpenAI Whisper API to transcribe audio to text, and the OpenAIWhisperParserLocal for local support and running on private clouds or on premise. Note: You will need to have an OPENAI_API_KEY supplied.
We will use yt_dlp to download audio for YouTube urls. We will use pydub to split downloaded audio files (such that we adhere to Whisper API’s 25MB file size limit).

YouTube url to text

Use YoutubeAudioLoader to fetch / download the audio files. Then, ues OpenAIWhisperParser() to transcribe them to text. Let’s take the first lecture of Andrej Karpathy’s YouTube course as an example!

Building a chat app from YouTube video

Given Documents, we can easily enable chat / question+answering.