A Dockerized Telegram bot that downloads YouTube videos as MP3 audio and transcribes them using OpenAI Whisper
- 🤖 Telegram bot interface
- 🎵 Download YouTube videos as MP3 audio
- 📝 Transcribe audio using OpenAI Whisper
- 🔄 Automatic cleanup of temporary files
- 📱 Support for long transcriptions (split into multiple messages)
- 🐳 Docker containerized for easy deployment
-
Clone the repository:
git clone <repository-url> cd yt-transcript
-
Create environment file:
# Create .env file echo "TELEGRAM_TOKEN=your_telegram_bot_token_here" > .env echo "WHISPER_MODEL=base" >> .env
-
Run with Docker Compose:
docker-compose up -d
| Variable | Description | Default |
|---|---|---|
TELEGRAM_TOKEN |
Your Telegram bot token (required) | - |
WHISPER_MODEL |
Whisper model size (tiny, base, small, medium, large) | base |
# Build the image
docker build -t yt-transcript-bot .
# Run the container
docker run --env-file .env yt-transcript-bot- Start the bot using Docker
- Open your Telegram bot and send a YouTube URL
- The bot will:
- Download the video as MP3
- Transcribe the audio using Whisper
- Send you the transcription
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://youtube.com/embed/VIDEO_IDhttps://youtube.com/v/VIDEO_ID
/start- Show welcome message and instructions/help- Show detailed help information
You can change the Whisper model size by setting the WHISPER_MODEL environment variable:
tiny- Fastest, least accuratebase- Good balance (default)small- Better accuracymedium- High accuracylarge- Best accuracy, slowest
TELEGRAM_TOKEN=1234567890:ABCdefGHIjklMNOpqrsTUVwxyz
WHISPER_MODEL=base# Start the bot
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the bot
docker-compose down
# Rebuild and restart
docker-compose up -d --buildIf you like this project or directly benefit from it, please consider buying me a coffee:
🔗 bc1qd0qatgz8h62uvnr74utwncc6j5ckfz2v2g4lef
⚡️ derogab@sats.mobi
💶 Sponsor on GitHub
YT-Transcript is made with ♥ by derogab and it's released under the MIT license.
