tdl Documentation

website·Indexed 32 days ago

https://docs.iyear.me/tdl

Documentation for tdl, a Telegram Downloader and utility tool. It provides a CLI for downloading content from protected chats, exporting messages, forwarding messages with automatic routing, and managing extensions. The tool includes a template system based on Go text/template and an expression engine powered by expr.

Tokens
23.5K
Snippets
169
Records
209
Agent score
56%

What's inside tdl

  1. Overview of tdl Telegram Downloader

    tdl is a high-performance Telegram downloader and utility tool. It is designed for low resource usage and high bandwidth utilization, often exceeding the speed of official Telegram clients. Key capabilities include:

    • Downloading files from protected chats.
    • Forwarding messages with automatic fallback and routing.
    • Uploading files to Telegram.
    • Exporting messages, members, and subscribers to JSON format.
  2. Overview of tdl extensions

    tdl extensions are independent tools that integrate seamlessly with the tdl core, allowing users to add functionality without modifying the core code. Extensions are stored in ~/.tdl/extensions and are managed via the tdl extension subcommand. Note: This feature is currently experimental and the CLI may change in future versions.
  3. Overview of tdl Telegram Downloader

    tdl is a high-performance Telegram downloader and utility tool designed for efficiency and speed. It operates as a single-binary application with low resource consumption and is capable of saturating available network bandwidth, often exceeding the speeds of official Telegram clients.
  4. Overview of tdl extensions

    tdl extensions are experimental add-on tools that extend the core feature set of tdl without modifying the core binary. They integrate directly into the tdl CLI and are stored in the ~/.tdl/extensions directory.
  5. Use tdl chat command group

    The tdl chat command provides a suite of tools for managing and exporting data from Telegram chats. It serves as a parent command for more specific actions such as listing chats (ls), exporting messages (export), and exporting channel users (users).
  6. Available tdl subcommands

    The tdl tool includes several subcommands for managing Telegram data and sessions:

    • login: Authenticate with Telegram.
    • download: Download content from (including protected) chats.
    • upload: Upload files to Telegram.
    • forward: Forward messages with routing and fallback.
    • chat: Access a set of chat-related tools.
    • backup: Backup session data.
    • recover: Recover session data.
    • migrate: Move data to a different storage driver.
    • extension: Manage tdl extensions.
    • completion: Generate shell autocompletion scripts.
    • version: Check the current version of tdl.
  7. Understand tdl global configuration behavior

    Global configurations in tdl are options that can be set for any command. Crucially, these configurations are NOT persistent; they only take effect for the current command execution. You must include the desired global flags every time you run a tdl command.
  8. Understand the TDL expression engine

    TDL uses the expr library as its expression engine. It is designed to be a simple, lightweight, and powerful engine for evaluating expressions. For detailed information on the language definition, syntax, and capabilities, refer to the official expression engine documentation.
    Expression engine documentation: https://expr.medv.io/docs/Language-Definition
  9. Use global configuration flags in tdl

    Global configuration flags in tdl are CLI options that can be applied to every command. Note that these settings are not persisted; they only take effect for the current command execution and must be specified every time they are needed.
  10. Develop tdl extensions

    To create, build, and publish extensions for tdl, refer to the official tdl-extension-template repository.
    https://github.com/iyear/tdl-extension-template
  11. Filter exported messages using expressions

    Use the -f flag to apply filters to the exported messages. You can list all available filter fields by passing a hyphen - to the -f flag. Filters support logical operators and property checks (e.g., Views, Media.Size, Media.Name).
    # List all available filter fields
    tdl chat export -c CHAT -f -
    
    # Export last 10 media files where size > 5MiB and views > 200 and filename ends with .zip
    tdl chat export -c CHAT -T last -i 10 -f "Views>200 && Media.Name endsWith '.zip' && Media.Size > 5*1024*1024"