Skip to content

Latest commit

 

History

99 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Channel and RSS Parser Bot

A sophisticated Python-based bot that parses Telegram channels and RSS feeds, processes the content, and reposts it to specified channels with image processing capabilities.

Features

  • Multi-Source Parsing

    • Telegram Channel Parsing
    • RSS Feed Parsing
    • Supports multiple channels and feeds simultaneously
  • Content Processing

    • Text content filtering with keywords
    • Bad words filtering
    • Image processing and storage
    • Link handling and formatting
  • Flexible Posting

    • Customizable posting schedule
    • Multiple target channels support
    • Markdown formatting support
    • Media group handling
  • Administrative Interface

    • Channel management
    • Source management
    • Keyword management
    • Settings management

System Architecture

The project consists of several main components:

1. Bot Core (telegram_bot/)

  • main.py - Main bot initialization and routing
  • Handlers for different functionalities:
    • Channel management
    • Source management
    • Settings management
    • Keyword management

2. Parsers (parser/ and web_parser/)

  • Telegram channel parser
  • RSS feed parser
  • Content extraction and processing

3. Data Management (data/)

  • MongoDB integration
  • MinIO for file storage
  • Configuration management
  • Channel and source management

4. Logging System (logs/)

  • Comprehensive logging
  • Error tracking
  • Activity monitoring

Prerequisites

  • Python 3.12+
  • MongoDB
  • MinIO
  • Docker (optional)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/python-bot-parser.git
cd python-bot-parser
  1. Create and activate virtual environment:
python -m venv bot/bot-venv
source bot/bot-venv/bin/activate  # Linux/Mac
# or
bot\bot-venv\Scripts\activate  # Windows
  1. Install dependencies:
cd bot
pip install -r requirements.txt
  1. Configure environment variables:

Create a .env file in the bot directory with:

BOT_TOKEN=your_telegram_bot_token
API_ID=your_telegram_api_id
API_HASH=your_telegram_api_hash
ADMIN_CHAT_ID=your_admin_chat_id

Configuration

Database Configuration

The bot uses MongoDB for data storage. Configure your MongoDB connection in data/base_connection_db.py.

Storage Configuration

MinIO is used for file storage. Configure MinIO settings in data/minio_function.py.

Interface Screenshots

Admin Panel

Image

  • Channel management interface
  • Source management interface
  • Settings configuration panel

Parser Configuration

Image
  • Parser settings
  • Filter configuration
  • Schedule management

Usage

Starting the Bot

  1. Using Python directly:
cd bot
python telegram_bot/main.py
  1. Using Docker:
docker-compose up -d

Admin Commands

  • /start - Initialize bot
  • Settings management through inline buttons
  • Channel management through menu interface
  • Source configuration through dedicated panels

Features in Detail

Parser Functionality

  • Configurable parsing intervals
  • Content filtering based on keywords
  • Bad word filtering
  • Image processing and optimization
  • Link extraction and formatting

Posting Features

  • Scheduled posting
  • Multiple channel support
  • Media group handling
  • Markdown formatting
  • Custom templates

Administrative Features

  • Channel management
    • Add/remove channels
    • Configure parsing settings
    • Set posting rules
  • Source management
    • Add/remove sources
    • Configure parsing rules
    • Set update intervals
  • Keyword management
    • Add/remove keywords
    • Configure filters
    • Set up bad word lists
  • Settings management
    • Configure global settings
    • Set up parsing intervals
    • Manage bot behavior

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages