Skip to content

LinuxCTRL/Telegram-Archiver

Repository files navigation

πŸš€ Telegram Archive Browser

A modern, elegant web-based Telegram channel archiver with real-time monitoring, smart file handling, and beautiful dark theme UI

Python Flask Tailwind CSS License

✨ Features

🎨 Modern Web Interface

  • Dark/Light Theme Toggle - Professional dark mode with smooth transitions
  • Glass Morphism Design - Beautiful translucent cards with backdrop blur effects
  • Custom OperatorMono Font - Elegant monospace typography throughout
  • Responsive Design - Perfect on desktop, tablet, and mobile devices
  • Real-time Updates - Live progress monitoring and status indicators

πŸ“± Channel Management

  • Web-based Configuration - No more manual config.json editing
  • Add/Edit/Delete Channels - Full CRUD operations with beautiful modals
  • Smart URL Validation - Supports https://t.me/channel and @channel formats
  • Auto-name Generation - Automatically suggests friendly names from URLs
  • Enable/Disable Channels - Toggle archiving without deleting configuration
  • Bulk Operations - Manage multiple channels efficiently

πŸ”„ Frontend Archiving Control

  • Start/Stop Archiving - Full control from the web interface
  • Real-time Progress Tracking - Live progress bars and channel status
  • Smart File Handling - Configurable file size limits (skip large files)
  • Live Logs Terminal - Real-time archiving logs with terminal styling
  • Process Monitoring - Track current channel, processed count, and timing

πŸ“Š Advanced Dashboard

  • Statistics Cards - Animated counters for channels, messages, files, and media
  • Archive Overview - Visual representation of your archive collection
  • Channel Status - Live indicators for archiving activity
  • Quick Actions - Fast access to search, refresh, and system info

πŸ” Powerful Search

  • Full-text Search - Find content across all archived channels
  • Channel Filtering - Search within specific channels
  • Highlighted Results - Search terms highlighted in results
  • Advanced Filters - Date ranges, media types, and more
  • Export Results - Save search results for later analysis

πŸ“ Smart File Management

  • Markdown + JSON Format - Human-readable archives with metadata
  • Media Organization - Automatic media file organization and linking
  • Image Previews - Click images for full-size modal previews
  • File Type Detection - Smart icons and handling for different media types
  • Size Optimization - Configurable file size limits to prevent long downloads

πŸ›‘οΈ Security & Performance

  • Secure Configuration - API credentials safely stored
  • Error Handling - Graceful failure recovery and user feedback
  • Performance Optimized - Efficient CSS, lazy loading, and smart caching
  • Cross-platform - Works on Windows, macOS, and Linux

πŸ“Έ Screenshots

🎨 Modern Dashboard with Dark Theme

Dashboard Screenshot Beautiful dark theme dashboard with real-time statistics, channel management, and archiving controls

πŸ” Advanced Search Interface

Search Screenshot Powerful search functionality with highlighted results and channel filtering

πŸš€ Quick Start

Prerequisites

  • Python 3.8 or higher
  • Telegram API credentials (api_id and api_hash)

Installation

  1. Clone the repository

    git clone https://github.com/LinuxCTRL/Telegram-Archiver.git
    cd Telegram-Archiver
  2. Create and activate virtual environment

    # Create virtual environment
    python -m venv venv
    
    # Activate virtual environment
    # On Windows:
    venv\Scripts\activate
    
    # On macOS/Linux:
    source venv/bin/activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure API credentials

    python test_setup.py

    Follow the prompts to enter your Telegram API credentials.

  5. Start the web interface

    python web_frontend.py
  6. Open your browser Navigate to http://localhost:5000 and enjoy your modern archive browser!

πŸ“– Usage Guide

πŸŽ›οΈ Channel Management

