Back to Projects

Project case study / 2026

Dupload

Live

A Telegram video downloader and media-processing bot built with Node.js, Telegraf, yt-dlp, and FFmpeg, with queued jobs, cancellation, media validation, compression, and resilient Telegram delivery.

Node.jsTelegrafyt-dlpFFmpeg
Dupload cover

Overview

Dupload is a Telegram-based video downloader and media-processing bot designed to make downloading, converting, clipping, and delivering online media simple from a chat interface.

Users can send a supported media URL directly to Telegram and Dupload handles the download, processing, validation, compression, and delivery automatically.

The bot is built with Node.js, Telegraf, yt-dlp, and FFmpeg and runs as a production Telegram service with a local Telegram Bot API server for reliable handling of large media files.

The Problem

Downloading online media can become unnecessarily complicated when users need to:

  • Find a downloader that supports a particular platform
  • Choose the correct media format
  • Extract audio
  • Download only a specific section of a video
  • Handle large files
  • Recover from invalid media
  • Cancel long-running downloads
  • Manage multiple downloads
  • Deal with Telegram file-size limitations

Dupload was built to put these operations behind a simple Telegram interface.

The Solution

Dupload turns Telegram into the entire media-processing interface.

Users can paste a URL for a normal download, request audio extraction, inspect media information, extract a specific video section, monitor queued work, or cancel a running job.

Behind the interface, Dupload manages the complete pipeline:

  1. Receive the Telegram request
  2. Validate the request and enforce rate limits
  3. Create or queue the download job
  4. Retrieve the media using yt-dlp
  5. Process the media with FFmpeg when required
  6. Validate the resulting file
  7. Compress oversized media when possible
  8. Deliver the final file through Telegram
  9. Record the result in the analytics system
  10. Clean up temporary files

Architecture

Dupload is built around several cooperating components:

  • Telegraf — Telegram bot framework
  • yt-dlp — media extraction and downloading
  • FFmpeg — media conversion, compression, and video clipping
  • ffprobe — media metadata and duration inspection
  • Node.js — application runtime and job orchestration
  • Telegram Bot API — user interaction and media delivery
  • Local Telegram Bot API server — handling large media transfers
  • JSON analytics storage — persistent download lifecycle statistics
  • PM2 — production process management

Download Pipeline

When a user sends a supported URL, Dupload creates a download job and processes it through the queue.

The downloader uses yt-dlp to retrieve appropriate media while respecting configured file-size limits.

After downloading, the file passes through validation and processing before being delivered to Telegram.

Temporary files are removed after processing to prevent completed and failed jobs from continuously consuming disk space.

Video Clips

Dupload can extract a specific section of a video without requiring the user to manually download and edit the complete video.

Users can request clips directly from Telegram:

  • "/clip 00:30 01:15 https://youtu.be/xxx"
  • "clip 30 75 https://youtu.be/xxx"
  • "/clip 01:30:00 01:45:30 https://youtu.be/xxx"

The timestamp parser supports seconds, "MM:SS", and "HH:MM:SS".

Before processing, Dupload uses ffprobe to inspect the source duration and validates the requested start and end positions.

FFmpeg then extracts the requested section using H.264 video and AAC audio.

The resulting clip goes through the same validation, compression, cancellation, cleanup, and Telegram delivery pipeline as normal downloads.

Audio-only clip requests are explicitly rejected because the current clip pipeline is designed for video output.

Audio Extraction

Users can request audio-only downloads without manually converting the resulting media.

Dupload detects audio requests and uses the media-processing pipeline to produce an appropriate audio output before sending it back through Telegram.

Media Information

The "/info" command allows users to inspect media before downloading it.

This helps users understand the source before committing to a potentially large download.

Queue Management

Related Projects