-
Install the required dependencies:
pip install -r requirements.txt
Note: You may need
ffmpeginstalled on your system for video processing. -
GPU Support (Recommended): For faster processing and better accuracy (OCR), install PyTorch with CUDA support:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
-
Configuration:
-
Duplicate the example configuration file:
cp .env.example .env
-
Open
.envand add your Gemini API Key (get one from Google AI Studio). -
This is required for advanced transcript cleaning features.
-
This is required for advanced transcript cleaning features.
-
-
Ollama (Optional - For AI Transcript Cleaning):
- Install Ollama.
- Pull the required model (default is
gemma3):ollama pull gemma3
- Ensure Ollama is running (
ollama serve).
If you encounter "Sign in to confirm you're not a bot" errors:
- Automatic: Log in to YouTube in Chrome, Edge, or Firefox. The tool attempts to extract cookies automatically.
- Manual:
- Export your YouTube cookies to Netscape format (using a browser extension like "Get cookies.txt LOCALLY").
- Save as
cookies.txt. - Use the CLI:
python main.py URL --cookies cookies.txt.
Start the web application:
python app.pyOpen your browser to http://localhost:5000.
Workflow:
- Start: Enter a YouTube URL or select an existing project.
- Process: The system downloads the video, extracts frames, and detects duplicates.
- Options:
- Skip Video Download: Use existing video file if available.
- Skip Extraction: Use existing extracted images.
- Skip Deduplication: Use existing deduplication results.
- Download Transcript: Download subtitles/transcript from YouTube.
- Options:
- Curate: Review the extracted slides in the "Curate Slides" interface.
- Green: Kept slides.
- Red: Detected duplicates (discarded).
- Yellow: Detected blanks (discarded).
- Click any slide to toggle its status.
- Edit: Review the synchronized transcript for each slide.
- Generate: Download your final PDF or DOCX.
You can extract transcripts from YouTube playlists or local directories (recursively) using the dedicated tool:
# Process a YouTube Playlist
python bulk_transcribe.py "https://www.youtube.com/playlist?list=PL..." -o ./output
# Process a Local Directory (creates transcripts using Whisper)
python bulk_transcribe.py "./my_videos" -o ./output --model base- YouTube Playlists: Downloads all available transcripts/captions.
- Local Videos: Automatically transcribes video/audio files (
.mp4,.mp3, etc.) using OpenAI Whisper. - Recursive: Scans subfolders for local files.
- Models: Supports different Whisper model sizes (
tiny,base,small,medium,large).
You can also run the pipeline from the command line:
python main.py <VIDEO_URL_OR_PATH> [OPTIONS]Common Options:
--download-transcript: Download subtitles/transcript from YouTube.--create-docx: Generate a DOCX file with synchronized transcript.--create-combined: Generate a PDF file with synchronized transcript.--optimize-images: Resize and compress images to reduce output file size.
This repository is organized as follows:
app.py: Main Flask web application.main.py: CLI entry point.scripts/: Utility scripts (e.g.,analyze_images.py,convert_md_to_docx.py) and experimental tools.docs/: Documentation files including testing guides and optimization reports.experiments/: Source code for previous experiments (deduplication, compression).archive/: Deprecated code and temporary files.
The tool organizes outputs into a structured folder:
output/
└── Video Title/
├── video/ # Downloaded video file
├── images/ # Extracted screenshots
│ └── organized_moderate/ # Curated unique/duplicate folders
├── transcripts/ # Raw transcript files
├── Video Title.pdf # Final PDF
├── Video Title.docx # Final DOCX
└── metadata.txt # Video metadata
For more detailed documentation, please check the docs/ folder.