# telegram_media_downloader: Download Telegram Media with Ease

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/tangyoha-telegram_media_downloader
Generated for open source discovery and AI-assisted research.

telegram_media_downloader is a powerful, cross-platform tool designed to download media files from Telegram conversations, chats, and channels. It supports various media types and offers flexible download options, including a web UI and bot commands. Users can easily manage downloads, configure filters, and even upload files to cloud drives.

GitHub: https://github.com/tangyoha/telegram_media_downloader
OSRepos URL: https://osrepos.com/repo/tangyoha-telegram_media_downloader

## Summary

telegram_media_downloader is a powerful, cross-platform tool designed to download media files from Telegram conversations, chats, and channels. It supports various media types and offers flexible download options, including a web UI and bot commands. Users can easily manage downloads, configure filters, and even upload files to cloud drives.

## Topics

- telegram-bot
- media-downloader
- cross-platform
- python
- flask
- telegram-tools
- downloader

## Repository Information

Last analyzed by OSRepos: Fri Nov 14 2025 20:01:02 GMT+0000 (Western European Standard Time)
Detail views: 4
GitHub clicks: 3

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction

telegram_media_downloader is a robust, cross-platform tool designed for efficiently downloading media files from Telegram conversations, chats, and channels. Based on Dineshkarthik's original project, it offers comprehensive support for various media types, including audio, video, documents, and photos, with individual file sizes up to 2GiB. This versatile downloader provides multiple interaction methods, including a user-friendly web interface and bot commands, making it accessible for different use cases. It also uniquely supports downloading resources from private groups that you have already joined, even if they have download restrictions.

## Installation

Getting started with telegram_media_downloader is straightforward. Follow the instructions below based on your operating system or preferred deployment method.

**For *nix OS distributions with `make` availability:**

sh
git clone https://github.com/tangyoha/telegram_media_downloader.git
cd telegram_media_downloader
make install


**For Windows (without `make` inbuilt):**

sh
git clone https://github.com/tangyoha/telegram_media_downloader.git
cd telegram_media_downloader
pip3 install -r requirements.txt


**Using Docker:**

