SkillAgentSearch skills...

FileToLink

Thunder - The fastest Telegram File To Link bot, built on the pyrofork platform.

Install / Use

/learn @fyaz05/FileToLink

README

<p align="center"> <img src="https://cdn.jsdelivr.net/gh/fyaz05/Resources@main/FileToLink/Thunder.jpg" alt="Thunder Logo" width="120"> <h1 align="center">⚡ Thunder</h1> </p> <p align="center"> <b>High-Performance Telegram File-to-Link Bot for Direct Links & Streaming</b> </p> <p align="center"> <a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.13%2B-blue?style=for-the-badge&logo=python" alt="Python Version"></a> <a href="https://github.com/Mayuri-Chan/pyrofork"><img src="https://img.shields.io/badge/Pyrofork-red?style=for-the-badge" alt="Pyrofork"></a> <a href="LICENSE"><img src="https://img.shields.io/github/license/fyaz05/FileToLink?style=for-the-badge&color=green" alt="License"></a> <a href="https://t.me/Thunder_Updates"><img src="https://img.shields.io/badge/Telegram-Channel-blue?style=for-the-badge&logo=telegram" alt="Telegram Channel"></a> </p> <hr>

📑 Table of Contents

<hr>

About The Project

Thunder 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
  1. Upload → User sends any file to the bot.
  2. Store → The bot forwards the file to your private storage channel (BIN_CHANNEL), where it is permanently saved to generate the link.
  3. Generate → A unique, permanent link is created.
  4. Stream/Download → Anyone with the link can stream or download the file directly in their browser.
  5. 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 aiohttp and asyncio for 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.

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 | Storage channel ID | -1001234567890 | | OWNER_ID | Owner user ID | 12345678 | | DATABASE_URL | MongoDB connection | mongodb+srv://... | | FQDN | Domain/IP address | f2l.thunder.com | | HAS_SSL | HTTPS enabled | True or False | | PORT | Server port | 8080 | | NO_PORT | Hide port in URLs | True or False |

Optional Configuration

<details> <summary>Optional Configuration Details</summary>

| Variable | Description | Default | | :--- | :--- | :--- | | MULTI_TOKEN1 | Additional bot token 1 (use MULTI_TOKEN1, MULTI_TOKEN2, etc.) | (empty) | | FORCE_CHANNEL_ID | Required channel join | (empty) | | MAX_BATCH_FILES | Maximum files in batch processing | 50 | | CHANNEL | Allow processing messages from channels | False | | BANNED_CHANNELS | Blocked channel IDs | (empty) | | SLEEP_THRESHOLD | Client switch threshold | 300 | | WORKERS | Async workers | 8 | | NAME | Bot name | ThunderF2L | | BIND_ADDRESS | Bind address | 0.0.0.0 | | PING_INTERVAL | Ping interval (seconds) | 840 | | TOKEN_ENABLED | Enable tokens | False | | SHORTEN_ENABLED | URL shortening for tokens | False | | SHORTEN_MEDIA_LINKS | URL shortening for media | False | | TOKEN_TTL_HOURS | Token validity duration in hours | 24 | | URL_SHORTENER_API_KEY | Shortener API key | (empty) | | URL_SHORTENER_SITE | Shortener service | (empty) | | SET_COMMANDS | Auto-set bot commands | True | | RATE_LIMIT_ENABLED | Enable rate limiting | False | | MAX_FILES_PER_PERIOD | Files per window | 2 | | RATE_LIMIT_PERIOD_MINUTES | Time window | 1 | | MAX_QUEUE_SIZE | Queue size | 100 | | GLOBAL_RATE_LIMIT | Global limiting | True | | MAX_GLOBAL_REQUESTS_PER_MINUTE | Global limit | 4 |

</details>

Usage and Commands

Basic Usage

  1. Start → Send /start to the bot.
  2. Authenticate → Join required channels (if configured).
  3. Upload → Send any media file.
  4. Receive → Get a direct streaming and download link.
  5. Share → Anyone can access the file via the link.

Commands Reference

User Commands

| Command | Description | | :--- | :--- | | /start | Start the bot and get a welcome message. Also used for token activation. | | /link | Generates a link. For batches, reply to the first file of a group and specify the count. Example: /link 5 will process that file and the next four. | | /dc | Get the data center (DC) of a user or file. Use /dc id, or reply to a file or user. | | /ping | Check if the bot is online and measure response time. | | /about | Get information about the bot. | | /help | Show help and usage instructions. |

Admin Commands

| Command | Description | | :--- | :--- | | /status | Check bot status, uptime, and resource usage. | | /broadcast | Send a message to all users (supports text, media, buttons). | | /stats | View usage statistics and analytics. | | /ban | Ban a user or channel (reply to message or use user/channel ID). | | /unban | Unban a user or channel. | | /log | Send bot logs. | | /restart | Restart the bot. | | /shell | Execute a shell command. | | /speedtest | Run network speed test and display comprehensive results. | | /users | Show total number of users. | | /authorize | Permanently authorize a user to use the bot (bypasses token system). | | /deauthorize | Remove permanent authorization from a user. | | /listauth | List all permanently authorized users. |

<details> <summary><h4>BotFather Commands Setup</h4></summary>
start - Initialize bot
link - Generate direct link
dc - Get data center info
ping - Check bot status
about - Bot information
help - Show help guide
status - [Admin] System status
stats - [Admin] Usage statistics
broadcast - [Admin] Message all users
ban - [Admin] Ban user
unban - [Admin] Unban user
users - [Admin] User count
authorize - [Admin] Grant access
deauthorize - [Admin] Revoke access
listauth - [Admin] List authorized
log - [Admin] Send bot logs
restart - [Admin] Restart the bot
shell - [Admin] Execute shell command
speedtest - [Admin] Run network speed test
</details>

Advanced Feature Setup

Token System

Enable controlled access with tokens:

  1. Set TOKEN_ENABLED=True in your config.env.
  2. Users receive automatic tokens on first use.
  3. Admins can grant permanent authorization with /authorize to bypass tokens.
  4. Tokens include activation links for secure access.

URL Shortening

Configure URL shortening for cleaner links:

SHORTEN_ENABLED=True
SHORTEN_MEDIA_LINKS=True
URL_SHORTENER
View on GitHub
GitHub Stars115
CategoryDevelopment
Updated2d ago
Forks194

Languages

Python

Security Score

100/100

Audited on Mar 30, 2026

No findings