Telegram File Exporter is a CLI tool for exporting a list of document files from a Telegram channel. It supports listing files, downloading them, and outputting the results to a JSON file.
- Export document files from a Telegram channel.
- Optionally download the files to a specified directory.
- Output the list of files and their metadata to a JSON file.
- Supports processing a specified number of messages from a channel.
First, clone the repository:
git clone https://github.com/yourusername/telegram-file-exporter.git
cd telegram-file-exporter
pip install .
telegram-file-exporter --api-id <your_api_id> --api-hash <your_api_hash> --channel <channel_name_or_id> --mode <list|download> [options]
- --api-id: Your Telegram API ID.
- --api-hash: Your Telegram API Hash.
- --channel: The username or ID of the Telegram channel.
- --mode: The mode of operation. Use list to list files, or download to download files.
- --output: Boolean flag to output a JSON file (default: True).
- --max: Maximum number of messages to process from the channel (default: 100).
- --download-dir: Directory to download files to (default: current directory).
# List Files in a Channel
telegram-file-exporter --api-id 12345 --api-hash abcdef --channel @mychannel --mode list -m 100
# Download Files from a Channel
telegram-file-exporter --api-id 12345 --api-hash abcdef --channel @mychannel --mode download --download-dir ./downloads -m 100
See Pipfile
This project was created and is maintained by Leonid Akinin [email protected]. If you use or fork this project, please provide proper credit and a link back to the original repository.
See License