This Python script provides an automated way to summarize videos. It uses replicate
to transcribe video audio through the Whisper API, and then employs OpenAI's GPT-4 model to generate a concise summary. This tool is ideal for quickly understanding the key points of a video without watching it in its entirety.
- Transcribes video audio using Whisper.
- Summarizes transcribed content using OpenAI's GPT-4.
- Handles large transcripts by splitting them into chunks and processing each separately.
- Combines multiple summaries into a single, coherent summary.
- Python 3
replicate
libraryopenai
library- An API key for OpenAI
Clone the repository and install the required packages:
git clone https://github.com/your-github-username/your-repo-name.git cd your-repo-name pip install replicate openai
- Set your OpenAI API key as an environment variable:
export OPENAI_API_KEY='your-api-key'
- Set your Replicate API key as an environment variable:
export REPLICATE_API_TOKEN='your-api-key'
- Run the script with a YouTube URL: python script_name.py --url 'your-video-url'
python summerize.py --url 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
Contributions to improve the script are welcome. Please fork the repository and submit a pull request with your changes.