Skip to main content

YouTube audio download and faster-whisper transcription pipeline.

Project description

ytpipe

PyPI version Python 3.10+ License: MIT

YouTube audio download and transcription pipeline.

ytpipe downloads audio from YouTube (videos, playlists, channels) and transcribes locally using faster-whisper. Designed for practical, repeatable ingestion of YouTube content into clean on-disk datasets.

Features

  • One-command pipeline: download + transcribe in one step
  • Robust downloads powered by yt-dlp (videos, playlists, channels)
  • Fast local transcription via faster-whisper (CPU or NVIDIA GPU)
  • VAD enabled by default for better quality and faster processing
  • Multiple output formats: JSON, TXT, SRT, VTT subtitles
  • Parallel processing for batch transcription (multi-CPU and multi-GPU)

Requirements

  • Python >= 3.10
  • FFmpeg (must be in PATH or provided via --ffmpeg)
  • Optional: NVIDIA GPU + CUDA for acceleration

Installation

CPU only (default)

pip install ytpipe

GPU support (NVIDIA CUDA)

pip install "ytpipe[gpu]"

Quick Start

Full pipeline (download + transcribe)

# CPU (default)
ytpipe pipeline -s "https://www.youtube.com/watch?v=VIDEO_ID" --out data

# GPU accelerated
ytpipe pipeline -s "https://www.youtube.com/watch?v=VIDEO_ID" --out data --device cuda

Download only

ytpipe download -s "https://www.youtube.com/watch?v=VIDEO_ID" --out data/raw

Download from channel (with limit)

# Download 5 videos from a channel
ytpipe pipeline -s "https://www.youtube.com/@ChannelName" --out data --max 5

# Or download only (without transcription)
ytpipe download -s "https://www.youtube.com/@ChannelName" --out data/raw --max 10

Transcribe only

ytpipe transcribe --audio-dir data/raw/audio --out data/transcripts

Output Structure

data/
  raw/
    audio/
      VIDEO_ID.m4a
      VIDEO_ID.info.json
    manifest.jsonl
    downloaded.txt
  transcripts/
    VIDEO_ID.json
    VIDEO_ID.txt

CLI Options

Common options

Option Description
--model Whisper model: small, medium, large-v3 (default: medium)
--device Device: cpu, cuda, auto (default: cpu)
--language Language hint (e.g., en). Auto-detects if not set
--output-format Output formats: json,txt,srt,vtt (default: json,txt)

GPU acceleration

ytpipe transcribe --audio-dir data/raw/audio --device cuda --compute-type float16

Parallel processing

# CPU parallel (4 workers)
ytpipe transcribe --audio-dir data/raw/audio --workers 4

# Multi-GPU
ytpipe transcribe --audio-dir data/raw/audio --device cuda --workers 2

Python API

from pathlib import Path
from ytpipe import (
    DownloadConfig,
    TranscriptionConfig,
    download_sources,
    transcribe_directory,
)

# Download
items = download_sources(
    sources=["https://www.youtube.com/watch?v=VIDEO_ID"],
    config=DownloadConfig(out_dir=Path("data/raw")),
)

# Transcribe
results = transcribe_directory(
    audio_dir=Path("data/raw/audio"),
    out_dir=Path("data/transcripts"),
    config=TranscriptionConfig(model="medium"),
)

Troubleshooting

  • FFmpeg not found: Install FFmpeg and add to PATH, or use --ffmpeg /path/to/ffmpeg
  • GPU not detected: Ensure NVIDIA drivers are installed and nvidia-smi works
  • DLL errors on Windows: Use --device cpu (default) to avoid CUDA dependencies

License

MIT License

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

ytpipe-0.1.7.tar.gz (63.7 kB view details)

Uploaded Source

Built Distribution

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

ytpipe-0.1.7-py3-none-any.whl (52.3 kB view details)

Uploaded Python 3

File details

Details for the file ytpipe-0.1.7.tar.gz.

File metadata

  • Download URL: ytpipe-0.1.7.tar.gz
  • Upload date:
  • Size: 63.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for ytpipe-0.1.7.tar.gz
Algorithm Hash digest
SHA256 2adb0aae62343a5089ff7edffc327a3d0ae0a930122fc87906af72da5abab13c
MD5 07395e476d96b31a0ac1eddd0331e08f
BLAKE2b-256 ad331d865f73dbbb9beea8caf029bc96b3ed1e78a7845c0e9f423abae4dc447c

See more details on using hashes here.

File details

Details for the file ytpipe-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: ytpipe-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 52.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for ytpipe-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 8f6eea738e0f1faa5422e4680bebf1bfdfa3931d7d0ed72a4e9ae6916dab0010
MD5 895fb13a75fbe0ce545dac9b23ffb046
BLAKE2b-256 fcb5d5e995d45b0082a5ca07fefc29f708680a62737da9511482dad3e2e9b540

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