diff --git a/.gitignore b/.gitignore index 4d9342c..837e0bf 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ users.txt # Vite vite.config.js.timestamp-* vite.config.ts.timestamp-* + +# Whisper venv +.venv/ diff --git a/INSTALL.md b/INSTALL.md index 73d3af5..779dbe3 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -80,6 +80,30 @@ Edit `start.sh` to configure the variables below, or pass them directly on the c | `USERS_FILE` | `users.txt` next to `start.sh` | Path to the user database file | | `ADS_DIR` | same directory as `start.sh` | Directory containing `ads-left.html` and `ads-right.html` | +### Whisper transcription fallback + +When a download yields no subtitles (e.g. Instagram, archive.org), the server +transcribes the media locally with [faster-whisper](https://github.com/SYSTRAN/faster-whisper) +and feeds the result through the same VTT→Markdown conversion. The fallback +is skipped with a warning if faster-whisper is not installed. + +Setup (GPU recommended; the pip-installed cuBLAS/cuDNN libraries are found +automatically, no `LD_LIBRARY_PATH` needed): + +```bash +python3 -m venv .venv +.venv/bin/pip install faster-whisper "nvidia-cublas-cu12<13" "nvidia-cudnn-cu12<10" +``` + +The model (~1.6 GB for `large-v3-turbo`) is downloaded from Hugging Face on +first use and cached in `~/.cache/huggingface`. + +| Variable | Default | Purpose | +|---|---|---| +| `WHISPER_PYTHON` | `python3` | Python interpreter with faster-whisper installed (e.g. `.venv/bin/python`) | +| `WHISPER_MODEL` | `large-v3-turbo` | faster-whisper model name (`large-v3` for best quality, `small` for low-end machines) | +| `WHISPER_DEVICE` | _(auto)_ | Force `cuda` or `cpu`; by default CUDA is tried first with CPU fallback | + ### ZIP & Send mode When `ZIP_AND_SEND=true`, all downloaded files are packed into a ZIP and offered as a browser download instead of (only) being saved on the server. A random prefix is added to the temporary directory name to avoid collisions when multiple users download the same video simultaneously. diff --git a/README.md b/README.md index 331d01e..7dd4ce0 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ YouTube Downloader & Transcript Extractor — a local web frontend for `yt-dlp` - Paste a YouTube URL and download the best available video quality - Subtitles downloaded automatically in the video's original language, English, and German (where available) - Subtitles converted to clean Markdown (timestamps stripped, text deduplicated and paragraph-wrapped) +- Videos without subtitles (Instagram, archive.org, …) are transcribed locally via Whisper (faster-whisper, GPU-accelerated) — see `INSTALL.md` - Optional audio extraction to MP3 via ffmpeg - Real-time progress log streamed to the browser - Files saved to `~/YouTube/