This tool downloads audio from a YouTube video and transcribes it to a text file using the faster-whisper AI model.
This project requires ffmpeg and specific Python libraries that can be tricky to install on some local machines (especially older macOS versions). Running this in GitHub Codespaces provides a pre-configured Linux environment where everything just works.
- FFmpeg: This is required for audio processing.
- Codespaces: Installed automatically!
- macOS: Install via Homebrew:
brew install ffmpeg - Windows: Download from ffmpeg.org and add to PATH.
- Linux:
sudo apt install ffmpeg
- Push this folder to a GitHub repository.
- Click the "Code" button on your repository page.
- Select the "Codespaces" tab and click "Create codespace on main".
- Wait for the environment to build. It will automatically install
ffmpegand all Python dependencies.
-
Navigate to the project directory:
cd youtube_transcribe -
Create and activate a virtual environment (already done if you followed the assistant):
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
Run the script:
python transcribe.pyOr provide the URL directly:
python transcribe.py "https://www.youtube.com/watch?v=..."The transcription will be saved as a .txt file in the downloads folder.