How fyaz05/filetolink works
Thunder is a Telegram file-to-link bot: users submit files through Telegram, the bot keeps canonical copies in a storage channel and creates links, and an HTTP server serves downloads and browser streams. The graph includes documented batch, multi-client, access-control, administration, and customization capabilities. Some plugin and route internals were not excerpted; edges supported by the source index or README are cited there, and uncertain wiring is omitted.
Main entry points: stream_routes.py HTTP stream routes · stream.py File commands · database.py Persistence and access records · __main__.py Application startup
Components 24
Telegram bot
- Bot clients
Thunder/bot/clients.py - File commands
Thunder/bot/plugins/stream.py - User commands
Thunder/bot/plugins/common.py - Admin commands
Thunder/bot/plugins/admin.py - Button callbacks
Thunder/bot/plugins/callbacks.py - Broadcast service
Thunder/utils/broadcast.py
File and link lifecycle
- Canonical file records
Thunder/utils/canonical_files.py - Media metadata
Thunder/utils/file_properties.py - Link generation
Thunder/utils/bot_utils.py
HTTP delivery
- HTTP stream routes
Thunder/server/stream_routes.py - Media page rendering
Thunder/utils/render_template.py - Telegram file retrieval
Thunder/utils/custom_dl.py
Platform services
- Application startup
Thunder/__main__.py - Persistence and access records
Thunder/utils/database.py - Access checks
Thunder/utils/decorators.py - Token authentication
Thunder/utils/tokens.py - Channel membership checks
Thunder/utils/force_channel.py - Request rate limiting
Thunder/utils/rate_limiter.py - URL shortening
Thunder/utils/shortener.py
Other components
- Telegram user
- Link visitor
- Telegram API
- Storage channel
- MongoDB
Connections 25
- Telegram user → File commands: submits files
README.md - File commands → Storage channel: forwards files
README.md - File commands → Canonical file records: records files
Thunder/bot/plugins/stream.py - Canonical file records → Persistence and access records: reads and writes
Thunder/utils/canonical_files.py - Persistence and access records → MongoDB: persists records
Thunder/utils/database.py - File commands → Link generation: builds links
Thunder/bot/plugins/stream.py - Link generation → URL shortening: shortens URLs
Thunder/utils/bot_utils.py - File commands → Request rate limiting: queues requests
Thunder/bot/plugins/stream.py - File commands → Access checks: checks access
Thunder/bot/plugins/stream.py - Access checks → Token authentication: validates tokens
Thunder/utils/decorators.py - User commands → Channel membership checks: checks membership
Thunder/bot/plugins/common.py - User commands → Persistence and access records: records users
Thunder/bot/plugins/common.py - Admin commands → Persistence and access records: manages records
Thunder/bot/plugins/admin.py - Admin commands → Broadcast service: starts broadcasts
Thunder/bot/plugins/admin.py - Button callbacks → Broadcast service: handles broadcast actions
Thunder/bot/plugins/callbacks.py - Link visitor → HTTP stream routes: requests media
README.md - HTTP stream routes → Canonical file records: looks up links
Thunder/server/stream_routes.py - HTTP stream routes → Bot clients: selects client
Thunder/server/stream_routes.py - HTTP stream routes → Media metadata: resolves metadata
Thunder/server/stream_routes.py - HTTP stream routes → Telegram file retrieval: retrieves media
Thunder/server/stream_routes.py - HTTP stream routes → Media page rendering: renders preview
Thunder/server/stream_routes.py - Telegram file retrieval → Telegram API: fetches file data
- Application startup → Bot clients: initializes clients
Thunder/__main__.py - Application startup → HTTP stream routes: starts server
Thunder/__main__.py - Application startup → Persistence and access records: initializes persistence
Thunder/__main__.py