mehraneftekhari99 / tgexport

Export posts from telegram chats and channels easily

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TGExport

TGExport is a simple Python script to export and save messages from Telegram chats. It uses the Telethon library to interact with the Telegram API.

Features

  • Downloads and saves messages from specified Telegram channel
  • Uses Telegram message timestamp and id to name the files
  • Saves new messages, skipping any previously downloaded ones

Getting Started

Prerequisites

TGExport uses Poetry for dependency management. Make sure you have Poetry installed. If not, follow the instructions on the Poetry website. You also need to register a 3rd-party app in Telegram API Developer Tools to get the APP_ID and APP_HASH.

Installation

  1. Clone the repo:
    git clone https://github.com/mehraneftekhari99/tgexport.git
    
  2. Navigate to the project directory:
    cd tgexport
    
  3. Install the dependencies:
    poetry install
    

Usage

  1. Create a .env file in the project root directory with the following content, and replace the placeholders with your actual Telegram API ID and Hash:

    API_ID=<Your Telegram API ID>
    API_HASH=<Your Telegram API Hash>
    
  2. Run the script:

    poetry run python tgexport.py --help
    

Contributing

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

License

This project is released into the public domain. For more information, see the LICENSE in this repository.

About

Export posts from telegram chats and channels easily

License:The Unlicense


Languages

Language:Python 100.0%