Illustration of a file downloading to a device — cover for the Download Media Bot project
Illustration of a file downloading to a device — cover for the Download Media Bot project
Project

Download Media Bot — Multi-Platform Telegram Downloader

A Telegram bot that pulls video, photo, and audio off nine social platforms — TikTok, Instagram, X, YouTube, Facebook, Threads, SoundCloud, Spotify, Pinterest. Built on Hono, grammY, and Cloudflare Workers. Paste a link, get the file.

A high-performance media downloader Telegram bot built on Hono, grammY, and Cloudflare Workers. Paste a link from a supported platform into the chat and the bot returns the media — no app, no watermark, no redirect through an ad page.

Live at @download_media_4bot .

Supported platforms

  • TikTok — videos without watermark, high-quality audio, photo slideshows
  • Instagram — reels, videos, photos, carousel posts
  • Twitter / X — HD videos and photos
  • YouTube — HD/SD video and MP3 audio extraction
  • Facebook — HD/SD video
  • Threads — videos and photos
  • SoundCloud — high-quality audio tracks
  • Spotify — audio previews and track downloads
  • Pinterest — videos and high-resolution images

What it does beyond fetching files

  • Quality picker — an inline keyboard for platforms that expose multiple renditions, so YouTube and Facebook links do not silently hand back the worst one.
  • Runs at the edge — Cloudflare's global network keeps the round trip short regardless of where the user is.
  • Analytics — download counts and per-user tracking through Cloudflare KV and Analytics Engine, surfaced to admins via /stats.
  • Bilingual — the interface detects the user's Telegram language and switches between Arabic and English.
  • Subscription gate — optional required-channel check before a download is allowed, configurable by an admin at runtime.
  • Self-configuring — webhook registration and bot setup run automatically after deploy; hitting /setup once finalizes it.

Stack

Hono for the Worker's HTTP layer, grammY for the Telegram side, Cloudflare Workers for execution, Workers KV for caching and state, and Analytics Engine for real-time metrics. Tests run on Vitest; the repo enforces conventional commits and ships CodeQL and code-quality workflows on every push.

Commands

  • /start — initialize the bot and get a welcome message
  • /help — usage instructions
  • Send a URL — that is the whole interaction; no command needed
  • /stats (admin) — download statistics and per-user usage
  • /cancel (admin) — cancel the pending download

Deploying your own

You need a Cloudflare account with Workers enabled, a bot token from @BotFather , and Node.js with pnpm.

git clone https://github.com/EngDawood/download-media.git
cd download-media
pnpm install

# set your numeric Telegram ID as ADMIN_TELEGRAM_ID in wrangler.jsonc, then:
pnpm exec wrangler secret put TELEGRAM_BOT_TOKEN
pnpm exec wrangler secret put TELEGRAM_WEBHOOK_SECRET

pnpm deploy

Then visit https://your-worker-url/setup once to register the webhook. pnpm dev runs it locally, pnpm test runs the Vitest suite.

Want something like this for your team? I usually ship a first version within two weeks.

Get in touch