The Telegram YouTube Summarizer Bot is a tool designed to send summarized content of YouTube videos directly to your telegram groups or channels
This guide will provide you with the instructions to set up the Video Processing Telegram Bot. Please follow these steps carefully.
Before starting, make sure you have Python installed on your system.
The bot needs access to the YouTube API to fetch the latest videos from specific channels.
- Navigate to the Google Cloud Console.
- Create a new project, or select an existing one.
- Enable the YouTube Data API v3 on your project by navigating to
APIs & Services -> Library -> YouTube Data API v3
. - Navigate to
APIs & Services -> Credentials
and click onCREATE CREDENTIALS -> API key
. - Copy the generated API key.
In the config.py script, replace YOUR_YOUTUBE_API_KEY
with your generated API key.
To filter videos from specific channels, you need to provide the IDs of these channels.
Replace channel_id1
, channel_id2
, etc. in the CHANNEL_IDS
list with the IDs of the channels you are interested in.
The bot will send the key takeaways to a specific Telegram channel.
- Create a new bot using the BotFather on Telegram. Follow the instructions provided by the BotFather to get your bot token.
- Copy the bot token.
In the config.py script, replace YOUR_BOT_TOKEN
with your bot token.
You need to provide the ID of the Telegram channel where the bot will send the messages.
https://neliosoftware.com/content/help/how-do-i-get-the-channel-id-in-telegram/
Replace YOUR_TELEGRAM_CHANNEL_ID
with the ID of your Telegram channel.
The bot uses OpenAI's GPT-3.5-turbo-16k to generate key takeaways from the video descriptions.
- Navigate to the OpenAI website.
- Create a new API key.
- Copy the generated API key.
In the config.py script, replace YOUR_OPENAI_API_KEY
with your generated API key.
The bot uses a txt file to store the IDs of the processed videos.
Replace video_store.json
in STORE_FILE
with the path to your txt file. If the file does not exist, the bot will create it.
Once you have made these modifications, you should be ready to run the Python script.
python main.py
YOUTUBE_API_SERVICE_NAME = 'youtube'
YOUTUBE_API_VERSION = 'v3'
YOUTUBE_API_KEY = 'XXXX' # replace with your actual YouTube API key
CHANNEL_IDS = ['xxx', 'xxx', 'xxx'] # replace with actual YouTube channel IDs
BOT_TOKEN = '000000000:AABBCCDDEEFFGGHHIIJJKKMMLLOOPPRRSS' # replace with your actual Telegram bot token
TELEGRAM_CHANNEL_ID = -123456789 # replace with your actual Telegram channel ID
OPENAI_API_KEY = 'sk-xxx' # replace with your actual OpenAI API key
PRIMARY_MODEL = 'gpt-3.5-turbo-16k' # replace with your preferred OpenAI model
SECONDARY_MODEL = 'gpt-3.5-turbo' # replace with your preferred OpenAI model
STORE_FILE = 'video_store.txt'