A lightweight Flask application that ingests a YouTube URL, downloads the video's audio track with yt-dlp, converts it to 16 kHz mono WAV via ffmpeg, and sends the audio to Groq's Whisper API for high-quality speech-to-text output. The UI (Bootstrap + custom CSS) displays the full transcript alongside segment-level timestamps for quick scanning.
- Paste any public YouTube link; the backend handles download, conversion, and cleanup.
- Segment timeline with start/end timestamps derived from the Whisper verbose JSON response.
- Simple Flask front end styled with Bootstrap 5 and a custom hero section.
- CLI helper (
script.py) to transcribe arbitrary local audio files without the web UI.
- Python 3.10+
ffmpegavailable on your PATH (configurable viaFFMPEG_BINARY).- Groq account + API key (environment variable recommended).
python -m venv .venv
.venv\Scripts\activate # PowerShell on Windows
pip install -r requirements.txt
set FLASK_APP=app.py
set GROQ_API_KEY=your_api_key # see note below
flask runThen open http://127.0.0.1:5000 and submit a YouTube URL.
Important: The current implementation in
script.pyhardcodes an API key in_build_client. Replace that value withos.environ["GROQ_API_KEY"](or similar) before deploying or sharing the project to keep credentials out of the codebase.
GROQ_API_KEY– Groq Whisper API key (should be kept secret).FLASK_SECRET_KEY– optional Flask session secret.FFMPEG_BINARY– path to anffmpegbinary when not on PATH.
app.py # Flask routes and yt-dlp/ffmpeg integration
script.py # Groq Whisper helper + CLI entry point
templates/index.html
static/styles.css
downloads/ # temp input audio (auto-created)
processed/ # temp WAV output (auto-created)
Transcribe a local file without the Flask UI:
python script.py path/to/audio.wav --language en --temperature 0.0The script prints the verbose JSON transcription to stdout.
- Verify
ffmpeg -versionruns from the same shell; otherwise setFFMPEG_BINARY. - Clean the
downloads/andprocessed/folders if a previous run was interrupted. - Set
FLASK_DEBUG=1for verbose error messages during development.
- Persist transcripts per user and allow downloads.
- Support direct file uploads instead of YouTube-only input.
- Swap the hardcoded Groq key for an environment-based configuration helper.