FileToLink
The fastest Telegram File-to-Link Bot with built in PyroFork
Install / Use
/learn @Tamilupdates/FileToLinkREADME
🚀 KPS - File To Link Bot ⚡
<a href="https://telegram.me/KPSBots"><img src="https://graph.org/file/0ff9d5e94a070fe4154c0.jpg" alt="KPSBots Logo" width="550"></a>
<!-- 🍴 Forks --><a href="https://github.com/Tamilupdates/FileToLink/network/members"><img src="https://img.shields.io/github/forks/Tamilupdates/FileToLink?style=plastic&logo=git&logoColor=white&label=Forks&color=03A9F4&labelColor=0D47A1" alt="GitHub Forks"></a> <!-- ⭐ Stars --> <a href="https://github.com/Tamilupdates/FileToLink/stargazers"><img src="https://img.shields.io/github/stars/Tamilupdates/FileToLink?style=plastic&logo=github&logoColor=white&label=Stars&color=FBC02D&labelColor=424242" alt="GitHub Stars"></a> <!-- 🐞 Issues --> <a href="https://github.com/Tamilupdates/FileToLink/issues"><img src="https://img.shields.io/github/issues/Tamilupdates/FileToLink?style=plastic&logo=codecov&logoColor=white&label=Issues&color=E53935&labelColor=880E4F" alt="GitHub Issues"></a>
<!-- ⚡ PyroFork Framework --><a href="https://github.com/Mayuri-Chan/pyrofork"><img src="https://img.shields.io/badge/PyroFork-FF9800?style=plastic&logo=python&logoColor=white&labelColor=212121" alt="PyroFork Framework"></a> <!-- 📜 License --> <a href="LICENSE"><img src="https://img.shields.io/github/license/Tamilupdates/FileToLink?style=plastic&label=License&color=4CAF50&logo=open-source-initiative&logoColor=white&labelColor=1B5E20" alt="License"></a>
<!-- 💬 Telegram --><a href="https://telegram.me/KPSBots"><img src="https://img.shields.io/badge/Join%20on%20Telegram-0088CC?style=plastic&logo=telegram&logoColor=white&labelColor=0A3D62" alt="Telegram Channel" width="170"></a>
🚀 High-Performance Telegram File-to-Link Bot ⚡ For Direct Links 🎬 Streaming
</div>📑 Table of Contents
- About The Project
- How It Works
- Features
- Getting Started
- Configuration
- Usage and Commands
- Advanced Feature Setup
- Production Deployment Guide
- Support & Community
- License
- Acknowledgments
About The Project
KPS Bots is a powerful Telegram bot that transforms Telegram files into high-speed direct links, perfect for both streaming and rapid downloading. Share files via HTTP(S) links without needing to download them from the Telegram client first.
💡 Perfect For
- 🚀 Bypassing Telegram's built-in download speed limits
- ☁️ Unlimited cloud storage with fast streaming and download links
- 🎬 Content creators sharing media files
- 👥 Communities distributing resources
- 🎓 Educational platforms sharing materials
How It Works
User Uploads File → Telegram Bot → Forwards to Channel → Generates Direct Link → Direct Download / Streaming
- Upload → User sends any file to the bot.
- Store → The bot forwards the file to your private storage channel (
BIN_CHANNEL), where it is permanently saved to generate the link. - Generate → A unique, permanent link is created.
- Stream/Download → Anyone with the link can stream or download the file directly in their browser.
- Balance → Multi-client support distributes the load for high availability.
Features
Core Functionality
- ✅ Direct Link Generation - Convert any Telegram file into a direct HTTP(S) link.
- ✅ Permanent Links - Links remain active as long as the file exists in the storage channel.
- ✅ Browser Streaming & Downloading - Stream media directly or download files at high speed without a Telegram client.
- ✅ All File Types - Supports video, audio, documents, images, and any other file format.
- ✅ Batch Processing - Generate links for multiple files at once with a single command.
Performance & Scalability
- ✅ Multi-Client Support - Distributes traffic across multiple Telegram bots to avoid limits and increase throughput.
- ✅ Async Architecture - Built with
aiohttpandasynciofor non-blocking, high-performance operations. - ✅ MongoDB Integration - Ensures persistent and reliable data storage.
Security & Control
- 🔐 Token Authentication - Secure user access with a time-limited token system.
- 🛡️ Admin Controls - Full suite of commands for user and bot management.
- 👤 User Authentication - Require users to join a specific channel before they can use the bot.
- ✅ Channel/Group Support - Fully functional in private chats, groups, and channels.
Customization
- 🌍 Custom Domain - Serve files from your own domain for a professional look.
- 🔗 URL Shortening - Integrate with URL shortener services for clean, shareable links.
- 🎨 Custom Templates - Personalize messages sent by the bot to match your brand.
- 📈 Media Info Display - Shows file size, duration, and format details in the response message.
Getting Started
This section covers the system requirements and step-by-step installation guide for setting up KPS Bots.
Prerequisites
| Requirement | Description | Source | | :--- | :--- | :--- | | Python 3.13 | Programming language | python.org | | MongoDB | Database | mongodb.com | | Telegram API | API credentials | my.telegram.org | | Bot Token | From @BotFather | @BotFather | | Public Server | VPS/Dedicated server | Any provider | | Storage Channel | For file storage | Create in Telegram |
Installation
🚀 Deployment Guide (VPS)
1. Installing Requirements
Clone this repository:
git clone https://github.com/Tamilupdates/FileToLink f2l && cd f2l
Setting up config file:
cp config_sample.env config.env
Edit your settings:
nano config.env
Fill up rest of the fields. Meaning of each field is discussed below.
NOTE: All values must be filled between quotes, even if it's Int, Bool or List.
2. Build and Run the Docker Image
Make sure you mount the app folder and install Docker following the official documentation.
There are two methods to build and run the Docker image:
2.1 Using Official Docker Commands
-
Start Docker daemon (skip if already running):
sudo dockerd -
Build the Docker image:
sudo docker build . -t kps -
Run the image:
sudo docker run --name kps -p 80:80 -p 8080:8080 kps -
To stop the running image:
First, list running containers:
sudo docker psThen, stop the container using its ID:
sudo docker stop <container_id>
2.2 Using docker-compose (Recommended)
Note: If you want to use ports other than 80 and 8080 for torrent file selection and rclone serve respectively, update them in docker-compose.yml.
-
Install docker-compose:
sudo apt install docker-compose -
Build and run the Docker image (or view the current running image):
sudo docker-compose up -
After editing files (e.g., using nano to edit start.sh), rebuild:
sudo docker-compose up --build -
To stop the running image:
sudo docker-compose stop -
To restart the image:
sudo docker-compose start -
To view the latest logs from the running container (after mounting the folder):
sudo docker-compose up -
Tutorial Video for docker-compose and checking ports:
Docker Notes
IMPORTANT NOTES:
- You should stop the running image before deleting the container and you should delete the container before the image.
- To delete the container (this will not affect on the image):
sudo docker container prune
- To delete te images:
sudo docker image prune -a
<details>
<summary><h3>3. Manual Installation</h3></summary>
- Clone repository
git clone https://github.com/Tamilupdates/FileToLink f2l
cd f2l
- Setup virtual environment
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
- Configure
cp config_sample.env config.env
nano config.env
- Run bot
python -m KPS
</details>Tip: Start with the essential configuration to get KPS running, then add optional features as needed.
Configuration
Copy config_sample.env to config.env and fill in your values.
Essential Configuration
| Variable | Description | Example |
| :--- | :--- | :--- |
| API_ID | Telegram API ID | 12345678 |
| API_HASH | Telegram API Hash | abc123def456 |
| BOT_TOKEN | Bot token from @BotFather | 123456:ABCdefGHI |
| BIN_CHANNEL | Sto
