Skip to content

kharbandaraghu/AI-Youtube-Summarizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 

Repository files navigation

AI Youtube Summarizer

This shell script is designed to generate a concise summary of the transcript of a YouTube video provided as input. The summary is generated using the OpenAI API and the GPT-3.5 model. Before using the script, please make sure you have the necessary dependencies and packages installed.

Prerequisites

  • Homebrew package manager (for macOS users)
  • yt-dlp - YouTube video downloader with extra features
  • jq - Command-line JSON processor

Installation

  1. Install Homebrew (for macOS users) by running the following command in the terminal:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. Install yt-dlp and jq using Homebrew:

    brew install yt-dlp jq
    

Usage

Follow these steps to use the shell script:

  1. Set up your OpenAI API key as an environment variable:

    export OPENAI_API_KEY="your_openai_api_key_here"
    

    Replace "your_openai_api_key_here" with your actual API key.

  2. Execute the shell script in the terminal:

    ./generate_summary.sh <YouTube_video_URL>
    

    Replace <YouTube_video_URL> with the URL of the YouTube video for which you want to generate the summary.

  3. The script will perform the following steps:

    • Download the video subtitles in English and convert them to a text file.
    • Pre-process the text file to remove timestamps and HTML tags.
    • Use the OpenAI API to generate a concise summary of the video transcript using the GPT-3.5 model.
    • Save the generated summary to a file named "Summary.txt" on your desktop.

Notes

  • The script uses yt-dlp to fetch subtitles for the YouTube video. The subtitle file will be saved as "transcript.en.srt".
  • The generated summary will be limited to a maximum of 700 tokens (adjustable via the "max_tokens" variable in the script).
  • The GPT-3.5 model is used with a temperature of 0.7 for more diverse responses.

Disclaimer

  • The quality and accuracy of the generated summary heavily depend on the OpenAI GPT-3.5 model and the input transcript. The result may not always be perfect or match your expectations.

Please ensure you have obtained the necessary rights and permissions to use the YouTube video content and comply with the terms of service of the platforms involved.

This readme file was generated by AI; thanks chatGPT for making my life easier :)

About

AI youtube summarizer script for mac. Can be turned into a mac shortcut also

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages