- Features
- Prerequisites
- Installation Guide
- How to Use
- Project Structure
- Troubleshooting
- Contributing
- License
- YouTube Video ID Extraction : Automatically extracts the video ID from a YouTube URL.
- Transcript Retrieval : Fetches subtitles for the video in Turkish (tr) or English (en).
- Video Details : Retrieves the title, channel name, and description of the video using the YouTube Data API.
- Summarization : Uses the Ollama API to generate concise summaries of the video's transcript.
- Analysis : Provides a detailed analysis of the summarized content, including key points, biases, and further research topics.
- User-Friendly Interface : Simple web interface for inputting YouTube URLs and viewing results.
Before running the project, ensure you have the following installed:
- Python 3.8+ : The project is built using Python.
- Flask : A lightweight web framework for Python.
- youtube-transcript-api: For fetching video transcripts.
- google-api-python-client: For interacting with the YouTube Data API.
- ollama: For generating summaries and analyses.
- dotenv: For managing environment variables.
- Ollama API : Ensure you have access to the Ollama API and its llama3 model.
- Visit the Ollama website to learn more about the API and how to obtain access.
- YouTube Data API Key : Obtain an API key from the Google Cloud Console .
Step 1: Clone the Repository
- Clone the project repository from GitHub:
- cd youtube-summarizer
Step 2: Set Up a Virtual Environment (Optional but Recommended)
- Create and activate a virtual environment to isolate dependencies:
- python -m venv venv
- source venv/bin/activate # On Windows: venv\Scripts\activateStep 3: Install Dependencies
- Install the required Python packages using pip:
pip install -r requirements.txtStep 4: Configure Environment Variables
- Create a .env file in the project root directory
touch .envAdd your API keys to the .env file:
API_KEY=your_youtube_data_api_key_hereStep 5: Install and Configure Ollama
- Install Ollama :
- Follow the installation instructions on the Ollama website .
- Ensure the ollama CLI tool is available in your system's PATH.
- Verify Ollama Installation :
- Run the following command to check if Ollama is installed correctly:
Verify Ollama Installation:
ollama --versionDownload the llama3 Model :
- Use the following command to download the llama3 model:
ollama pull llama3Step 6: Run the Application
- Start the Flask development server:
python app.py- Open the app in your browser by navigating to http://127.0.0.1:5000/.
- Enter the YouTube video URL in the input field and click "Submit."
- Wait for the app to process the video:
- It will fetch the video details, transcript, summary, and analysis.
- View the results on the result page:
- Title : The title of the video.
- Channel : The name of the channel.
- Description : The video description.
- Summary : A concise summary of the video's content (generated by Ollama).
- AI Analysis : A detailed analysis of the summarized content (powered by Ollama).
- Transcript : The full transcript of the video (if available).
youtube-summarizer/
├── app.py # Main Flask application file
├── requirements.txt # List of Python dependencies
├── templates/
│ ├── index.html # Home page template
│ ├── result.html # Result page template
├── .env # Environment variables (API keys)
├── README.md # This documentation file- Common Issues and Solutions
- No Subtitles Found : Some videos do not have subtitles enabled. Ensure the video has subtitles in Turkish or English.
- API Key Errors : Double-check that your API_KEY is correctly set in the .env file. Ensure the YouTube Data API is enabled in your Google Cloud Console.
- Ollama API Errors : Verify that the Ollama API is accessible and properly configured. Ensure the llama3 model is downloaded using ollama pull llama3.
- Check your internet connection.
- Missing Dependencies :
Run
bashpip install -r requirements.txtto install all required packages.
We welcome contributions! If you'd like to contribute to this project:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a detailed description of your changes.