This is a Telegram bot that can download audio from YouTube videos and summarize the content using OpenAI's GPT-3 engine. It's a handy tool for quickly extracting insights from YouTube content.
Before using the bot, make sure you have the following prerequisites:
- Python 3.7 or higher
- python-telegram-bot library
- pytube library
- moviepy library
- openai library
- An OpenAI API key
You can install the required Python libraries by running:
pip install -r requirements.txt
-
Clone this repository to your local machine.
-
Set up your OpenAI API key by replacing
'YOUR_OPENAI_API_KEY'
in the code with your actual API key. -
Create a bot on Telegram and get your TELEGRAM_API_KEY. You can follow the Telegram BotFather guide to create a bot and obtain the API key.
-
Set your TELEGRAM_API_KEY by replacing
'YOUR_TELEGRAM_API_KEY'
in the code with your actual API key. -
Run the bot:
python Yts full.py
- Start a chat with your bot on Telegram and send it a YouTube link. It will download the video, extract the audio, and provide a summary of the content.
- Send a YouTube link to the bot.
- The bot will download the video, extract audio, and summarize the content using OpenAI's GPT-3 engine.
- Enjoy quick insights from YouTube videos!
You can customize the bot's behavior by modifying the code. For example, you can adjust the summarization length by changing the max_tokens
in the openaiHandler
function.
This project is licensed under the MIT License. See the LICENSE file for details.
- Thanks to the developers of the Telegram Bot API, pytube, moviepy, and OpenAI for their fantastic libraries.