Skip to content

Duccioo/TLDR-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

151 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TLDR Bot Logo

πŸ€– TLDR Bot

Your AI-Powered Article Summarizer for Telegram

Python 3.11+ License Docker Telegram Bot

Scrape any web article, extract its content, and get AI-generated summaries in seconds!


✨ Features

Feature Description
πŸ”— Smart Web Scraping Extracts main content from any URL using advanced parsing
🧠 Multi-LLM Support Choose from Gemini, Groq, or OpenRouter models
πŸ“ Customizable Prompts Multiple summary styles: Technical, ELI5, Q&A, Social Media, and more
🌍 Multi-Language Output Configure summary output language via environment variable
πŸ” Web Search Integration Enhance summaries with additional web context
πŸ“° Telegraph Publishing Generate beautiful, readable Telegraph pages for long summaries
πŸ“Š API Quota Tracking Monitor usage and prevent rate limit issues
πŸ” Password Protection Secure bot access with optional authentication
🐳 Docker Ready Easy deployment with Docker and Docker Compose
πŸ“Œ Linkwarden Integration Save summarized articles directly to your Linkwarden instance
πŸ›‘οΈ FlareSolverr Support Bypass Cloudflare protection for difficult sites

πŸš€ Quick Start

Prerequisites

Installation

1️⃣ Clone the Repository

git clone https://github.com/Duccioo/TLDR-bot.git
cd TLDR-bot

2️⃣ Configure Environment

cp .env.example .env

Edit .env with your credentials:

# Required
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
GEMINI_API_KEY=your_gemini_api_key

# Optional: Additional LLM Providers
GROQ_API_KEY=your_groq_api_key
OPENROUTER_API_KEY=your_openrouter_api_key

# Optional: Bot Settings
BOT_PASSWORD=your_secure_password
SUMMARY_LANGUAGE=English

# Optional: Linkwarden
LINKWARDEN_URL=https://linkwarden.yourdomain.com
LINKWARDEN_API_KEY=your_linkwarden_api_key

# Optional: Advanced
FLARESOLVERR_URL=http://localhost:8191/v1

3️⃣ Install Dependencies

pip install -r requirements.txt

▢️ Running the Bot

πŸ–₯️ Local Development

python src/bot.py

🐳 Docker Deployment

docker-compose up -d

πŸ“– Usage

  1. πŸš€ Start the bot β€” Open your Telegram bot and enter the password (if configured)
  2. πŸ”— Send a URL β€” Paste any article link
  3. πŸ“„ Get your summary β€” Receive an instant AI-generated summary
  4. πŸ“° Expand to Telegraph β€” Click the button to generate a full Telegraph article

⌨️ Available Commands

Command Description
🎨 Choose Prompt Select summary style (Technical, ELI5, Q&A, etc.)
πŸ”„ Change Model Switch between Gemini, Groq, or OpenRouter models
πŸ” Toggle Web Search Enable/disable web context enrichment
πŸ“Š Check Quota View your current API usage

πŸ“ Project Structure

TLDR-bot/
β”œβ”€β”€ πŸ“‚ src/                    # Source code
β”‚   β”œβ”€β”€ πŸ“‚ core/               # Core logic
β”‚   β”‚   β”œβ”€β”€ extractor.py       # Content extraction
β”‚   β”‚   β”œβ”€β”€ scraper.py         # Web scraping
β”‚   β”‚   β”œβ”€β”€ summarizer.py      # LLM integration
β”‚   β”‚   β”œβ”€β”€ quota_manager.py   # API quota tracking
β”‚   β”‚   β”œβ”€β”€ history_manager.py # User history
β”‚   β”‚   └── user_manager.py    # User management
β”‚   β”œβ”€β”€ πŸ“‚ handlers/           # Telegram bot handlers
β”‚   β”‚   β”œβ”€β”€ auth_handlers.py   # Authentication
β”‚   β”‚   β”œβ”€β”€ command_handlers.py
β”‚   β”‚   β”œβ”€β”€ message_handlers.py
β”‚   β”‚   └── callback_handlers.py
β”‚   β”œβ”€β”€ πŸ“‚ prompts/            # Summary prompt templates
β”‚   β”‚   β”œβ”€β”€ technical_summary.md
β”‚   β”‚   β”œβ”€β”€ eli5_summary.md
β”‚   β”‚   β”œβ”€β”€ social_media_post.md
β”‚   β”‚   β”œβ”€β”€ qna.md
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ bot.py                 # Main entry point
β”‚   β”œβ”€β”€ config.py              # Configuration
β”‚   └── keyboards.py           # Telegram keyboards
β”œβ”€β”€ πŸ“‚ data/                   # Runtime data (quota, history)
β”œβ”€β”€ πŸ“‚ docs/                   # Documentation
β”‚   β”œβ”€β”€ ARCHITECTURE.md
β”‚   β”œβ”€β”€ CONFIGURATION.md
β”‚   β”œβ”€β”€ CONTRIBUTING.md
β”‚   └── INSTALLATION.md
β”œβ”€β”€ 🐳 Dockerfile
β”œβ”€β”€ 🐳 docker-compose.yml
β”œβ”€β”€ πŸ“‹ requirements.txt
└── πŸ“„ LICENSE

πŸ€– Supported LLM Providers

Provider Models Free Tier
Google Gemini gemini-2.5-flash, gemini-2.0-flash βœ… Yes
Groq Various open-source models βœ… Yes
OpenRouter Multiple models (:free suffix) βœ… Yes

πŸ“š Documentation

For more detailed information, check the /docs folder:


🀝 Contributing

Contributions are welcome! Please read our Contributing Guide for details on how to submit pull requests.


πŸ“„ License

This project is licensed under the Apache License 2.0 β€” see the LICENSE file for details.


Made with ❀️ for the open-source community

⭐ Star this repo if you find it useful! ⭐

About

Scrape any web article, extract its content, and get AI-generated summaries in seconds!

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors