Download audio from YouTube and convert it to text using yt-dlp and OpenAI Whisper.
This tool operates as a web server that accepts a YouTube URL (or any other URL supported by yt-dlp) and returns the video's transcript. Alternatively, you can run transcribe.py directly to transcribe a video.
Features
Download audio from YouTube and other supported platforms
Convert audio to text using OpenAI Whisper
Operates as a web server for easy URL submission
Direct transcription via transcribe.py
Installation
Clone the repository:
git clone https://github.com/yourusername/yt-text.git
cd yt-text
(Optional) Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
Install dependencies:
pip install -r requirements.txt
Run the web server:
go run main.go
Usage
To transcribe a video directly, run:
python transcribe.py <youtube-url>
You can also specify the model name to use for transcription:
The default model is base.en. You can choose from other models like tiny, small, medium, large, etc. For more models, visit available models and languages.
Examples
Transcribe a video using the default model:
python transcribe.py <youtube-url>
Transcribe a video using the base model:
python transcribe.py <youtube-url> --model base
License
This project is licensed under the GNU Affero General Public License (AGPL) version 3. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any changes.