5.6 KiB
Intro
📥 Telegram Downloader, but more than a downloader 🚀
⚠ Note: Command compatibility is not guaranteed in the early stages of development
⚠ Warning: some accounts have been blocked, so please use carefully. Go to ISSUE for discussion
Features
- Single file start-up
- Low resource usage
- Take up all your bandwidth
- Faster than official clients
- Download files from (protected) chats
- Upload files to Telegram
Preview
It reaches my proxy's speed limit, and the speed depends on whether you are a premium
Install
Go to GitHub Releases to download the latest version
Usage
Get help
tdl -h
Check the version
tdl version
Basic Configs
The following command documents will not write basic configs. Please add the basic configs you need.
You should set the namespace when each command is executed:
tdl -n iyear
# or
export TDL_NS=iyear # recommended
(optional) Set the proxy. Only support socks now:
tdl --proxy socks5://localhost:1080
# or
export TDL_PROXY=socks5://localhost:1080 # recommended
(optional) Set ntp server host. If is empty, use system time:
tdl --ntp pool.ntp.org
# or
export TDL_NTP=pool.ntp.org # recommended
Login
When you first use tdl, you need to login to get a Telegram session
Login to Telegram with phone & code:
tdl login
If you have official desktop clients locally, you can import existing sessions.
This may reduce the risk of blocking, but is unproven:
tdl login -n iyeardesktop -d /path/to/Telegram
Download
Please do not arbitrarily set too large
threads
andsize
.The default value of options is consistent with official clients to reduce the risk of blocking.
For details: https://github.com/iyear/tdl/issues/30
Advanced Options:
Flag | Default | Desc |
---|---|---|
-t/--threads |
4 | threads for transfer one item |
-s/--size |
128*1024 Bytes | part size for transfer, max is 512KiB |
-l/--limit |
2 | max number of concurrent tasks |
Download (protected) chat files from message urls:
tdl dl -u https://t.me/tdl/1 -u https://t.me/tdl/2
Download (protected) chat files from official desktop client exported JSON:
tdl dl -f result1.json -f result2.json
You can combine sources:
tdl dl -u https://t.me/tdl/1 -u https://t.me/tdl/2 -f result1.json -f result2.json
Download with 8 threads, 256KiB part size, 4 concurrent tasks:
tdl dl -u https://t.me/tdl/1 -t 8 -s 262144 -l 4
Full examples:
tdl dl --debug --ntp pool.ntp.org -n iyear --proxy socks5://localhost:1080 -u https://t.me/tdl/1 -u https://t.me/tdl/2 -f result1.json -f result2.json -t 8 -s 262144 -l 4
Upload
Same instructions and advanced options as Download
Upload files to Saved Messages
, exclude the specified file extensions:
tdl up -p /path/to/file -p /path/to/dir -e .so -e .tmp
Upload with 8 threads, 256KiB part size, 4 concurrent tasks:
tdl up -p /path/to/file -t 8 -s 262144 -l 4
Full examples:
tdl up --debug --ntp pool.ntp.org -n iyear --proxy socks5://localhost:1080 -p /path/to/file -p /path/to/dir -e .so -e .tmp -t 8 -s 262144 -l 4
Backup
Backup or recover your data
Backup (Default: tdl-backup-<time>.zip
):
tdl backup
# or specify the backup file path
tdl backup -d /path/to/backup.zip
Recover:
tdl recover -f /path/to/backup.zip
Chat Utilities
Some useful utils
List all your chats:
tdl chat ls
Env
Avoid typing the same flag values repeatedly every time by setting environment variables.
Note: The values of all environment variables have a lower priority than flags.
What flags mean: flags
NAME | FLAG |
---|---|
TDL_NS | -n/--ns |
TDL_PROXY | --proxy |
TDL_DEBUG | --debug |
TDL_SIZE | -s/--size |
TDL_THREADS | -t/--threads |
TDL_LIMIT | -l/--limit |
TDL_NTP | --ntp |
Data
Your account information will be stored in the ~/.tdl
directory.
Commands
Go to docs for full command docs.
Contribute
- Better command input
- Better interaction
- Better mode support
- ......
Please provide better suggestions or feedback for the project in the form of SUBMIT ISSUE
FAQ
Q: Is this a form of abuse?
A: No. The download and upload speed is limited by the server side. Since the speed of official clients usually does not reach the account limit, this tool was developed to download files at the highest possible speed.
Q: Will this result in a ban?
A: I am not sure. All operations do not involve dangerous actions such as actively sending messages to other people. But it's safer to use an unused account for download and upload operations.
LICENSE
AGPL-3.0 License