This tool allows you to transcribe YouTube videos. It uses OpenAI's Whisper model for transcription.
- Download audio from YouTube videos
- Transcribe audio using OpenAI's Whisper model with:
- 99% transcription accuracy
- Support for 98+ languages with auto-detection
- Robust handling of accents and background noise
- High-quality speech recognition
- Save transcriptions to a text file
- Secure storage of OpenAI API key
- Python 3.7 or higher
- pip (Python package installer)
- OpenAI API key (get it from https://platform.openai.com/api-keys)
See .env.example
for environment variable setup. The actual environment file will be created automatically when you run the script.
-
Clone this repository:
git clone https://github.com/PierrunoYT/YT2Text.git cd YT2Text
-
Create and activate a virtual environment:
python -m venv venv venv\Scripts\activate
-
Install required packages:
pip install -r requirements.txt
-
Clone this repository:
git clone https://github.com/PierrunoYT/YT2Text.git cd YT2Text
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install required packages:
pip install -r requirements.txt
-
Clone this repository:
git clone https://github.com/PierrunoYT/YT2Text.git cd YT2Text
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install required packages:
pip install -r requirements.txt
-
Run the script:
python youtube_transcriber.py # Windows python3 youtube_transcriber.py # macOS/Linux
-
Follow the prompts to:
- Enter your OpenAI API key (only required on first run)
- Provide a YouTube video URL
- Specify the output file name for the transcription
-
The script will download the audio, transcribe it, and save the transcription to a file.
- The OpenAI API key is stored securely in your home directory.
- Temporary audio files are automatically cleaned up after processing.
- On Linux and macOS, you might need to use
python3
instead ofpython
depending on your system configuration.
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2025 PierrunoYT