Yt-tracker is a Python project that automatically generates an AI summary from a YouTube video and sends the result to Telegram via a bot.
It is designed for people who want to track videos efficiently and get the key points without watching the entire content.
- 📥 Fetch YouTube video information (URL / video ID)
- 🧾 Extract transcript (subtitles) when available
- 🤖 Generate an AI summary (e.g., OpenAI / LLM-based)
- 💬 Send the summary to Telegram (bot → chat/group)
- 🗂️ Supports caching / storing intermediate results (via
data/)
- Input the @channel name
- Auto fetch the YouTube video from yesterday (UTC+0) by default.
- Extract transcript (or process subtitle files)
- Send the transcript to an AI model to summarize
- Push the summary to Telegram
Based on the current repository layout:
Yt-tracker/
├── .github/ # CI / workflows
├── data/ # Cache / intermediate outputs
├── src/ # Source code
│ └── vtt/
├── .gitignore
├── .python-version
├── main.py # Main entry point
├── pyproject.toml
└── uv.lockgit clone https://github.com/kevinwudev/Yt-tracker.git
cd Yt-trackerpython3 -m venv venv
source venv/bin/activateWindows (PowerShell):
python -m venv venv
venv\Scripts\activateIf the repo provides a lockfile / pyproject, install with your preferred tool:
pip install -e .If you use uv:
uv lock
uv syncCreate a .env file in the project root:
BOT_TOKEN=YOUR_TELEGRAM_BOT_TOKEN
CHAT_ID=YOUR_TELEGRAM_CHAT_ID
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
YOUTUBE_API_KEY=YOUR_YOUTUBE_API_KEY
WAITING_LIST=["@TED", "@CHANNEL_NAME_1", "@CHANNEL_NAME_2"]-
BOT_TOKEN
Your Telegram bot token (from @BotFather). -
CHAT_ID
The target chat ID from your bot.
(Not sure how to get the CHAT_ID and BOT_TOKEN? Have a look here)
-
OPENAI_API_KEY
The API key used for summarization (To register a key here). -
YOUTUBE_API_KEY
API key from YouTube Data API (To register a key here).
Run the main script:
python main.py
python main.py -d YYYY-MM-DD # for fetching the specific date (default yesterday)
python main.py -t # send to telegramTypical behavior:
- reads a target video list/video URL from the given channel name.
- extracts the transcript or downloads to the
.m4afile, then generates the transcript via OpenAI. - generates a summary using the configured AI provider
- sends the summary to Telegram
Recommended improvements if you want to make this production-grade:
- Add structured logging
- Add retries for network calls (YouTube / Telegram / AI)
- Cache transcripts to reduce API cost
- Add a prompt template file (so prompts are not hard-coded)
- Add unit tests for subtitle parsing and message formatting
Contributions are welcome!
- Open an issue for bugs / feature requests
- Submit a pull request for improvements
This project is licensed under the MIT License.
See the LICENSE file for details.