Jackgram allows you to index media files from public and private Telegram channels, storing them in a searchable database and serving them via a high-performance REST API. Built with FastAPI and Telethon, it's designed for speed, scalability, and ease of use. Leveraging FastTelethon for parallel chunky downloads, it ensures high-speed streaming even for large files.
Features β’ Installation β’ API Documentation β’ Contact
- π Channel Indexing: Automatically index video files from public and private Telegram channels.
- π Web Admin Dashboard: Manage indexed files, generate session strings, and view media in a responsive web UI with light/dark themes.
- π§ Interactive Contribution Wizard: Crowdsource media indexing with an intuitive Telegram bot wizard.
- π Multi-Account Streaming: Distribute MTProto streaming load across multiple Telegram accounts for enhanced speed and reliability.
- π Command Authorization: Restrict bot command access to specific Telegram user IDs for production security.
- π Real-time Progress: Live indexing progress bars and detailed status updates within the Telegram bot.
- π·οΈ Smart Metadata Extraction: Integrated PTT (Parse Torrent Title) for accurate extraction of resolution, codecs, and release groups from filenames.
- β‘ FastAPI Powered: High-performance REST API for lightning-fast data retrieval and streaming.
- π Secure Authentication: Optional token-based authentication system to protect your API.
- πΊ Seamless Streaming: Direct stream and download support with HTTP Range (Partial Content) support.
- ποΈ MongoDB Integration: Efficiently store and manage thousands of indexed files with ease.
- π¬ TMDb Integration: Automatically fetches rich metadata (titles, posters, plot) via The Movie Database API.
- π³ Docker Ready: Deploy in seconds using Docker and Docker Compose.
- π Backup & Restore: Easily backup your entire database to JSON and restore it whenever needed.
- π Multi-Log Channels: Configure multiple named log channels for organized file forwarding and easy selection.
- π‘οΈ Duplicate Prevention: Automatic detection and skipping of duplicate files based on name and size to maintain database integrity.
-
Clone the repository:
git clone https://github.com/Sam-Max/Jackgram.git cd Jackgram -
Configure Environment:
cp sample_config.env config.env # Open config.env and fill in your credentials -
Deploy:
docker-compose up -d
-
Install Requirements:
pip install -r requirements.txt
-
Setup MongoDB: Ensure you have a MongoDB instance running and accessible.
-
Run the application:
python3 -m jackgram
Fill your config.env with these essential variables. You can get Telegram API credentials from my.telegram.org.
| Variable | Description | Default |
|---|---|---|
API_ID |
Your Telegram API ID | Required |
API_HASH |
Your Telegram API Hash | Required |
BOT_TOKEN |
Telegram Bot Token (@BotFather) | Required |
TMDB_API |
TMDb API Key | Required |
BOT_LANGUAGE |
Global Telegram bot UI language (en or es) |
en |
START_WELCOME_MESSAGE |
Custom /start welcome text; supports \n and {version} |
Default localized message |
LOGS_CHANNEL |
Comma-separated channel IDs with optional names (e.g., -1001:Movies,-1002:Series) |
Required |
BASE_URL |
Public IP/Domain of your server | Required |
DATABASE_URL |
MongoDB connection string | mongodb://admin:admin@mongo:27017 |
SESSION_STRINGS |
Telethon session string(s) for private channels/streaming (single, comma-separated, or JSON array) | Optional |
USE_TOKEN_SYSTEM |
Enable/Disable API token system | True |
SECRET_KEY |
Secret key for JWT encryption | your-secret-token |
PORT |
Web server port | 5000 |
WORKERS |
Number of concurrent workers | 10 |
INDEX_MIN_SIZE_MB |
Minimum file size to index (in MB) | Optional |
INDEX_ADULT_KEYWORDS |
Comma-separated list of keywords to ignore files | Optional |
INDEX_ALLOWED_EXTENSIONS |
Comma-separated list of permitted extensions (e.g. .mkv,.mp4) |
Optional |
ADMIN_IDS |
Comma-separated Telegram User IDs allowed to run bot commands | Default: All (unsecured) |
BACKUP_DIR |
Directory where database backups are stored | ./database |
The Telegram bot supports a global UI language configured through config.env.
- Set
BOT_LANGUAGE="en"to keep the current English bot text. - Set
BOT_LANGUAGE="es"to show bot messages and button labels in Spanish. - Set
START_WELCOME_MESSAGE="..."to override the/startwelcome text fromconfig.env. START_WELCOME_MESSAGEsupports\nfor line breaks and{version}for the current Jackgram version.- English remains the fallback if a translation key is missing.
Implementation notes and maintenance workflow are documented in docs/bot-localization.md.
The bot provides a set of admin commands to manage your index:
| Command | Description |
|---|---|
/start |
Show welcome message and categorized command list. |
/index |
Interactive wizard or direct command to index a channel by count (/index start_id count) with live progress. |
/search |
Search indexed files (Movies, TV Shows, and Raw Files) via the bot. |
/count |
Detailed database stats including breakdown by type and total storage used. |
/del |
Delete an entry from the index by providing its TMDb ID. |
/save_db |
Export the current database to a JSON backup. |
/load_db |
Restore the database by replying to a JSON backup file. |
/del_db |
Safely wipe a database index with inline confirmation buttons. |
/log |
Download the current bot.log file for deubgging. |
/token |
Generate a new API authentication token for external clients. |
All API requests require the Authorization: Bearer <token> header if USE_TOKEN_SYSTEM is enabled.
- Web Dashboard:
GET /(Redirects to/web/index.htmlfor the interactive UI) - Admin API:
GET /api/admin/...(Endpoints for indexing, generating sessions, stats, DB wiping, and metadata sync)
- Series:
GET /stream/series/{tmdb_id}:{season}:{episode}.json{ "tmdb_id": "77163", "streams": [ { "name": "Telegram", "title": "TV Show Title", "quality": "720p", "size": 263039472, "hash": "XXXXXX" } ] } - Movie:
GET /stream/movie/{tmdb_id}.json{ "tmdb_id": "592831", "streams": [ { "name": "Telegram", "title": "Movie Name", "quality": "1080p", "size": 1189639567, "hash": "XXXXXX" } ] } - Download:
GET /dl?hash={file_hash}(Supports Range headers for seeking)
- Search:
GET /search?query={q}&page={n} - Latest:
GET /stream/latest?page={n} - Raw Files:
GET /stream/files?page={n}
- Status:
GET /status(Check if server and bot are online)
If you like this project and want to support its development, consider buying me a coffee!
Join our Telegram for updates, support, and discussions:
Index and serve at your own risk. This tool is for educational purposes only and the author is not responsible for what you index.
Distributed under the GNU GPL v3 License.
Disclaimer: This bot should only be used to access movies and TV series not protected by copyright.