Skip to main content

A command-line tool to summarize YouTube videos using AI.

Project description

Content Summarizer

A tool to summarize YouTube videos using AI

Content-Summarizer is a simple CLI program that summarize Youtube videos using Google Gemini.

⬇️ 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:

  1. Command-line Flags: Always takes top priority for the current run.

  2. Environment Variables: Loaded from an .env file or system environments.

  3. User Configuration: Defaults set via the config command.

  4. 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:

  1. Deploy the application found in the flask_api/ folder to a server of your choice.
  2. Use the --api-url and --api-key flags (or set them as defaults using the config command) 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

content_summarizer-1.0.4.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

content_summarizer-1.0.4-py3-none-any.whl (42.9 kB view details)

Uploaded Python 3

File details

Details for the file content_summarizer-1.0.4.tar.gz.

File metadata

  • Download URL: content_summarizer-1.0.4.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for content_summarizer-1.0.4.tar.gz
Algorithm Hash digest
SHA256 16f65cfa6d2f27a35bd1ded479ee0553f0e6aa035a093833e67e198c32c8330d
MD5 730349dab28030231b1f7fd38f179b55
BLAKE2b-256 f041c4fc750bc4770c80190a9989938ac500d2093f4c727c65b28349e45943da

See more details on using hashes here.

File details

Details for the file content_summarizer-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for content_summarizer-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2e2e45d52d1a5ee08a57e3eebf25c4830952af0da51f3d820072ab2c1a9b8263
MD5 270b3dab5eb47c1e9a8710bbbd9ad653
BLAKE2b-256 642e074fd16152d8bf2f27b00dbfa7da7265d4353acdd8ca7f2656611050940a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page