YouTube Video Summarizer is a web application that automatically generates concise summaries of YouTube videos using AI-powered language models. The application downloads video subtitles, processes them, and uses Ollama as an underlying FM hosting engine to create comprehensive summaries.
- Automatic subtitle download from YouTube videos
- Support for multiple languages
- Customizable AI models for summarization based on one's own hosted Ollama library
- Progress tracking during the summarization process
- Downloadable transcripts
- Support for cookies (see this document for more details)
- Users input a YouTube URL and select their preferred language and AI model.
- The application downloads the video's subtitles in the chosen language.
- Subtitles are processed and divided into manageable chunks representing 5 minutes. This is to make sure that the transcript fragment does not go beyond selected FM's context window.
- Each chunk is summarized using the selected AI model via the Ollama API.
- The individual summaries are combined to create a comprehensive overview of the video content.
To set up a development environment, you'll need:
- Python 3.9 or higher
- Docker and Docker Compose
- Ollama (running locally or on a accessible server)
Main Python libraries used:
- Flask
- yt-dlp
- requests
- markdown
For a complete list, see requirements.txt
.
To containerize and run the application locally:
To containerize and run the application locally:
-
Clone the repository:
git clone https://github.com/your-username/youtube-video-summarizer.git cd youtube-video-summarizer
-
Build and run the Docker container:
docker-compose up --build
-
Access the application at
http://localhost:17430
The following environment variables are externalized in the docker-compose.yml
file:
PORT
: The port on which the Flask application runs inside the container (default: 8080)OLLAMA_BASE_URL
: The URL of the Ollama API (default: http://host.docker.internal:11434/api)
Variables that need to be modified inside app.py
:
CORS
settings: Update the allowed origins if neededDEFAULT_MODEL
: Change the default AI model if requiredBASE_PROMPT
: Modify the base prompt for summarization if desired
Ensure that Ollama is running and accessible from the Docker container. The default configuration assumes Ollama is running on the host machine and is accessible via host.docker.internal
.
Contributions are welcome! Please feel free to submit a Pull Request.