A Python application that downloads YouTube videos, transcribes them using Groq's Whisper model, and provides summaries using Cerebras LLM.
- Download YouTube videos
- Extract and process audio
- Speed up audio for faster processing
- Transcribe audio using Groq's Whisper model
- Generate summaries using Cerebras LLM
- REST API endpoints for video processing
- Web interface support via CORS
- Python 3.8 or higher
- FFmpeg
- yt-dlp
- Poetry (Python package manager)
- Groq API key
- Cerebras API key
Run the setup script (requires administrator privileges):
.\setup.ps1
Make the setup script executable and run it with sudo:
chmod +x setup.sh
sudo ./setup.sh
-
Install FFmpeg and yt-dlp:
Windows:
choco install ffmpeg choco install yt-dlp
Ubuntu/Debian:
sudo apt-get install ffmpeg python3-pip sudo pip3 install --upgrade yt-dlp
MacOS:
brew install ffmpeg brew install yt-dlp
-
Install Poetry:
curl -sSL https://install.python-poetry.org | python3 -
-
Install project dependencies:
poetry install
-
(Optional) Install as a System Service:
Windows:
# Run as Administrator .\install_service.bat
Linux:
sudo ./install_service_linux.sh
- Create a
.env
file in the project root or rename.env.example
to.env
and fill in the values:GROQ_API_KEY=your_groq_api_key_here CEREBRAS_API_KEY=your_cerebras_api_key_here
poetry run python app.py "https://youtube.com/watch?v=your_video_id"
poetry run python server.py
Windows:
# Start service
net start YTTranscriberService
# Stop service
net stop YTTranscriberService
# Restart service
.\restart_service.bat
Linux:
# Start service
sudo systemctl start youtube-transcriber
# Stop service
sudo systemctl stop youtube-transcriber
# Restart service
sudo systemctl restart youtube-transcriber
# View service status
sudo systemctl status youtube-transcriber
# View logs
sudo journalctl -u youtube-transcriber
The server will start on port 5000 with the following endpoints:
-
POST
/download
: Download a YouTube video{ "url": "https://youtube.com/watch?v=your_video_id" }
-
POST
/transcribe
: Transcribe and summarize a YouTube video{ "url": "https://youtube.com/watch?v=your_video_id", "speed_factor": 2.0 }
youtube-transcriber/
├── app.py # CLI application
├── server.py # Flask server
├── setup.sh # Linux/MacOS setup script
├── setup.ps1 # Windows setup script
├── install_service.bat # Windows service installer
├── install_service_linux.sh # Linux service installer
├── restart_service.bat # Windows service restart utility
├── youtube-transcriber.service # Linux systemd service configuration
├── pyproject.toml # Poetry configuration
├── .env # Environment variables
└── README.md # This file
-
Install development dependencies:
poetry install --with dev
-
Run tests:
poetry run pytest
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
-
FFmpeg not found:
- Ensure FFmpeg is installed and available in your system PATH
- Try reinstalling FFmpeg using your package manager
-
yt-dlp errors:
- Update yt-dlp to the latest version:
pip install --upgrade yt-dlp
- Update yt-dlp to the latest version:
-
API Key Issues:
- Verify your API keys are correctly set in the .env file
- Ensure the .env file is in the project root directory
-
Service Installation Issues:
Windows:
- Ensure you're running the installation scripts as Administrator
- Check the service logs in
C:\ProgramData\YTTranscriber\logs\service.log
- Use Event Viewer to check for service-related errors
Linux:
- Check service status:
sudo systemctl status youtube-transcriber
- View service logs:
sudo journalctl -u youtube-transcriber
- Verify permissions in
/opt/youtube-transcriber
If you encounter any issues:
- Check the error messages in the console
- Verify all prerequisites are installed
- Ensure all environment variables are set correctly
- Check the project's issue tracker for similar problems
- Keep your API keys secure and never commit them to version control
- Use environment variables for sensitive configuration
- Regularly update dependencies to patch security vulnerabilities