This project provides a FastAPI-based service to transcribe and summarize YouTube videos. It uses the youtube_transcript_api
to fetch video transcripts and the OpenAI API to generate summaries.
- Clone the repository.
- Create a virtual environment and activate it.
python -m venv .venv source .venv/bin/activate
- Install the required dependencies:
pip install -r requirements.txt
- Create a
.env
file and add your Grok API key:GROK_API_KEY=your_openai_api_key
- Go to localhose:8000/docs for the FastAPI Swagger UI docs.
- Enter the YouTube video id and click the "Summarize" button.
- For a video with url "https://www.youtube.com/watch?v=RH7REzcVjMI&ab_channel=AliAbdaal", the video id is "RH7REzcVjMI". Note: Will add method to use video url directly. Note: There is no audio downloading and audio -> transcript conversion. The video transcript is fetched directly from the youtube-transcript-api. Will add technique for audio -> transcript conversion if directly not available.
Start the FastAPI server:
fastapi dev main.py