Skip to main content

Summarize YouTube videos using AI (OpenAI or Anthropic)

Project description

YouTube Summariser

A command-line tool that summarizes YouTube videos using AI. It extracts transcripts from YouTube videos and generates structured summaries using OpenAI or Anthropic models.

Installation

pip install youtube-summariser

Or install from source:

git clone https://github.com/weijianzhg/youtube-summariser
cd youtube-summariser
pip install -e .

Configuration

API Keys

Set your API key for your preferred provider:

# For OpenAI
export OPENAI_API_KEY=your_openai_api_key

# For Anthropic
export ANTHROPIC_API_KEY=your_anthropic_api_key

Or create a .env file in your working directory:

OPENAI_API_KEY=your_openai_api_key
# or
ANTHROPIC_API_KEY=your_anthropic_api_key

Default Provider

The default provider is Anthropic. You can override this per command using --provider.

Usage

# Basic usage - saves summary to auto-generated filename
youtube-summariser "https://www.youtube.com/watch?v=VIDEO_ID"

# Specify output filename
youtube-summariser "https://youtu.be/VIDEO_ID" -o my_summary.txt

# Print to terminal only (no file saved)
youtube-summariser "https://youtube.com/watch?v=VIDEO_ID" --no-save

# Use a specific provider
youtube-summariser "https://youtu.be/VIDEO_ID" --provider openai

Options

Flag Description
-o, --output Specify output filename (default: summary_<video_id>_<timestamp>.txt)
--no-save Print summary to terminal without saving to file
--provider LLM provider to use: openai or anthropic
-v, --version Show version number
-h, --help Show help message

Output Format

YouTube Video Summary
=====================
Video URL: https://www.youtube.com/watch?v=VIDEO_ID
Video ID: VIDEO_ID
Generated: 2025-01-01 14:30:00
Model: anthropic / claude-sonnet-4-5-20250929

## Main Topics
...

## Key Points
...

## Detailed Summary
...

## Notable Quotes
...

## Timestamps for Important Moments
...

Requirements

  • Python 3.10+
  • An API key for OpenAI or Anthropic

License

MIT License - see LICENSE 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

youtube_summariser-0.3.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

youtube_summariser-0.3.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file youtube_summariser-0.3.0.tar.gz.

File metadata

  • Download URL: youtube_summariser-0.3.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for youtube_summariser-0.3.0.tar.gz
Algorithm Hash digest
SHA256 4fea50f58eb926d1b4a52dc5bd4be7cec92af4103429f45306608c91d69fa499
MD5 251708a1a02f61d530b034e3598cd65f
BLAKE2b-256 f07d8bdf0389c8cc0f43eae6fd54b7e23e721d63a19723e76607b1e903c6369c

See more details on using hashes here.

File details

Details for the file youtube_summariser-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for youtube_summariser-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8f3d900748ddf7d2167a3ab885398f8d156af92acc8a9e4e255de802938e7d7
MD5 f24e8f1810b0778006ecc86097bfe7d6
BLAKE2b-256 b227f9a019ab387fb9bcef2ca2c08f87db00727df054960a2e3cf4cfa3c66a11

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