This project provides a command-line tool for downloading YouTube videos, extracting their audio, splitting the audio into manageable chunks, transcribing the audio using OpenAI's Whisper API, summarizing the transcription using OpenAI's GPT-4, and optionally converting the summary back to speech.
Before you begin, ensure you have met the following requirements:
yt_dlp
for audio processing).requirements.txt
file.Clone the repository:
git clone https://github.com/yourusername/YouTube-Audio-Summarizer.git
cd YouTube-Audio-Summarizer
Install the dependencies:
pip install -r requirements.txt
Set up your OpenAI API key:
Create a .env
file in the root directory of the project and add your OpenAI API key:
OPENAI_KEY=your_openai_api_key
Ensure FFmpeg is installed:
Follow the instructions on the FFmpeg website to install FFmpeg on your system.
To use this tool, run the summarize
command with the necessary options:
python main.py summarize --url <YouTube-URL> [--log <log-level>] [--clean] [--tts]
--url
: (Required) The URL of the YouTube video to process.--log
: (Optional) Set the logging level. Options are INFO
, ERROR
, DEBUG
, CRITICAL
. Default is INFO
.--clean
: (Optional) Remove previously downloaded and processed files before starting.--tts
: (Optional) Convert the final summary back to speech.Download, transcribe, and summarize a YouTube video:
python main.py summarize --url https://www.youtube.com/watch?v=dQw4w9WgXcQ
Download, transcribe, summarize, and convert the summary to speech:
python main.py summarize --url https://www.youtube.com/watch?v=dQw4w9WgXcQ --tts
yt_dlp
.The tool provides comprehensive logging at different levels (INFO
, ERROR
, DEBUG
, CRITICAL
). By default, the logging level is set to INFO
. You can change the logging level using the --log
option.
Contributions are welcome! Please fork the repository and create a pull request with your changes. Make sure to update the documentation as needed.
This project is licensed under the MIT License. See the LICENSE
file for more information.
Feel free to open an issue or contact us if you have any questions or feedback.