For a more detailed installation tutorial, refer to the [official wiki](https://github.com/tangyoha/telegram_media_downloader/wiki "How to use Docker"). Ensure you have Docker and Docker Compose installed.

sh
docker pull tangyoha/telegram_media_downloader:latest
mkdir -p ~/app && mkdir -p ~/app/log/ && cd ~/app
wget https://raw.githubusercontent.com/tangyoha/telegram_media_downloader/master/docker-compose.yaml -O docker-compose.yaml
wget https://raw.githubusercontent.com/tangyoha/telegram_media_downloader/master/config.yaml -O config.yaml
wget https://raw.githubusercontent.com/tangyoha/telegram_media_downloader/master/data.yaml -O data.yaml
# Edit config.yaml and docker-compose.yaml as needed
vi config.yaml

# First time setup: run in foreground to enter phone number and code
docker-compose run --rm telegram_media_downloader

# Subsequent startups can be in the background
docker-compose up -d


**Upgrading:**

sh
cd telegram_media_downloader
pip3 install -r requirements.txt


## Examples and Usage

telegram_media_downloader offers flexible ways to interact with it, whether through a web interface, bot commands, or direct execution.

### Web Interface:

Once the application is running, you can access its web UI by opening a browser and navigating to `localhost:5000`. If running on a remote machine, ensure `web_host: 0.0.0.0` is configured. The web interface provides a visual way to monitor download progress and manage settings.

### Bot Commands:

For bot-driven downloads, you need to configure `bot_token` in your `config.yaml`. Refer to the [documentation on how to download using robots](https://github.com/tangyoha/telegram_media_downloader/wiki/How-to-Download-Using-Robots "How to Download Using Robots") for detailed instructions. You can then issue `download` or `forward` commands via the bot.

### Configuration (`config.yaml`):

The core of the downloader's behavior is controlled by the `config.yaml` file. Key parameters include:

*   `api_hash` and `api_id`: Obtained from [my.telegram.org/apps](https://my.telegram.org/apps "Telegram API Apps").
*   `chat`: A list of chat IDs to monitor, with options for `last_read_message_id` and `download_filter` (e.g., `message_date >= 2022-12-01 00:00:00`).
*   `media_types`: Specify which media types to download (e.g., `audio`, `video`, `document`).
*   `save_path`: The root directory for downloaded files.
*   `upload_drive`: Configuration for uploading files to cloud drives like Rclone or Aligo, including options for zipping and deleting after upload.
*   `proxy`: Support for `socks4`, `socks5`, and `http` proxies.

Here's a snippet of a typical `config.yaml`:

yaml
api_hash: your_api_hash
api_id: your_api_id
chat:
- chat_id: telegram_chat_id
  last_read_message_id: 0
  download_filter: message_date >= 2022-12-01 00:00:00 and message_date <= 2023-01-17 00:00:00
media_types:
- audio
- document
- photo
- video
save_path: D:\telegram_media_downloader
upload_drive:
  enable_upload_file: true
  remote_dir: drive:/telegram
  upload_adapter: rclone
  rclone_path: D:\rclone\rclone.exe
proxy:
  scheme: socks5
  hostname: 127.0.0.1
  port: 1234


### Execution:

After configuring, simply run the script:

sh
python3 media_downloader.py


Downloaded media will be organized within your `save_path` according to your `file_path_prefix` settings, which can include `chat_title`, `media_datetime`, and `media_type`.

## Why Use telegram_media_downloader?

This tool stands out for several reasons:

*   **Comprehensive Media Support:** Downloads a wide range of media types, including audio, video, documents, photos, and voice messages.
*   **Flexible Download Control:** Utilize powerful filters based on message date to download specific content.
*   **Multiple Interaction Methods:** Choose between a convenient web UI, automated bot commands, or direct script execution.
*   **Cloud Integration:** Seamlessly upload downloaded files to various cloud storage providers via Rclone or Aligo, with options for zipping and post-upload deletion.
*   **Cross-Platform Compatibility:** Works across different operating systems, including *nix and Windows, with Docker support for easy deployment.
*   **Customizable File Organization:** Define how your downloaded files are structured and named using flexible prefix options.
*   **Private Group Support:** Download content from private groups you've joined, even if standard download options are restricted.

## Links

*   **GitHub Repository:** [https://github.com/tangyoha/telegram_media_downloader](https://github.com/tangyoha/telegram_media_downloader "GitHub Repository")
*   **Feature Request:** [https://github.com/tangyoha/telegram_media_downloader/discussions/categories/ideas](https://github.com/tangyoha/telegram_media_downloader/discussions/categories/ideas "Feature Request")
*   **Report a Bug:** [https://github.com/tangyoha/telegram_media_downloader/issues](https://github.com/tangyoha/telegram_media_downloader/issues "Report a Bug")
*   **Telegram Community:** [https://t.me/TeegramMediaDownload](https://t.me/TeegramMediaDownload "Telegram Community")
*   **Contributing Guidelines:** [https://github.com/tangyoha/telegram_media_downloader/blob/master/CONTRIBUTING.md](https://github.com/tangyoha/telegram_media_downloader/blob/master/CONTRIBUTING.md "Contributing Guidelines")
*   **Code of Conduct:** [https://github.com/tangyoha/telegram_media_downloader/blob/master/CODE_OF_CONDUCT.md](https://github.com/tangyoha/telegram_media_downloader/blob/master/CODE_OF_CONDUCT.md "Code of Conduct")
*   **Sponsor (PayPal):** [https://paypal.me/tangyoha?country.x=C2&locale.x=zh_XC](https://paypal.me/tangyoha?country.x=C2&locale.x=zh_XC "Sponsor via PayPal")