Transform Any Telegram File into a Shareable Direct Download & Streaming Link
🤖 Try the Live Bot •
🚀 Deploy •
⚙️ Config •
📖 Usage
FileToLink is a Python-based Telegram bot that instantly converts any file uploaded to Telegram into a permanent HTTP/HTTPS direct download and streaming link. It leverages Telegram's file storage infrastructure, making it effortless to share media, documents, and more — no cloud storage account required.
🔴 Live Demo: @file2linkkuttu_bot
- ⚡ Instant Link Generation — Upload any file and receive a direct download link within seconds.
- 🎥 Streaming Support — Media files (video, audio) can be streamed directly in a browser or media player.
- 🚀 High-Speed Downloads — Direct links bypass Telegram client limitations for rapid retrieval.
- 💾 Large File Support — Handles files up to Telegram's maximum limit (up to 4 GB).
- 🗃️ MongoDB Integration — Persistent storage for user data and file indexing.
- 👑 Admin Controls — Broadcast messages, view stats, and manage files via admin commands.
- 📦 Plugin System — Modular plugin architecture makes it easy to extend functionality.
- 🐳 Docker & Cloud Ready — Deploy on Docker, Render, Koyeb, or any VPS with ease.
FileToLink/
├── bot.py # Main entry point — initializes and starts the bot
├── info.py # Configuration — API keys, tokens, and env variables
├── utils.py # Utility/helper functions shared across the project
├── Script.py # Additional scripting or startup logic
├── database/ # MongoDB interaction — user management & file indexing
├── plugins/ # Modular command handlers (stats, broadcast, etc.)
├── lib/ # Core library/helper modules
├── requirements.txt # Python dependencies
├── Dockerfile # Docker deployment configuration
├── Procfile # Process file for platforms like Heroku/Railway
├── logging.conf # Logging configuration
└── .python-version # Specifies the required Python version
- Python 3.10+ 🐍
- Telegram Account 👤
- Telegram API credentials from my.telegram.org
- A Bot Token from @BotFather
- MongoDB URI (e.g., MongoDB Atlas — free tier works fine)
- A private Telegram channel where the bot is admin (used to store files)
-
Clone the repository:
git clone https://github.com/GouthamSER/FileToLink cd FileToLink -
Install dependencies:
pip3 install -r requirements.txt
-
Configure environment variables — fill in your values in
info.pyor set them as environment variables (see Configuration below). -
Run the bot:
python3 bot.py
docker build -t filetolink .
docker run -d \
-e BOT_TOKEN="your_bot_token" \
-e API_ID="your_api_id" \
-e API_HASH="your_api_hash" \
-e DATABASE_URI="your_mongodb_uri" \
-e LOG_CHANNEL="-100xxxxxxxxxx" \
filetolinkDeploy instantly to your preferred cloud platform:
| Platform | Button |
|---|---|
| Koyeb | |
| Render |
Set the following variables in info.py or as environment variables on your hosting platform:
| Variable | Required | Description |
|---|---|---|
BOT_TOKEN |
✅ | Your bot token from @BotFather |
API_ID |
✅ | Telegram API ID from my.telegram.org |
API_HASH |
✅ | Telegram API Hash from my.telegram.org |
LOG_CHANNEL |
✅ | ID of the private channel where files are stored (bot must be admin) |
DATABASE_URI |
✅ | MongoDB connection string for user data and file indexing |
ADMINS |
⬜ | Space-separated list of Telegram User IDs with admin access |
⚠️ Security Warning: Never commitinfo.pywith real credentials to a public repository. Use environment variables or a.envfile and add it to.gitignore.
| Command | Description |
|---|---|
/start |
Start the bot and receive a welcome message |
| (Upload any file) | Send or forward any file to instantly receive a direct download link |
| Command | Description |
|---|---|
/stats |
View bot statistics (total users, files indexed, etc.) |
/broadcast |
Broadcast a message to all bot users |
/delete |
Reply to a file message to remove it from the index |
Contributions, issues, and feature requests are welcome!
- Fork the repository
- Create your feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/my-feature - Open a Pull Request
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for details.
Made with ❤️ by GouthamSER
⭐ If you find this project useful, please consider giving it a star!