CapScript Pro, GUI Based YouTube Transcript Search Tool
CapScript Pro is a Windows desktop application for searching YouTube captions at scale, then turning those findings into usable media outputs.
This repository includes:
- A modern Qt/C++ desktop app.
- An embedded Python engine for YouTube API, transcript fetching, and search logic.
- A standalone Python CLI for headless/automation workflows.
- Overview
- Desktop App Features
- How the Embedded Python Engine Works
- Tech Stack and Dependencies
- Project Structure
- Desktop App Setup
- Build and Run (Qt App)
- CLI Guide
- CLI Setup and Requirements
- CLI Usage
- CLI Examples
- Troubleshooting
- License
CapScript Pro solves a practical workflow:
- Find subtitle matches for a keyword across videos.
- Review exact timestamps inside the built-in viewer.
- Extract clips from the matched moments.
- Render clips into a final output video.
- Build reusable video ID lists for future runs.
The UI is native Qt (C++), while core YouTube logic is powered by Python.
- Search Page: Handles API configuration and flexible search queries for videos or channels. It includes advanced network settings (proxy, cookies), language selection, and encrypted credential persistence.
- Viewer Page: Displays structured transcripts with clickable timestamps and supports in-app video playback. It also allows users to export or import transcript files.
- Clip Downloader: Parses transcripts to identify specific clips for download. It supports various formats (mp4, mkv, webm, mp3), quality controls, and uses worker threads for efficient background processing.
- Renderer Page: Merges downloaded clips into a single final video using FFmpeg. It auto-detects formats and utilizes stream copying for fast, lossless concatenation.
- List Creator: Fetches channel videos based on date ranges or keywords. It provides a selectable list with thumbnail previews and options to export video IDs.
- System & Support: Includes an integrated update checker that stages updates automatically.
The desktop app starts a bundled Python runtime and imports capscript_engine.py through a C++ bridge.
High-level flow:
- The app resolves Python runtime paths near the executable.
- PythonBridge initializes Python with controlled module search paths.
- C++ invokes Python functions for:
- API key validation and storage.
- Proxy settings storage/loading.
- Channel resolution and video lookups.
- Transcript search execution.
- Search progress is sent back into C++ via callback trampolines and displayed in UI/CLI.
This split keeps the UI native and fast while preserving Python ecosystem advantages for YouTube-related operations.
- C++17
- Qt 6 modules:
- Core, Gui, Widgets, Network, Concurrent, Svg
- Optional: Multimedia, MultimediaWidgets
- Optional: Quick, Qml, QuickWidgets, WebView, WebViewQuick
- Python 3 interpreter + development libs for embedding
- Windows WebView2 runtime/SDK (optional but recommended for in-app player)
From python/requirements.txt:
- youtube-transcript-api
- google-api-python-client
- google-auth
- google-auth-httplib2
- google-api-core
- httplib2
- requests
- cryptography
- rich
Required for clip download/render features:
- yt-dlp
- ffmpeg
- ffprobe (normally included with ffmpeg)
The app looks for tools in:
- app/bin/
- app root
- system PATH
Cloudflare Worker (TypeScript) for feedback delivery and basic rate limiting.
- src/: Qt C++ application and workers
- python/: capscript_engine.py + cli.py + Python requirements
- scripts/: utility scripts (including embedded runtime bundling)
- qml/: QML resources for web player integrations
- assets/: app fonts, icons, resources
- cloudflare-worker/: optional feedback backend
- docs/: web documentation assets
- third_party/webview2/: WebView2 SDK assets
- Windows 10/11
- CMake 3.21+
- Qt 6 (matching your compiler toolchain)
- Python 3 with headers/libs discoverable by CMake
- Optional but recommended: WebView2 runtime installed
- Optional for clip/render workflow: yt-dlp and ffmpeg available
Use the provided script to package embeddable Python + pip dependencies into a target python folder:
python scripts/bundle_python.py 3.11.9 .\python .\python\requirements.txtExample CMake flow (Visual Studio generator):
cmake -S . -B build -G "Visual Studio 17 2022" -A x64
cmake --build build --config ReleaseRun the desktop app from build output after ensuring python/ runtime assets are present near the executable.
The repository includes a full command-line interface in python/cli.py for non-GUI usage.
Use CLI when you need:
- Automation (batch jobs, scripting, CI-like tasks).
- Remote/headless execution.
- Fast one-off searches without opening the desktop app.
Recommended: Python 3.10+.
cd python
python -m pip install -r requirements.txtYou need a YouTube Data API v3 key.
You can provide it every run:
python cli.py --api-key YOUR_KEY ...Or save once (encrypted in preferences.ini):
python cli.py --api-key YOUR_KEY --save-api-key --search-type video --video-ids dQw4w9WgXcQ --keyword test- Cookies file (Netscape/Mozilla format): --cookies path\to\cookies.txt
- Proxy modes:
- --proxy-type webshare with username/password
- --proxy-type generic with proxy URL
- Persist proxy settings with --save-proxy
- Clear saved proxy with --clear-proxy
python cli.py --search-type channel --channel "@mkbhd" --keyword "sponsors" --max-results 20- --search-type channel or video
- --keyword "your search term"
- For channel mode: --channel
- For video mode: --video-ids
- --language en
- --output-dir transcripts
- --validate-api-key
- --save-api-key
- --cookies FILE
- --proxy-type, --proxy-username, --proxy-password, --proxy-url
- --save-proxy, --clear-proxy
python cli.py --search-type channel --channel "@mkbhd" --keyword "sponsors" --max-results 20python cli.py --search-type video --video-ids "https://youtu.be/dQw4w9WgXcQ,abc123XYZ00" --keyword "never gonna"python cli.py --api-key YOUR_KEY --save-api-key --search-type video --video-ids dQw4w9WgXcQ --keyword testpython cli.py --search-type channel --channel "UCxxxxxx" --keyword "AI" --proxy-type webshare --proxy-username USER --proxy-password PASS --cookies cookies.txtpython cli.py --proxy-type generic --proxy-url "http://1.2.3.4:8080" --save-proxy
python cli.py --search-type video --video-ids abc123 --keyword test- Python engine fails to initialize in app:
- Ensure python/ exists near the executable and contains runtime artifacts (Lib, python3xx zip, required modules).
- No transcript results:
- Try cookies.txt and/or proxy options.
- Verify language code availability for each video.
- Clip download/render not working:
- Confirm yt-dlp and ffmpeg are installed and discoverable.
- Check app logs for tool path and process errors.
- API errors or quota exceeded:
- Validate key with --validate-api-key.
- Check YouTube Data API quota status in Google Cloud.
This project is licensed under the MIT License + Commons Clause v1.0.
You are free to use, modify, and distribute this software for free, but you may not sell it or offer it as a paid/SaaS service.
See the LICENSE file for the full text