telegram_media_downloader
_ is a Telegram download tool that supports downloading audio, documents, photos, videos, video notes, and voice messages. It can download files that are prohibited from being forwarded and saved👻. Cross-platform, supports web viewing of download progress, supports bot commands for downloading, and supports downloading resources from private groups that have been joined but are restricted for download._
Download Configuration Files#
Download the following files from the Github project repository to the installation directory of telegram_media_downloader you created,
- config.yaml
- data.yaml
https://github.com/tangyoha/telegram_media_downloader/blob/master/config.yaml
https://github.com/tangyoha/telegram_media_downloader/blob/master/data.yaml
Save to /docker/tmd
Configuration File config.yaml#
api_hash: obtained api_id #Note: space after the colon
api_id: obtained bot api #Note: space after the colon
web_host: 0.0.0.0
bot_token: get from @BotFather to create a bot #Note: space after the colon
#proxy:
#scheme: socks5
#hostname: host ipaddr
#port: port
#username: user
#password: password
file_formats:
audio:
- all
document:
- all
video:
- all
file_path_prefix:
- chat_title
- media_datetime
media_types:
- audio
- photo
- video
- document
- voice
- video_note
# in linux please use /
# save_path: E:\github\telegram_media_downloader
disable_syslog: []
save_path: /app/downloads
language: ZH
# max_download_task: 5 #default configuration is to download 5 tasks simultaneously
api_hash: obtained api_id
api_id: obtained bot api
About obtaining api_hash and api_id,
Telegram official website, enter your phone number for verification.
This is the only major pitfall I encountered; if you encounter an error during the application process, the only reason is that your IP is not clean. I tried different residential IPs in the same area as my phone number, and after using a proxy twice, I couldn't get through verification with residential IPs in the same area code as my phone number. In the end, I had to ask a friend in the U.S. to help me apply.
If you get stuck at this step, you need the hash and ID to proceed with the following operations. A small tip: carefully read the tutorials in the project; there is a tutorial that includes a set of hash and ID that can be used directly.
data.yaml file
ids_to_retry: []
After completing the above operations, perform a verification
docker run -itd --name telegram-media-downloader -v /vol1/1000/Docker/tmd/config.yaml:/app/config.yaml -v /vol1/1000/Docker/tmd/sessions:/app/sessions tangyoha/telegram_media_downloader:latest
After the container starts, follow the prompts in the container's command line panel to enter your phone number. My phone number is from the U.S., remember to include the area code.
For example: 19295188888
Then press “y” to confirm, get the verification code in the TG client and enter the verification code.
Official Deployment
We will delete the container we just created, then refer to mine to create another container, create the corresponding folders according to your actual situation, modify port mappings, and other operations. Note that /app/downloads/ should map to your download directory, and be careful to map the sessions folder, config.yaml, and data.yaml to the corresponding locations.
version: "3.3"
services:
telegram_media_downloader:
image: tangyoha/telegram_media_downloader:latest
build: .
container_name: telegram-media-downloader
ports:
- "8066:5000"
#environment:
# - http_proxy=http://192.168.101.30:10811
# - https_proxy=http://192.168.101.30:10811
volumes:
# Here is what you need to edit
- /vol1/1000/Docker/tmd/config.yaml:/app/config.yaml
- /vol1/1000/Docker/tmd/rclone:$HOME/.config/rclone/
- /vol1/1000/Docker/tmd/data.yaml:/app/data.yaml
- /vol1/1000/Docker/tmd/log:/app/log/
- /vol2/1000/Download/TMD:/app/downloads/
- /vol2/1000/Download/TMD/temp:/app/temp
- /vol1/1000/Docker/tmd/sessions:/app/sessions
restart: unless-stopped
If everything is normal after starting, the Telegram bot you created will have the following prompt:
Project address: https://github.com/tangyoha/telegram_media_downloader
For more features, you can check the project, as my use case is mainly for forwarding downloads, so I don't have many complex functional requirements.
Features:
This article is synchronized and updated to xLog by Mix Space The original link is https://taikula.cool/posts/tutorial/telegram_media_downloader