Sebastian Blaik
← All writing

How I get transcripts from video links

When I give an agent a video link, I want it to work with what was actually said. I might ask it to summarize a long YouTube video or find a particular claim in a short reel.

To do that, it first needs the words from the recording. I use three skills for this: yt-transcript, instagram-transcript and tiktok-transcript. Each combines instructions for the agent with a small Python script.

On YouTube, the script uses yt-dlp to retrieve existing captions. It tries manually added subtitles first, then auto-generated ones, and turns them into readable text. This depends on captions being available in the language I need.

Instagram works differently. The script downloads the reel’s audio, then MLX Whisper transcribes it locally on my Mac (Apple Silicon). The same script handles Facebook videos. It also keeps the Instagram post’s description when available, which can contain a source or a name that wasn’t spoken clearly.

TikTok is where I use Apify. The script sends the links to its transcript scraper and turns the returned subtitles into text. This requires an API token. The YouTube and Instagram scripts don’t call Apify.

With the transcript ready, I can ask the agent to summarize the video or explain something that caught my attention. Timestamps help me find that part of the recording.