Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube Transcript Compiler 🎥🤖

A lightweight, robust Python CLI tool designed to extract YouTube transcripts and compile them into beautifully structured Markdown files. It effortlessly handles both single video URLs and entire creator channels, filtering out videos without captions into a dedicated error log.

The output is structurally optimized out-of-the-box for ingestion by Large Language Models (LLMs) like GPT-4, Claude, or local Llama instances for advanced synthesis, summarization, and analysis.


✨ Features

  • Channel-Wide Extraction: Pulls recent video queues seamlessly using yt-dlp.
  • Queue Truncation: Pass the --limit flag to target only the last N videos published.
  • LLM-Ready Structure: Wraps output in clean Markdown syntax (#, ##, ---).
  • Smart Language Fallback: Prioritizes English transcripts, gracefully falling back to default or auto-generated tracks if an explicit language code isn't found.
  • Centralized Outputs: Keeps your root directory clean by grouping logs and markdown dumps inside a designated transcripts/ directory.

⚠️ CRITICAL NOTE ON OVERWRITES

Important: Running this script multiple times using the same default output file names will completely overwrite the previously generated files inside the /transcripts folder.

To preserve your datasets, make sure to use the -o parameter to provide a unique output filename, or rename/move your files out of the /transcripts directory before launching a new execution pipeline.


🚀 Getting Started

Prerequisites

Make sure your system has Python 3.8+ installed.

1. Installation

Clone the repository and install dependencies inside a virtual environment:

git clone [https://github.com/YOUR_USERNAME/youtube-transcript-compiler.git](https://github.com/YOUR_USERNAME/youtube-transcript-compiler.git)
cd youtube-transcript-compiler

# Create and activate environment
python3 -m venv .venv
source .venv/bin/activate  # On Windows use: .venv\Scripts\activate

# Install requirements
pip install -r requirements.txt

Usage Guide

This utility runs entirely using terminal execution commands, removing the need to edit internal code variables manually.

## Mode A: Extracting a Single Video

Provide the specific video URL using the -v or --video flag:

python3 src/yt_transcriber.py -v "https://youtu.be/Y8B6iKXexy4" 
  • Custom Output Name: You can explicitly define your file name inside the folder using the -o flag:
python3 src/yt_transcriber.py -v "https://youtu.be/Y8B6iKXexy4" -o "transcripts/my_product_review.md"

Mode B: Extracting an Entire Channel with Limits

Provide the channel's video tab URL using the -c or --channel flag:

python3 src/yt_transcriber.py -v "https://youtu.be/Y8B6iKXexy4" 
  • Limiting Video History: To limit processing to only the most recent uploads (e.g., the last 20 videos), add the -l or --limit flag:
python3 src/yt_transcriber.py -c "https://www.youtube.com/@ChannelHandle/videos"

High-Value Use Cases

### Use Case 1: Training a Custom RAG Knowledge Base

Scenario: You want to build a local AI assistant that answers questions specifically based on a tech creator’s educational tutorials.

Execution: Instead of manually downloading hundreds of audio streams and paying for whisper transcription services, you point this tool at the creator's video tab in Channel Mode, configuring --limit 30. It bundles their last 30 intensive video guides into a single file. You can instantly feed this .md bundle into a vector database (like Chroma or Pinecone) to build your Retrieval-Augmented Generation (RAG) pipeline.

Use Case 2: Deep Context-Window Competitive Analysis

Scenario: A competitor or creator releases a 3-hour long live stream, keynote presentation, or a series of intensive product reviews, and you need a strategic breakdown fast.

Execution: Pass the target URL through the compiler using Single Video Mode. Upload the generated Markdown file directly to Claude or ChatGPT. Use prompts like: "Analyze this raw script. Identify the 5 core market claims made, list all mentioned competitor product flaws, and summarize the community pain points highlighted."

Use Case 3: Content Repurposing (Video-to-Newsletter)

Scenario: You are a creator or content marketer looking to turn an entire batch of past videos into SEO-optimized blog posts, tweets, or email newsletters.

Execution: By converting video speech chains back into continuous prose blocks, you skip formatting headaches. An LLM can instantly ingest the clean text structures to generate distinct article layouts or summary frameworks while preserving your exact conversational tone.

About

A robust Python utility to extract, clean, and bundle YouTube transcripts from individual videos or entire channels into LLM-ready Markdown files. Includes smart auto-generated captions fallback and silent error logging.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages