Skip to main content

Let Claude watch YouTube videos - transcripts + on-demand frame extraction

Project description

claudetube

claudetube

Let AI watch and understand online videos.

CI PyPI Python License Stars


claudetube downloads online videos, transcribes them with faster-whisper, and lets AI "see" specific moments by extracting frames on-demand. Built for Claude Code but works as a standalone Python library with any AI tool.

Quick Start

Prerequisites

  • Python 3.10+
  • ffmpeg (system package)
    # macOS
    brew install ffmpeg
    
    # Ubuntu/Debian
    sudo apt install ffmpeg
    

Install

git clone https://github.com/thoughtpunch/claudetube
cd claudetube
./install.sh

Or via pip (once published):

pip install claudetube

The installer does three things:

  1. Creates a Python venv at ~/.claudetube/venv/
  2. Installs the claudetube package + dependencies (yt-dlp, faster-whisper)
  3. Copies slash commands to ~/.claude/commands/ (global to all Claude Code sessions)

Restart Claude Code after installing.

Works from any Claude Code session

The installer puts slash commands in ~/.claude/commands/, which is the global commands directory. Every Claude Code instance on your machine will have /yt available -- no per-project setup needed.

Why not a pre-built binary?

claudetube depends on faster-whisper (C++ transcription engine) and ffmpeg (system media tool). These have platform-specific native code that can't be bundled into a single static binary. The install script handles all of this automatically.

Usage with Claude Code

/yt https://youtube.com/watch?v=abc123 how did they make the sprites?

Claude will:

  1. Download and transcribe the video (~60s first time, cached after)
  2. Read the transcript
  3. If needed, extract frames to "see" specific moments
  4. Answer your question

Commands

Command Purpose
/yt <url> [question] Analyze a video
/yt:see <id> <timestamp> Quick frames (general visuals)
/yt:hq <id> <timestamp> HQ frames (code, text, diagrams)
/yt:transcript <id> Read cached transcript
/yt:list List all cached videos

Python API

from claudetube import process_video, get_frames_at

# Transcribe a video
result = process_video("https://youtube.com/watch?v=VIDEO_ID")
print(result.transcript_srt.read_text())

# Extract frames at a specific timestamp
frames = get_frames_at("VIDEO_ID", start_time=120, duration=10)

How It Works

  1. Download -- Fetches lowest quality video (144p) for speed
  2. Transcribe -- Uses faster-whisper with batched inference
  3. Cache -- Stores everything at ~/.claude/video_cache/{VIDEO_ID}/
  4. Drill-in -- Extract frames on-demand when visual context is needed

Cache Structure

~/.claude/video_cache/
└── dYP2V_nK8o0/
    ├── state.json     # Metadata (title, description, tags, etc.)
    ├── audio.mp3      # Extracted audio
    ├── audio.srt      # Timestamped transcript
    ├── audio.txt      # Plain text transcript
    ├── drill/         # Quick frames (480p)
    └── hq/            # High-quality frames (1280p)

Architecture

claudetube uses a provider-based architecture. Video downloading is handled through yt-dlp, which currently supports YouTube and 1000+ other sites. The transcription and frame extraction pipeline is provider-agnostic -- it works with any video source that yt-dlp supports, and the architecture is designed to accommodate additional providers in the future.

Development

git clone https://github.com/thoughtpunch/claudetube
cd claudetube
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest

Linting

black src/ tests/
isort --profile black src/ tests/
flake8 src/ tests/

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Run tests and linting before committing
  4. Open a pull request against main

Legal

This project is not affiliated with, endorsed by, or associated with YouTube, Google, or Alphabet Inc. "YouTube" is a trademark of Google LLC. This software is an independent, open-source tool that interacts with publicly available video content through third-party libraries (yt-dlp). Users are solely responsible for ensuring their use of this software complies with all applicable terms of service and laws.

License

MIT -- free to use, modify, and distribute.

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

claudetube-0.1.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

claudetube-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file claudetube-0.1.0.tar.gz.

File metadata

  • Download URL: claudetube-0.1.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for claudetube-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cafe0250bbb049f34f4d5d41bacbe946386316fec8378bfbaf99f7d5a271091f
MD5 c496722556b74d369b2ea6ac138a6a7d
BLAKE2b-256 a5391ec9d429c0a318b2387b09aaa3c8678decdd737a1488a3cab588a6f679c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for claudetube-0.1.0.tar.gz:

Publisher: publish.yml on thoughtpunch/claudetube

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claudetube-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: claudetube-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for claudetube-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e63f1589714bb79cb32ea45c70383a528b36efdde2b8d795b56f50595bf2fac
MD5 39fdc9c34a2ef93e50632832de33ba32
BLAKE2b-256 b8bac9a642a2e0b3a5e008b63547dbf6f472731f3ef52ab5e495a1f9399fedf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for claudetube-0.1.0-py3-none-any.whl:

Publisher: publish.yml on thoughtpunch/claudetube

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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