Installation

Installation #

One-Line Scripts #

tdl will be installed to $Env:SystemDrive\tdl(will be added to PATH), and script also can be used to upgrade tdl .

Install latest version #

iwr -useb https://docs.iyear.me/tdl/install.ps1 | iex

Install with ghproxy.com #

$Script=iwr -useb https://docs.iyear.me/tdl/install.ps1;
$Block=[ScriptBlock]::Create($Script); Invoke-Command -ScriptBlock $Block -ArgumentList "", "$True"

Install specific version #

$Env:TDLVersion = "VERSION"
$Script=iwr -useb https://docs.iyear.me/tdl/install.ps1;
$Block=[ScriptBlock]::Create($Script); Invoke-Command -ScriptBlock $Block -ArgumentList "$Env:TDLVersion"

tdl will be installed to /usr/local/bin/tdl, and script also can be used to upgrade tdl.

Install latest version #

curl -sSL https://docs.iyear.me/tdl/install.sh | sudo bash

Install with ghproxy.com #

curl -sSL https://docs.iyear.me/tdl/install.sh | sudo bash -s -- --proxy

Install specific version #

curl -sSL https://docs.iyear.me/tdl/install.sh | sudo bash -s -- --version VERSION

Package Managers #

brew install telegram-downloader
scoop bucket add extras
scoop install telegram-downloader
pkg install tdl
yay -S tdl

nix-env #

nix-env -iA nixos.tdl

NixOS-Configuration #

environment.systemPackages = [
    pkgs.tdl
];

nix-shell #

nix-shell -p tdl

Packaging status

Docker #

Available images:

Available tags:

  • latest(default): The latest stable release
  • X.Y.Z: A specific version of tdl

To run tdl in one-off command:

docker run --rm -it iyear/tdl <ARGUMENTS>

Further, to keep config persistent, you can mount the config directory:

docker run --rm -it \
-v $HOME/.tdl:/root/.tdl \
iyear/tdl <ARGUMENTS>

To get download files, you can mount the download and other directories as needed:

docker run --rm -it \
-v $HOME/.tdl:/root/.tdl \
-v $HOME/Downloads:/downloads \
iyear/tdl <ARGUMENTS>

To run tdl inside the container shell:

docker run --rm -it <FLAGS> --entrypoint sh iyear/tdl
Preview output
/ # tdl version
Version: 0.17.7
Commit: ace2402
Date: 2024-11-01T14:40:56+08:00

go1.21.13 linux/amd64
/ #

To use proxy with localhost address, run it with host network:

docker run --rm -it <FLAGS> --network host iyear/tdl <ARGUMENTS>

Run tdl with Docker Compose to avoid typing docker run flags each time.

docker-compose.yml
Example configuration uses Docker Compose v2 syntax.
services:
  tdl:
    image: iyear/tdl # or specify X.Y.Z tag for a specific version
    volumes:
      - $HOME/.tdl:/root/.tdl # keep config persistent
      - $HOME/Downloads:/downloads # optional
      # - /path/to/your/need:/path/in/container
    stdin_open: true
    tty: true
    # use host network if you need to use proxy with localhost address
    network_mode: host

Run tdl with Docker Compose:

docker compose run --rm tdl <ARGUMENTS>

To run tdl inside the container shell:

docker compose run --rm --entrypoint sh tdl
Preview output
/ # tdl version
Version: 0.17.7
Commit: ace2402
Date: 2024-11-01T14:40:56+08:00

go1.21.13 linux/amd64
/ #

Prebuilt Binaries #

  1. Download the archive for the desired operating system, and architecture:
  1. Extract the archive
  2. Move the executable to the desired directory
  3. Add this directory to the PATH environment variable
  4. Verify that you have execute permission on the file

Source #

To build the extended edition of tdl from source you must:

  1. Install Git
  2. Install Go version 1.21 or later
  3. Update your PATH environment variable as described in the Go documentation
The installation directory is controlled by the GOPATH and GOBIN environment variables. If GOBIN is set, binaries are installed to that directory. If GOPATH is set, binaries are installed to the bin subdirectory of the first directory in the GOPATH list. Otherwise, binaries are installed to the bin subdirectory of the default GOPATH ($HOME/go or %USERPROFILE%\go).

Then build:

go install github.com/iyear/tdl@latest
tdl version