Adding Channels

  1. Click the "Add Channel" button in the Channel Management section
  2. Enter the Telegram channel URL (https://t.me/channelname) or username (@channelname)
  3. The display name will be auto-generated, or you can customize it
  4. Choose whether to enable archiving immediately
  5. Click "Add Channel" to save

Managing Existing Channels

  • Edit: Click the edit button to modify channel details
  • Enable/Disable: Toggle archiving without deleting the channel
  • Delete: Remove channels with confirmation (archived files remain)

πŸ”„ Archiving Control

Starting Archiving

  1. Configure Max File Size (default: 50MB)
  2. Choose File Handling: Skip or Download large files
  3. Click "Start Archiving" to begin
  4. Monitor progress in real-time with live logs

Monitoring Progress

  • Progress Bar: Visual completion percentage
  • Current Channel: See which channel is being processed
  • Live Logs: Terminal-style output with timestamps
  • Statistics: Processed vs. total channels

πŸ” Searching Archives

Basic Search

  1. Use the search bar in the navigation or go to the Search page
  2. Enter keywords to find across all channels
  3. Optionally filter by specific channel
  4. View highlighted results with context

Advanced Features

  • Case-insensitive: Search works regardless of capitalization
  • Multi-word: Search for phrases or multiple keywords
  • Media filtering: Find messages with specific media types
  • Export results: Save search results for analysis

🎨 Customization

Theme Switching

  • Click the theme toggle button in the navigation
  • Supports both light and dark modes
  • Preference saved automatically

Font Customization

  • Custom OperatorMono font included
  • Fallback to system monospace fonts
  • Optimized for readability and code display

πŸ“ Project Structure

telegram-archive-browser/
β”œβ”€β”€ πŸ“„ web_frontend.py          # Main Flask application
β”œβ”€β”€ πŸ“„ telegram_archiver.py     # Core archiving functionality
β”œβ”€β”€ πŸ“„ monitor_control.py       # Process monitoring and control
β”œβ”€β”€ πŸ“„ run_archiver.py          # Archiving script runner
β”œβ”€β”€ πŸ“„ config.json              # Configuration file
β”œβ”€β”€ πŸ“ templates/               # HTML templates
β”‚   β”œβ”€β”€ πŸ“„ base.html            # Base template with navigation
β”‚   β”œβ”€β”€ πŸ“„ index.html           # Dashboard and channel management
β”‚   β”œβ”€β”€ πŸ“„ search.html          # Search interface
β”‚   β”œβ”€β”€ πŸ“„ channel.html         # Channel file listings
β”‚   └── πŸ“„ view.html            # File viewer with media support
β”œβ”€β”€ πŸ“ static/                  # Static assets
β”‚   β”œβ”€β”€ πŸ“ css/
β”‚   β”‚   └── πŸ“„ style.css        # Custom Tailwind CSS styles
β”‚   β”œβ”€β”€ πŸ“ fonts/
β”‚   β”‚   └── πŸ“„ OperatorMonoLig-Book.otf  # Custom font
β”‚   └── πŸ“ js/
β”‚       └── πŸ“„ app.js           # Frontend JavaScript
└── πŸ“ archived_channels/       # Archived content storage
    └── πŸ“ [Channel Name]/
        β”œβ”€β”€ πŸ“„ [Channel]_[Date].md     # Markdown archives
        β”œβ”€β”€ πŸ“„ [Channel]_[Date]_metadata.json  # Metadata
        └── πŸ“ media/               # Downloaded media files

βš™οΈ Configuration

API Credentials

{
  "api_credentials": {
    "api_id": "your_api_id",
    "api_hash": "your_api_hash",
    "session_name": "telegram_archiver"
  }
}

Channel Configuration

{
  "channels": [
    {
      "identifier": "https://t.me/channelname",
      "name": "Display Name",
      "enabled": true
    }
  ]
}

Archive Settings

{
  "archive_settings": {
    "messages_per_channel": 100,
    "days_back": 7,
    "output_directory": "archived_channels",
    "download_media": true
  }
}

πŸ”§ Advanced Features

Smart File Handling

  • Size Limits: Configure maximum file size for downloads
  • Skip Large Files: Automatically skip files exceeding limits
  • Media Organization: Automatic folder structure for media files
  • Format Support: Images, videos, documents, and audio files

Real-time Monitoring

  • Live Progress: Real-time updates during archiving
  • Process Control: Start/stop archiving from the web interface
  • Error Handling: Graceful recovery from network issues
  • Logging: Comprehensive logs with timestamps

Performance Optimization

  • Lazy Loading: Efficient loading of large archive lists
  • Caching: Smart caching for faster page loads
  • Compression: Optimized assets and images
  • Responsive: Adaptive layouts for all screen sizes

🎨 UI/UX Features

Design System

  • Glass Morphism: Modern translucent design elements
  • Gradient Accents: Beautiful color transitions
  • Micro-interactions: Smooth hover effects and animations
  • Typography: Custom OperatorMono font for elegance

Accessibility

  • Keyboard Navigation: Full keyboard support
  • Screen Reader: Proper ARIA labels and semantic HTML
  • Color Contrast: WCAG compliant color schemes
  • Focus Management: Clear focus indicators

Mobile Experience

  • Touch Friendly: Large touch targets and gestures
  • Responsive Grid: Adaptive layouts for all devices
  • Mobile Navigation: Collapsible menu for small screens
  • Performance: Optimized for mobile networks

πŸ› οΈ Development

Local Development

# Install development dependencies
pip install -r requirements.txt

# Run in development mode
python web_frontend.py

# Access at http://localhost:5000

Customization

  • Themes: Modify CSS variables for custom colors
  • Fonts: Replace OperatorMono with your preferred font
  • Layout: Adjust Tailwind classes for different layouts
  • Features: Extend API endpoints for additional functionality

πŸ“Š API Reference

Channel Management

  • GET /api/channels - Get all channels
  • POST /api/channels - Add new channel
  • PUT /api/channels/{index} - Update channel
  • DELETE /api/channels/{index} - Delete channel

Archiving Control

  • POST /api/archiving/start - Start archiving process
  • POST /api/archiving/stop - Stop archiving process
  • GET /api/archiving/status - Get archiving status

Settings

  • GET /api/settings - Get archive settings
  • POST /api/settings - Update archive settings

πŸ”’ Security

Best Practices

  • API Credentials: Stored securely in config.json
  • Input Validation: All user inputs validated and sanitized
  • CSRF Protection: Forms protected against cross-site requests
  • Error Handling: Sensitive information not exposed in errors

Privacy

  • Local Storage: All data stored locally on your machine
  • No Tracking: No analytics or tracking scripts
  • Secure Sessions: Telegram sessions handled securely
  • Data Control: Full control over your archived data

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Telethon - Telegram client library
  • Flask - Web framework
  • Tailwind CSS - Utility-first CSS framework
  • OperatorMono - Beautiful monospace font
  • Heroicons - Beautiful SVG icons

πŸ“ž Support


Built with ❀️ for secure and elegant Telegram archiving

⭐ Star this repo | πŸ› Report Bug | πŸ’‘ Request Feature

About

A Python tool for archiving Telegram channel messages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •