A Telegram bot to generate direct download links for your Telegram files.
Report a Bug
|
Request Feature
Table of Contents
Send any Telegram file to this bot and get an instant direct download link — no waiting for the full file to download first.
- ✅ Direct download links with original filename
- ✅ File size displayed in reply
- ✅ Links expire in 24 hours
- ✅ Multi-client support to avoid flood limits
- ✅ Supports documents, videos, audio, photos, stickers, and more
git clone https://github.com/GouthamSER/TG-FileStreamBot
cd TG-FileStreamBot
python3 -m venv ./venv
. ./venv/bin/activate
pip3 install -r requirements.txt
python3 -m WebStreamerTo stop: CTRL+C
Run 24/7 on VPS using tmux:
sudo apt install tmux -y tmux python3 -m WebStreamerDetach with CTRL+B then D. Bot keeps running after you close SSH.
git clone https://github.com/GouthamSER/TG-FileStreamBot
cd TG-FileStreamBot
docker build . -t fsbCreate your .env file, then run:
docker run -d --restart unless-stopped --name fsb \
-v /PATH/TO/.env:/app/.env \
-p 8080:8080 \
fsb
PORTin.envmust match the exposed port. Example:PORT=9000→-p 9000:9000
Restart after .env changes:
docker restart fsbsudo apt install docker-compose -y
git clone https://github.com/GouthamSER/TG-FileStreamBot
cd TG-FileStreamBotEdit variables in docker-compose.yml, then:
sudo docker compose up -d- Fork this repo
- Set all env vars in the platform dashboard
- Set
Procfile→web: python3 -m WebStreamer - Set
.python-version→3.10 - Deploy
Create a .env file in the root directory (for local/VPS):
API_ID=452525
API_HASH=esx576f8738x883f3sfzx83
BOT_TOKEN=55838383:yourbottokenhere
BIN_CHANNEL=-1001234567890
PORT=8080
FQDN=yourdomain.com
HAS_SSL=True| Variable | Description |
|---|---|
API_ID |
Telegram API ID from my.telegram.org |
API_HASH |
Telegram API Hash from my.telegram.org |
BOT_TOKEN |
Bot token from @BotFather |
BIN_CHANNEL |
Channel ID where the bot forwards and stores files. Create a channel, forward any message to @missrose_bot and reply /id to get the ID |
| Variable | Default | Description |
|---|---|---|
ALLOWED_USERS |
(empty) | Comma-separated Telegram user IDs/usernames allowed to use the bot. Leave empty for public access |
HASH_LENGTH |
6 |
Length of the hash in generated URLs. Must be between 6 and 63 |
SLEEP_THRESHOLD |
60 |
Seconds to sleep on flood wait before retrying |
WORKERS |
6 |
Max concurrent workers for handling updates |
PORT |
8080 |
Port the web server listens on |
WEB_SERVER_BIND_ADDRESS |
0.0.0.0 |
Server bind address |
FQDN |
(bind address) | Your domain name for link generation |
HAS_SSL |
False |
Set True to generate https:// links |
NO_PORT |
True |
Set True to hide port from generated links (use when port is 80/443) |
KEEP_ALIVE |
False |
Ping self every PING_INTERVAL seconds — useful for PaaS free tiers |
PING_INTERVAL |
1200 |
Ping interval in seconds (default 20 min) |
USE_SESSION_FILE |
False |
Use session files instead of in-memory SQLite |
DEBUG |
False |
Enable debug logging |
Multi-client distributes Telegram API requests across multiple bots to avoid flood limits and handle more concurrent streams.
To enable, add extra bot tokens as env vars:
MULTI_TOKEN1=token_of_bot_1
MULTI_TOKEN2=token_of_bot_2
MULTI_TOKEN3=token_of_bot_3Add as many as needed. No upper limit tested.
⚠️ Important: Add all multi-client bots toBIN_CHANNELas admins.
⚠️ Add all bots (including multi-client ones) toBIN_CHANNELas admins before starting.
| Command | Description |
|---|---|
/start |
Check if bot is running |
Simply forward or send any media file to the bot. It will instantly reply with:
- 📄 File name
- 📦 File size
- 🔗 Direct download link
- Buttons: Shortened link + Download link
Links are valid as long as the bot is running and BIN_CHANNEL is intact.
Developed and maintained by GouthamSER
- GouthamSER — Owner & Developer & Re-Edited
- EverythingSuckz — Original author of TG-FileStreamBot
- eyaadh — Original streaming core from Megatron Bot
- BlackStone — Multi-client support
- Dan Tès — Pyrogram library
Copyright (C) 2026 GouthamSER under the GNU Affero General Public License v3.0.
This is free software — you can use, study, share and improve it under the terms of the AGPL-3.0 license.
