A Flask-based web application that transcribes YouTube videos and generates AI-powered summaries. The application provides an intuitive interface for users to input YouTube URLs and receive transcripts along with customizable summaries.
- 🎥 Video Information Display (title, duration, thumbnail)
- 📝 Automatic Video Transcription
- 🤖 AI-Powered Summarization with adjustable length (short, medium, long)
- 💾 Download Transcripts as Text Files
- 📚 History of Previously Processed Videos
Before running the application, you'll need:
- Python 3.11 or later
- A YouTube Data API key (for video information)
- An OpenAI API key (for summarization)
- PostgreSQL database
- Clone the repository:
git clone https://github.com/s2k14/youtube-transcriber.git
cd youtube-transcriber
- Install required packages:
pip install -r requirements.txt
- Set up environment variables:
Create a
.env
file in the project root with the following variables:
YOUTUBE_API_KEY=your_youtube_api_key
OPENAI_API_KEY=your_openai_api_key
DATABASE_URL=postgresql://username:password@localhost:5432/dbname
SESSION_SECRET=your_secret_key
- Create and set up the database:
# Using psql
createdb youtube_transcriber
- Run the Flask application:
python main.py
The application will be available at http://localhost:5000
The project includes a comprehensive test suite covering utilities, API endpoints, and database models. No external services are required for testing as all external APIs are mocked.
To run the complete test suite:
python run_tests.py
To run a specific test file:
python -m unittest tests.test_youtube
python -m unittest tests.test_summarizer
python -m unittest tests.test_app
python -m unittest tests.test_models
To run a specific test case:
python -m unittest tests.test_youtube.TestYouTubeUtils.test_extract_video_id_standard_url
tests/test_youtube.py
: Tests for YouTube utility functionstests/test_summarizer.py
: Tests for OpenAI summarization functionalitytests/test_app.py
: Tests for Flask routes and API endpointstests/test_models.py
: Tests for database models and operations
- Visit the application in your web browser
- Paste a YouTube video URL in the input field
- Select your desired summary length (short, medium, or long)
- Click "Transcribe & Summarize"
- View the video information, summary, and full transcript
- Download the transcript if needed
- 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.