Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

  • Features
  • Prerequisites
  • Installation Guide
  • How to Use
  • Project Structure
  • Troubleshooting
  • Contributing
  • License

Features

  • 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.

Prerequisites

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.

Dependencies :

  • 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 .

Installation Guide

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\activate

Step 3: Install Dependencies

  • Install the required Python packages using pip:
pip install -r requirements.txt

Step 4: Configure Environment Variables

  • Create a .env file in the project root directory
touch .env

Add your API keys to the .env file:

API_KEY=your_youtube_data_api_key_here

Step 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 --version

Download the llama3 Model :

  • Use the following command to download the llama3 model:
ollama pull llama3

Step 6: Run the Application

  • Start the Flask development server:
python app.py

How to Use

  • 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).

Project Structure

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

Troubleshooting

  • 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.txt to install all required packages.

Contributing

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages