Summarize the transcript of a YouTube video using OpenAI's GPT-3

Summarize the transcript of a YouTube video using OpenAI’s GPT-3

23 December, 2022 1 min read
GPT, LLM, video, transcript, Python

Following my earlier post on summarizing a YouTube video with ChatGPT , I put together a gist that uses the yt-dlp and openai Python modules to either download a proper transcript or extract the auto-generated transcript.

Autogenerated transcripts have no punctuation, so they cannot be split to be gradually fed to GPT-3, so you’re better off copy/pasting segments into ChatGPT.

Proper transcripts are split in segments and fed one by one to GPT-3 to be summarized.

In either case, you get a transcript.

Here you go: https://gist.github.com/waseigo/a5224237cd40b625908570aaa58a5ca1

You will first need an OpenAI key from https://platform.openai.com/account/api-keys and also to have the required Python dependencies installed.