Skip to content

This repository houses a Python application for extracting YouTube video transcripts and summarizing its content.

License

Notifications You must be signed in to change notification settings

bencmc/youtube_video_summarizer

Repository files navigation

YouTube Video Summarizer

Youtube Video Summarizer is an application that allows users to generate summaries for YouTube videos. The application fetches video transcripts, allows users to select specific chapters to summarize, and provides the option to download the summary as a PDF. This application is particularly useful for extracting valuable insights from content-rich videos such as podcasts, lectures, and interviews.

Motivation

As an avid podcast enthusiast, I found myself consuming a plethora of content on YouTube. However, I often felt the need for a tool that could help me quickly recall and reflect on the vast array of information I was absorbing. This led to the inception of Youtube Video Summarizer, a tool that not only serves as a memory aid by generating succinct summaries of the viewed content but also allows users to download these summaries as PDFs, creating a readable reference that can be revisited at any time.

Screenshot from 2023-09-28 11-25-23

Features

  • Fetch and display YouTube video information including channel title, video title, and tags.
  • Extract video chapters from the description or transcript.
  • Generate summaries for the entire video or selected chapters.
  • Download the generated summary as a PDF.
  • User-friendly interface.

How to Use

  1. Enter your OpenAI API Key and Google API Key in the appropriate fields in the sidebar under 'User Input'.
  2. Input the YouTube video URL you want to summarize in the 'Enter YouTube video URL' field in the sidebar.
  3. Click the 'Start' button once all fields are filled.
  4. Once the video information is fetched, select the chapters you want to summarize in the 'Chapter Selection' section. You can select 'All Chapters' or specific chapters.
  5. Choose the summary type, either 'paragraph' or 'bullet points', from the dropdown list.
  6. Click the 'Summarize' button to generate summaries.
  7. Review the generated summaries in the 'Video Summary' section.
  8. Download the entire summary as a PDF by clicking the 'Download Summary as PDF' button.

Try it out

https://youtubevideosummarizer.streamlit.app/

Q/A

Q: How do I obtain the necessary API keys? A: You'll need to create accounts on the OpenAI Platform and Google Cloud Platform. Once you have accounts, you can generate the necessary API keys for this application.

Q: Are there any limitations to the length or number of videos I can summarize? A: There isn't a specific limitation on the length or number of videos. However, longer videos with more chapters may incur higher costs and take more time to summarize.

Q: What is the cost associated with summarizing a video? A: The cost of summarization is primarily related to the OpenAI API calls made to generate the summaries. It depends on the length of the video, the number of chapters, and whether the chapters are pre-defined or generated by the application. Various examples are provided below to give an idea of the cost for different scenarios. It's advisable to select only the chapters you are interested in to optimize the summarization cost.

Q: What are the costs associated with the Google YouTube Data API? A: The YouTube Data API v3 has a Basic plan which is free and allows for 500 requests per month. This means you can summarize up to 500 video transcripts per month without any additional cost. However, if the usage exceeds 500 requests in a month, you might need to upgrade to a paid plan such as the Pro plan starting at $10.00 per month for up to 10,000 requests per month. It's advisable to monitor your API usage to ensure it stays within the free tier allowance.

Q: How can I optimize the summarization cost? A: To optimize costs, you can choose to summarize only selected chapters rather than the entire video. This reduces the number of API calls and, consequently, the overall cost.

Q: Can I contribute to or modify this project? A: Absolutely! We welcome contributions. Please see the CONTRIBUTING.md file for details on how to contribute to this project.

Q: How do I report bugs or suggest new features? A: You can report bugs, suggest features, or contribute to discussions by opening an issue on the GitHub repository. We appreciate community feedback and contributions!

Technology Stack

  • Python
  • Streamlit
  • OpenAI GPT-3.5 Turbo
  • Google YouTube Data API v3
  • FPDF for PDF generation
  • Langchain for text processing and embeddings

Contributing

We welcome contributions! Please see the CONTRIBUTING.md for details on how to contribute to this project.

License

This project is licensed under the MIT license - see the LICENSE file for details.

Installation & Setup

# Clone the repository
git clone git@github.com:bencmc/youtube_video_summarizer.git

# Navigate to the project directory
cd youtube_video_summarizer/

# Set up the virtual environment
python3 -m venv venv

# Activate the virtual environment
# For Windows
.\venv\Scripts\activate

# For MacOS/Linux
source venv/bin/activate

# Install the required packages
pip install -r requirements.txt

# Run application
streamlit run youtube_video_summarizer.py