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-20250514
## 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
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 youtube_summariser-0.2.0.tar.gz.
File metadata
- Download URL: youtube_summariser-0.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b22bc77b9fca8d1bda31b14a2666cfa24edf723eb52836ba71daa05876c0c9bb
|
|
| MD5 |
6805ee8d6c91b9c4e61d21386251aa30
|
|
| BLAKE2b-256 |
7b0dfbe07fefd85e79cf6a00295ec402993e7112a8fdbfd1a35bc35cb04e6196
|
File details
Details for the file youtube_summariser-0.2.0-py3-none-any.whl.
File metadata
- Download URL: youtube_summariser-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d53d7ee91687266f5d8f6bce6fd766e653e8acad79e09d29c4c3c49eccbfee12
|
|
| MD5 |
d1cb8332cdb50f2cd01cbb0ea18019a6
|
|
| BLAKE2b-256 |
b919e76ed721bcf5787b33fb44d3399284fdaf6a775d7eadf4a890245ca975da
|