A command-line tool to summarize YouTube videos using AI.
Project description
📝Content Summarizer
✨ A tool to summarize YouTube videos using AI
Ever found a YouTube video that seemed interesting but you didn't have time to watch it? With Content Summarizer, that's no longer a problem! Get high-quality summaries of any YouTube video for free through a simple and powerful command-line interface (CLI).
🚀 Features
- 🔍 Smart Sourcing: Automatically uses existing manual captions for speed, or falls back to highly accurate local transcription using Faster-Whisper.
- 🧠 Intelligent Summaries: Leverages the Gemini API to generate clear, concise, and context-aware summaries.
- 🌐 Multi-language Support: Delivers summaries in your system's native language.
- 🔄 Flexible Transcription: Offers the choice between local processing (via Faster-Whisper) or a remote transcription API.
- ⚡ Performance Control: Adjust the audio speed factor for faster transcriptions on local processing.
- 💻 Simple & Powerful CLI: A clean and intuitive command-line interface for easy use.
⬇️ Installation
Prerequisites
You need to have Python 3.11+ and FFmpeg installed on your system.
Recommended Installation
The best way to install is using uv to keep the environment isolated:
uv tool install content-summarizer
Or if you prefer to use pipx:
pipx install content-summarizer
You can also use the standard pip, but be aware that it will install the package in your global or current environment:
pip install content-summarizer
💡 Usage
The application has two main commands: summarize and config.
- 🎬
summarize: Fetches and summarizes a given YouTube URL. This is the main command. - ⚙️
config: Sets default values for flags, so you don't have to type them on every run. These settings are saved in a system-specific user configuration directory.
For a full list of all commands and flags, run content-summarizer --help.
The summarize Command
Basic Usage
content-summarizer summarize "YOUR_YOUTUBE_URL_HERE"
Common Summarize Flags
# Change the audio speed factor for faster transcriptions
content-summarizer summarize "YOUR_YOUTUBE_URL_HERE" -s 2.5
# Change Whisper (Faster-Whisper) Model
content-summarizer summarize "YOUR_YOUTUBE_URL_HERE" -w large-v2
# Change Gemini Model
content-summarizer summarize "YOUR_YOUTUBE_URL_HERE" -g 2.5-pro
# Decrease console verbosity (shows only warnings and errors)
content-summarizer summarize "YOUR_YOUTUBE_URL_HERE" -q
# Make the console output completely silent (summary output still works)
content-summarizer summarize "YOUR_YOUTUBE_URL_HERE" -qq
# Disable the summary output in the terminal
content-summarizer summarize "YOUR_YOUTUBE_URL_HERE" --no-terminal
# Specify an output path for the creation of an output summary file alongside the normal terminal output
content-summarizer summarize "YOUR_YOUTUBE_URL_HERE" -o "YOUR_OUTPUT_PATH_HERE"
# Keep the cache directory after execution for re-runs
content-summarizer summarize "YOUR_YOUTUBE_URL_HERE" -c
The config Command
Common Config Flags
# Specify default output path
content-summarizer config -o "YOUR_OUTPUT_PATH_HERE"
# Specify default speed factor
content-summarizer config -s 1.5
# Specify default API KEY
content-summarizer config --api-key "YOUR_OWN_WHISPER_API_KEY_HERE"
# Specify default Google AI Studio API KEY
content-summarizer config --gemini-key "YOUR_GOOGLE_AI_KEY_HERE"
🛠️ Configuration
The application resolves settings with the following priority order:
-
Command-line Flags: Always takes top priority for the current run.
-
Environment Variables: Loaded from an
.envfile or system environments. -
User Configuration: Defaults set via the
configcommand. -
Application Defaults: The program's default values. You can see them right here.
📡 Using the Remote Transcription API
The --api flag allows you to offload transcription to a remote server. This project includes a simple Flask API in the flask_api/ directory that you can deploy yourself.
To set up the API, you will need to install its specific dependencies:
# Navigate to the api directory
cd flask_api/
# Install the API dependencies
uv pip install -r requirements.txt
To use this feature, you must:
- Deploy the application found in the
flask_api/folder to a server of your choice. - Use the
--api-urland--api-keyflags (or set them as defaults using theconfigcommand) to point the CLI to your deployed API.
Fell free to use your own API key, you just need to put it in the API .env. I recommend the use of the following script to generate a safe API key, just copy and paste in any terminal:
python -c "import secrets, string; print(''.join(secrets.choice(string.ascii_letters + string.digits) for _ in range(30)))"
A detailed deployment guide is beyond the scope of this README.
📄 License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file content_summarizer-1.0.3.tar.gz.
File metadata
- Download URL: content_summarizer-1.0.3.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20b49df59c4ba4a0481c9db01c0d7bf2693bf418d01de73a72e7e5bc1838fe0e
|
|
| MD5 |
bf511565e5fc1a44ed98fb7e5e3e85a1
|
|
| BLAKE2b-256 |
39a41d0a616e5fa6130989b240c3e644cf37c73b729a55b0a088f9ca02d8391d
|
File details
Details for the file content_summarizer-1.0.3-py3-none-any.whl.
File metadata
- Download URL: content_summarizer-1.0.3-py3-none-any.whl
- Upload date:
- Size: 43.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4afb2154691f180d81ba61736f18fcb2887a98510f6837a202e71b1732d75c2
|
|
| MD5 |
3634478dc11683595ccaec60e79e57cd
|
|
| BLAKE2b-256 |
ed5e87006402d51b358d51f2fdaa0e8325e5c9d6647d1fbbf195b4bcded21294
|