Download the PHP package shamimstack/tgsdk without Composer
On this page you can find all versions of the php package shamimstack/tgsdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shamimstack/tgsdk
More information about shamimstack/tgsdk
Files in shamimstack/tgsdk
Package tgsdk
Short Description Laravel filesystem driver backed by Telegram channels with Python upload worker, chunking, channel rotation, and CDN streaming support.
License MIT
Informations about the package tgsdk
# Laravel Telegram Hybrid Storage
A Laravel 12 package that implements a custom filesystem driver backed by Telegram channels. Files are uploaded asynchronously through a Python worker (Pyrogram) via a Redis queue, and served back through a streaming proxy with optional CDN support.
Repository: https://github.com/shamimlaravel/tgsdk.git
Features
- Laravel Storage API — Use
Storage::disk('telegram')->put(),get(),url(),exists(),delete(),size(),mimeType()seamlessly. - Telegram-backed storage — Files are stored as messages in Telegram channels via MTProto (Pyrogram).
- Async upload pipeline — Laravel enqueues uploads to Redis; a Python worker handles the actual Telegram upload.
- Unlimited file size — Intelligent chunking splits files beyond Telegram's 2 GB / 4 GB limits into ordered parts.
- Channel rotation — Distributes uploads across multiple Telegram channels (round-robin, least-used, capacity-aware).
- Multi-account session pooling — Multiple Pyrogram sessions for parallel uploads and throughput multiplication.
- Streaming proxy — Download files through a Laravel controller that streams directly from Telegram.
- Optional CDN — Prepend a CDN base URL to download links for edge caching.
- Signed URLs — Optional signed download URLs with configurable expiration.
- Chunk compression — Optional gzip compression per chunk (skips already-compressed formats).
- Chunk encryption — Optional AES-256-GCM encryption per chunk with unique IVs.
- Integrity verification — SHA-256 checksums for both whole files and individual chunks.
- Resumable uploads — Failed chunks are re-enqueued without re-uploading completed ones.
Requirements
- PHP 8.4+
- Laravel 12
- Redis
- Python 3.11+ (for the upload worker)
Installation
1. Install the Laravel package
2. Publish configuration and migrations
3. Add the disk to config/filesystems.php
4. Set environment variables
5. Set up the Python worker
Or use Docker:
Usage
Basic file operations
Event listeners
// In EventServiceProvider or via Event::listen() Event::listen(TelegramUploadCompleted::class, function ($event) { Log::info("File uploaded: {$event->path}", ['file_id' => $event->fileId]); });
Event::listen(TelegramUploadFailed::class, function ($event) { Log::error("Upload failed: {$event->path}", ['error' => $event->error]); });
Laravel App Python Worker ┌─────────────────┐ ┌──────────────────┐ │ Storage::put() │ │ worker.py │ │ │ │ │ │ │ │ ▼ │ Redis │ ▼ │ │ TelegramStorage ├──────────►│ SessionPool │ │ Adapter │ Queue │ │ │ │ │ │ │ ▼ │ │ ▼ │ │ uploader.py │ │ Metadata DB │◄──────────│ │ │ │ │ Callback │ ▼ │ └─────────────────┘ │ Telegram API │ └──────────────────┘ bash composer test
## License
MITAll versions of tgsdk with dependencies
illuminate/contracts Version ^12.0
illuminate/filesystem Version ^12.0
illuminate/http Version ^12.0
illuminate/queue Version ^12.0
illuminate/routing Version ^12.0
illuminate/support Version ^12.0
league/flysystem Version ^3.0
predis/predis Version ^3.4