beautifulrem/tdl-next
소개
Rust로 작성된 빠르고 재개 가능한 Telegram 다운로드·업로드·내보내기 도구입니다. 명령줄 도구와 전체 화면 TUI를 제공합니다.
개발 도구What you can do
- Parallel multi-DC transfers. Dedicated media lanes per data center, with concurrency that backs off on flood waits and recovers on its own.
- Crash-safe resume. Chunk-level progress in SQLite WAL; an interrupted download refetches only the chunks it never wrote.
- Two front ends, one engine. Inline progress and receipts in the shell, --json / --jsonl and fixed exit codes for scripts, and a six-view fullscreen TUI.
- Streaming without downloading. tdln dl --serve puts allowlisted media on 127.0.0.1 with token auth and byte-range seeking for mpv or VLC.
측정된 스타 증가
- in 24h
- +10
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original
tdl-next
Fast, resumable Telegram media transfers from your terminal.
Download, upload, forward, export, and stream with tdln, a Rust rewrite of tdl.
English · 简体中文 · Docs · Changelog · LINUX DO
A real tdln tui session, recorded against the offline mock Telegram cluster from the test suite.
Why tdl-next
iyear/tdl made Telegram downloads scriptable. tdl-next keeps its command shape and rebuilds the engine in Rust: every data center gets its own pool of media connections, progress is saved per chunk in SQLite so a killed process resumes where it stopped, and the same engine drives a scriptable CLI and a fullscreen TUI. It installs next to Go tdl without sharing a single path or variable.
Highlights
- Parallel multi-DC transfers. Dedicated media lanes per data center, with concurrency that backs off on flood waits and recovers on its own.
- Crash-safe resume. Chunk-level progress in SQLite WAL; an interrupted download refetches only the chunks it never wrote.
- Two front ends, one engine. Inline progress and receipts in the shell,
--json/--jsonland fixed exit codes for scripts, and a six-view fullscreen TUI. - Streaming without downloading.
tdln dl --serveputs allowlisted media on127.0.0.1with token auth and byte-range seeking formpvor VLC. - Filters and safe filenames. Select by extension, MIME prefix, and size, route uploads into forum topics, and name files with templates that cannot escape the target folder.
- Secrets stay out of the database. Auth keys live in the OS keychain or an
Argon2id+ChaCha20-Poly1305vault, never in SQLite.
Install
# macOS and Linux (checks SHA-256 against the release checksums; no root needed)
curl -fsSL https://raw.githubusercontent.com/beautifulrem/tdl-next/main/scripts/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/beautifulrem/tdl-next/main/scripts/install.ps1 | iex
# npm, pnpm, or bun (or run once with: npx tdl-next)
npm install -g tdl-next
Cargo
Rust 1.96 or newer. Add --no-default-features for a minimal headless build without the TUI and --serve.
cargo install --git https://github.com/beautifulrem/tdl-next.git tdl-cli --locked
Docker
docker run --rm -it \
-e TDLN_VAULT_PASSPHRASE="change-me" \
-v "$HOME/.tdl-next:/data" \
-v "$PWD/downloads:/downloads" \
ghcr.io/beautifulrem/tdl-next:latest doctor
Prebuilt archives, provenance checks, proxies, and shell completions are in docs/installation.md.
Quick start

# 1. Sign in: import Telegram Desktop, scan a QR code, or use a login code
tdln login -T desktop
tdln login -T qr
# 2. Download a message or a whole album
tdln dl -u https://t.me/telegram/458 -d ./downloads --group
# 3. Export a chat, then fetch its videos up to 500 MiB, resuming anything unfinished
tdln chat export -c @telegram -T last -i 200 -o tdln-export.json
tdln dl -f tdln-export.json -d ./downloads --mime video/ --max-size 524288000 --continue --skip-same
# 4. Stream to a local player instead of downloading first
tdln dl -u https://t.me/telegram/459 --serve --port 8080
# 5. Upload photos as albums, forward a post, or open the TUI
tdln up -p ./photos -c me --photo --group
tdln fwd --from https://t.me/telegram/458 --to me
tdln tui
Use -n <namespace> to keep several accounts apart and tdln doctor to check connectivity and storage. The Quickstart walks through each step, and the CLI reference lists every command and flag.
Fullscreen TUI
tdln tui watches transfers, browses chat media, and switches accounts without leaving the terminal. Press 1–6 to move between views, ? for every key.
![]() |
![]() |
Chats: pick a file and press d to download it |
Network: throughput, lanes, proxy, and storage health |
It follows your terminal's light or dark theme, uses the blue-to-orange brand gradient on truecolor terminals, and falls back to plain text styles under NO_COLOR. See docs/tui.md.
Performance
Loopback benchmarks on an Apple M4 with byte-exact SHA-256 checks. Methodology and raw numbers are in docs/benchmarks.md.
| Workload | tdln (Rust) |
Go tdl |
Peak RSS (tdln) |
|---|---|---|---|
| 50 × 64 KiB small-file batch | 309.5 ms | 5,057.7 ms | 13.9 MiB |
| 100 MiB multi-connection download | 89.0 ms | 247.1 ms | 120.0 MiB |
| 200 state/progress writes | 26.2 ms | 1,636.1 ms | 10.4 MiB |
| 4 GiB streaming download (8,192 chunks) | 3,056.2 ms (1.34 GiB/s) | — | 23.5 MiB |
Cold --help startup (hyperfine) |
4.6–12.0 ms | 19.7–34.6 ms | 8.9 MiB |
Coming from Go tdl
tdln leaves ~/.tdl, TDL_* variables, and _tdl completions alone; its own state lives in ~/.tdl-next under TDLN_*. Bring accounts over with tdln login -T desktop|qr|code, and move them between machines with tdln backup / tdln recover. Flag mappings and the deliberate security differences are in docs/migration.md. The original Go source is archived on the Go branch.
Documentation
| Getting started | Installation · Quickstart · Migrating from Go tdl |
| Reference | CLI · Fullscreen TUI · Filtering & templates |
| Engineering | Architecture · ADR 0001 · Security design · Benchmarks · Testing · Releasing |
All documentation is also available in 简体中文.
Contributing
Read CONTRIBUTING.md before opening a pull request. Report vulnerabilities privately as described in SECURITY.md.
Acknowledgements
tdl-next started from the ideas in iyear/tdl and is built on grammers and ratatui; see NOTICE. Licensed under AGPL-3.0-only.
Thanks to the LINUX DO community for its support.
관련 프로젝트 살펴보기
불러오는 중…

