links4utoolz commited on
Commit
853bd76
·
verified ·
1 Parent(s): e2c4766

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +9 -788
README.md CHANGED
@@ -1,791 +1,12 @@
1
-
2
- <p align="center">
3
- <img src="https://iili.io/KhN0ztj.png" alt="Logo" width="400"/>
4
- </p>
5
-
6
-
7
- <p align="center">
8
- A powerful, self-hosted <b>Telegram Stremio Media Server</b> built with <b>FastAPI</b>, <b>MongoDB</b>, and <b>PyroFork</b> — seamlessly integrated with <b>Stremio</b> for automated media streaming and discovery.
9
- </p>
10
-
11
- <p align="center">
12
- <img src="https://img.shields.io/badge/UV%20Package%20Manager-2B7A77?logo=uv&logoColor=white" alt="UV Package Manager" />
13
- <img src="https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=white" alt="Python" />
14
- <img src="https://img.shields.io/badge/FastAPI-009688?logo=fastapi&logoColor=white" alt="FastAPI" />
15
- <img src="https://img.shields.io/badge/MongoDB-47A248?logo=mongodb&logoColor=white" alt="MongoDB" />
16
- <img src="https://img.shields.io/badge/PyroFork-EE3A3A?logo=python&logoColor=white" alt="PyroFork" />
17
- <img src="https://img.shields.io/badge/Stremio-8D3DAF?logo=stremio&logoColor=white" alt="Stremio" />
18
- <img src="https://img.shields.io/badge/Docker-2496ED?logo=docker&logoColor=white" alt="Docker" />
19
- </p>
20
-
21
- ---
22
-
23
- ## 🧭 Quick Navigation
24
-
25
- * [🚀 Introduction](#-introduction)
26
-
27
- * [✨ Key Features](#-key-features)
28
- * [💳 Subscription Management](#-subscription-management)
29
- * [📋 Subscription Plans](#-subscription-plans)
30
- * [🤖 Bot Payment Flow](#-bot-payment-flow)
31
- * [🗃️ Access Management](#️-access-management)
32
- * [🎬 Stremio Addon Integration](#-stremio-addon-integration)
33
-
34
- * [⚙️ How It Works](#️-how-it-works)
35
-
36
- * [📖 Overview](#overview)
37
- * [📤 Upload Guidelines](#upload-guidelines)
38
- * [🔁 Quality Replacement Logic](#-quality-replacement-logic)
39
- * [🎥 Updating CAMRip or Low-Quality Files](#-updating-camrip-or-low-quality-files)
40
- * [⚙️ Behind the Scenes](#behind-the-scenes)
41
-
42
- * [🤖 Bot Commands](#-bot-commands)
43
-
44
- * [📜 Command List](#command-list)
45
- * [⚙️ /set Command Usage](#set-command-usage)
46
-
47
- * [🔧 Configuration Guide](#-configuration-guide)
48
-
49
- * [🪜 Step 1: Create Your config.env File](#-step-1-create-your-configenv-file)
50
- * [🔑 Step 2: How to Get Each Value](#-step-2-how-to-get-each-value)
51
- * [📱 Step 3: Generate Your Telegram Session String](#-step-3-generate-your-telegram-session-string)
52
- * [🧩 Step 4: Configure Everything Else (Web Settings Page)](#-step-4-configure-everything-else-web-settings-page)
53
-
54
- * [🚀 Deployment Guide](#-deployment-guide)
55
-
56
- * [✅ Recommended Prerequisites](#-recommended-prerequisites)
57
- * [🐙 Heroku Guide](#-heroku-guide)
58
- * [🐳 VPS Guide (Recommended)](#-vps-guide-recommended)
59
-
60
- * [📺 Setting Up Your App (Nuvio Recommended)](#-setting-up-your-app-nuvio-recommended)
61
-
62
- * [📥 Install Nuvio](#-step-1-install-nuvio)
63
- * [🌐 Add the Addon](#-step-2-add-the-addon)
64
-
65
- * [🏅 Contributors](#-contributors)
66
-
67
-
68
- # 🚀 Introduction
69
-
70
- This project is a **next-generation Telegram Stremio Media Server** that allows you to **stream your Telegram files directly through Stremio**, without any third-party dependencies or file expiration issues. It’s designed for **speed, scalability, and reliability**, making it ideal for both personal and community-based media hosting.
71
-
72
-
73
- ## ✨ Key Features
74
-
75
- - ⚙️ **Multiple MongoDB Database Support**
76
- - 📡 **Multiple Telegram Channel Support**
77
- - ⚡ **Ultra-Fast Streaming Experience**
78
- - 🔑 **Multi-Token Load Balancer**
79
- - 🎬 **IMDb & TMDb Metadata Integration**
80
- - 🧩 **Seamless Split File Streaming Support**
81
- - 🎞️ **Play Multi-Part Videos as a Single Stream**
82
- - ♾️ **Permanent Streaming Links (No Expiration)**
83
- - 🧠 **Powerful Admin Dashboard**
84
- - 💳 **Subscription & Premium Management**
85
- - 🔐 **Advanced Access Control System**
86
- - 📚 **Custom & Automatic Catalog Generation**
87
- - 🖥️ **Web-Based Configuration Panel**
88
- - 🌐 **Built-in Addon Proxy Support**
89
- - 🔍 **Global Search Across Selected Channels**
90
-
91
-
92
-
93
- ## ⚙️ How It Works
94
-
95
- This project acts as a **bridge between Telegram storage and Stremio streaming**, connecting **Telegram**, **FastAPI**, and **Stremio** to enable seamless movie and TV show streaming directly from Telegram files.
96
-
97
- ### Overview
98
-
99
- When you **forward Telegram files** (movies or TV episodes) to your **AUTH CHANNEL**, the bot automatically:
100
-
101
- 1. 🗃️ **Stores** the `message_id` and `chat_id` in the database.
102
- 2. 🧠 **Processes** file captions to extract key metadata (title, year, quality, etc.).
103
- 3. 🌐 **Generates a streaming URL** through the **PyroFork** module — routed by **FastAPI**.
104
- 4. 🎞️ **Provides Stremio Addon APIs**:
105
- - `/catalog` → Lists available media
106
- - `/meta` → Shows detailed information for each item
107
- - `/stream` → Streams the file directly via Telegram
108
-
109
- ### Upload Guidelines
110
-
111
- To ensure proper metadata extraction and seamless integration with **Stremio**, all uploaded Telegram media files **must include specific details** in their captions.
112
-
113
- #### 🎥 For Movies
114
-
115
- **Example Caption:**
116
-
117
- ```
118
- Ghosted 2023 720p 10bit WEBRip [Org APTV Hindi AAC 2.0CH + English 6CH] x265 HEVC Msub ~ PSA.mkv
119
- ```
120
-
121
- **Required Fields:**
122
-
123
- - 🎞️ **Name** – Movie title (e.g., _Ghosted_)
124
- - 📅 **Year** – Release year (e.g., _2023_)
125
- - 📺 **Quality** – Resolution or quality (e.g., _720p_, _1080p_, _2160p_)
126
-
127
- ✅ **Optional:** Include codec, audio format, or source (e.g., `WEBRip`, `x265`, `Dual Audio`).
128
-
129
- #### 📺 For TV Shows
130
-
131
- **Example Caption:**
132
-
133
- ```
134
- Harikatha.Sambhavami.Yuge.Yuge.S01E04.Dark.Hours.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-Spidey.mkv
135
- ````
136
-
137
- **Required Fields:**
138
-
139
- - 🎞️ **Name** – TV show title (e.g., _Harikatha Sambhavami Yuge Yuge_)
140
- - 📆 **Season Number** – Use `S` followed by two digits (e.g., `S01`)
141
- - 🎬 **Episode Number** – Use `E` followed by two digits (e.g., `E04`)
142
- - 📺 **Quality** – Resolution or quality (e.g., _1080p_, _720p_)
143
-
144
- ✅ **Optional:** Include episode title, codec, or audio details (e.g., `WEB-DL`, `DDP5.1`, `Dual Audio`).
145
-
146
- ### 🔁 Quality Replacement Logic
147
-
148
- > Works only when **Replace Mode** is enabled.
149
-
150
- If a newly uploaded file has the same quality label (`720p`, `1080p`, `4K`, etc.) as an existing file, the bot automatically replaces the older entry with the new one.
151
-
152
- **Example:** Uploading a new `Ghosted (2023) 720p` file will replace the existing `720p` version in the catalog.
153
-
154
- This prevents duplicate quality entries and ensures only the latest version is available for streaming.
155
-
156
- ---
157
-
158
- ### 🆙 Updating CAMRip or Low-Quality Files
159
-
160
- > Works only when **Replace Mode** is enabled.
161
-
162
- If you initially uploaded a **CAMRip or low-quality version**, you can easily replace it with a better one:
163
-
164
- 1. Forward the **new, higher-quality file** (e.g., `1080p`, `WEB-DL`) to your **AUTH CHANNEL**.
165
- 2. The bot will **automatically detect and replace** the old CAMRip file in the database.
166
- 3. The Stremio addon will then **update automatically**, showing the new stream source.
167
-
168
- ✅ No manual deletion or command is needed — forwarding the updated file is enough!
169
-
170
- ---
171
-
172
- ### 🏷️ Fixing Incorrect Metadata (Manual Override)
173
-
174
- If the addon identifies a movie or TV show incorrectly, or if metadata is missing altogether, you can easily correct it using one of the following methods:
175
-
176
- #### Method 1: IMDb / TMDb URL Override
177
-
178
- 1. Copy the correct **IMDb** or **TMDb** URL for the movie or TV show.
179
- 2. Edit the message caption in your Telegram **AUTH CHANNEL** and paste the URL anywhere in the caption.
180
- 3. The bot will automatically:
181
-
182
- * Remove the existing metadata entry associated with that file.
183
- * Re-scan the provided URL.
184
- * Fetch and save the correct metadata.
185
-
186
- #### Method 2: Scan Metadata from the Web Panel
187
-
188
- 1. Open the media entry from the Movies or TV Shows section.
189
- 2. Click **Edit**.
190
- 3. Select **Scan Metadata**.
191
- 4. Search for the correct title and choose the matching result.
192
- 5. Apply the changes.
193
-
194
- ✅ The addon will update the metadata instantly and refresh the catalog entry.
195
-
196
- ---
197
-
198
-
199
- ### Behind The Scenes
200
-
201
- Here's how each component interacts:
202
-
203
- | Component | Role |
204
- | :--- | :--- |
205
- | **Telegram Bot** | Handles uploads, forwards, and file tracking. |
206
- | **MongoDB** | Stores message IDs, chat IDs, and metadata. |
207
- | **PyroFork** | Generates Telegram-based streaming URLs. |
208
- | **FastAPI** | Hosts REST endpoints for streaming, catalog, and metadata. |
209
- | **Stremio Addon** | Consumes FastAPI endpoints for catalog display and playback. |
210
-
211
- 📦 **Flow Summary:**
212
-
213
- ```
214
- Telegram ➜ MongoDB ➜ FastAPI ➜ Stremio ➜ User Stream
215
- ```
216
-
217
-
218
-
219
- # 🤖 Bot Commands
220
-
221
- Below is the list of available bot commands and their usage within the Telegram bot.
222
-
223
- ### Command List
224
-
225
- | Command | Description |
226
- | :--- | :--- |
227
- | **`/start`** | Returns your **Addon URL** for direct installation in **Stremio**. |
228
- | **`/log`** | Sends the latest **log file** for debugging or monitoring. |
229
- | **`/set`** | Used for **manual uploads** by linking IMDB URLs. |
230
- | **`/restart`** | Restarts the bot and pulls any **latest updates** from the upstream repository. |
231
-
232
- ### `/set` Command Usage
233
-
234
- The `/set` command is used to manually upload a specific Movie or TV show to your channel, linking it to its IMDB metadata.
235
-
236
- **Command:**
237
-
238
- ```
239
- /set <imdb-url>
240
- ```
241
-
242
- **Example:**
243
-
244
- ```
245
- /set https://www.imdb.com/title/tt0468569/
246
- ```
247
-
248
- **Steps:**
249
-
250
- 1. Send the `/set` command followed by the **IMDB URL** of the movie or show you want to upload.
251
- 2. **Forward the related movie or TV show files** to your channel.
252
- 3. Once all files are uploaded, **clear the default IMDB link** by simply sending the `/set` command without any URL.
253
-
254
- 💡 **Tip:** Use `/log` if you encounter any upload or parsing issues.
255
-
256
-
257
-
258
- # 🔧 Configuration Guide
259
-
260
- > 😌 **Don’t worry — setup is easier than it looks.**
261
- > You only fill in **6 values once** inside a single file called `config.env`. Everything else (TMDB key, channels, admin login, subscriptions, proxy…) is configured later from a friendly **Web Settings page** — no code, no restarts.
262
-
263
- Think of configuration as **two simple layers**:
264
-
265
- | Layer | Where | When you set it | What goes here |
266
- | :--- | :--- | :--- | :--- |
267
- | 🧱 **Startup** | `config.env` file | Once, before first launch | The core credentials needed to boot |
268
- | 🎛️ **Runtime** | **Web Settings page** | Anytime, after launch | Everything else — saved to the database, applied live |
269
-
270
- ---
271
-
272
- ## 🪜 Step 1: Create Your config.env File
273
-
274
- After cloning the project, copy the sample file and open it for editing:
275
-
276
- ```bash
277
- cp sample_config.env config.env
278
- nano config.env
279
- ```
280
-
281
- Fill in these values:
282
-
283
- | Variable | Required | What it is |
284
- | :--- | :---: | :--- |
285
- | `API_ID` | ✅ | Telegram API ID (from my.telegram.org) |
286
- | `API_HASH` | ✅ | Telegram API Hash (from my.telegram.org) |
287
- | `BOT_TOKEN` | ✅ | Your bot token (from @BotFather) |
288
- | `OWNER_ID` | ✅ | Your numeric Telegram user ID |
289
- | `DATABASE` | ✅ | **Two** MongoDB URIs, separated by a comma |
290
- | `PORT` | ✅ | Web server port (keep `8000` unless it’s busy) |
291
- | `USER_SESSION_STRING` | ⬜ | Optional — only needed for **Global Search** |
292
-
293
- A completed file looks like this (these are just example values):
294
-
295
- ```env
296
- API_ID="1234567"
297
- API_HASH="abc123def456ghi789jkl012mno345pq"
298
- BOT_TOKEN="1234567890:AAEabcdEFGhijkLMnOPqrsTUVwxyz12345"
299
- USER_SESSION_STRING=""
300
- OWNER_ID="987654321"
301
- DATABASE="mongodb+srv://user:pass@cluster0.xxxx.mongodb.net/tracking,mongodb+srv://user:pass@cluster0.xxxx.mongodb.net/storage1"
302
- PORT="8000"
303
- ```
304
-
305
- > 💾 To save in nano: press `Ctrl + O`, then `Enter`, then `Ctrl + X`.
306
-
307
- ---
308
-
309
- ## 🔑 Step 2: How to Get Each Value
310
-
311
- Take it one line at a time — each value comes from a quick, free step.
312
-
313
- ### 🆔 API_ID & API_HASH
314
- 1. Go to **https://my.telegram.org** and log in with your phone number.
315
- 2. Open **API development tools**.
316
- 3. Create an app (any title works, e.g. `stremio`).
317
- 4. Copy **App api_id** → `API_ID` and **App api_hash** → `API_HASH`.
318
-
319
- ### 🤖 BOT_TOKEN
320
- 1. Open **@BotFather** in Telegram.
321
- 2. Send `/newbot` and follow the prompts (choose a name and a username).
322
- 3. Copy the token it gives you → `BOT_TOKEN`.
323
- 4. ⭐ Add this bot as an **admin** in every channel you’ll use for media.
324
-
325
- ### 👤 OWNER_ID
326
- 1. Open **@userinfobot** in Telegram (or send `/id` to **@MissRose_bot**).
327
- 2. It replies with your numeric ID → `OWNER_ID`.
328
-
329
- ### 🗄️ DATABASE (two MongoDB URIs)
330
- You need **two** free MongoDB databases — the first stores tracking/metadata, the second stores your media references.
331
-
332
- 1. Create a free account at **https://www.mongodb.com/atlas** (the forever-free **M0** tier is enough to start).
333
- 2. Create a cluster → in **Database Access**, add a database user and password.
334
- 3. In **Network Access**, add `0.0.0.0/0` (allow access from anywhere).
335
- 4. Click **Connect → Drivers** and copy the connection string, e.g.
336
- `mongodb+srv://user:pass@cluster0.xxxx.mongodb.net/`
337
- 5. Add a database name at the end of each (e.g. `/tracking` and `/storage1`).
338
- 6. Put **both** strings on one line, separated by a comma:
339
- ```
340
- DATABASE="mongodb+srv://.../tracking,mongodb+srv://.../storage1"
341
- ```
342
-
343
- > 💡 You can use the **same cluster** for both — just give them two different database names. Need more space later? Add extra storage databases from the Web Settings page (no restart required).
344
-
345
- ### 🔢 PORT
346
- Leave it as `8000` unless that port is already in use. Your reverse proxy / domain will point here.
347
-
348
- ### 📱 USER_SESSION_STRING (optional)
349
- Only needed if you want **Global Search**. It’s safe and quick to generate — see **Step 3** below. If you don’t need Global Search, leave it empty.
350
-
351
- ---
352
-
353
- ## 📱 Step 3: Generate Your Telegram Session String
354
-
355
- > 😊 **No app installation required — and it’s safe.**
356
- > A session string is simply a “stay logged in” token for **your own** Telegram account, exactly like signing into Telegram Web. The bot never sees your password, and you can revoke access anytime from **Telegram → Settings → Devices**.
357
-
358
- > ⏭️ **Skip this step** entirely if you don’t plan to use Global Search.
359
-
360
- ### 🌐 Easiest Method: Google Colab (works right in your phone’s browser)
361
-
362
- 1️⃣ Open **https://colab.new** in your browser.
363
-
364
- 2️⃣ Sign in with your Google account.
365
-
366
- 3️⃣ Tap **“+ Code”** to add a new code cell.
367
-
368
- 4️⃣ Paste the code below and press ▶ **Run**:
369
-
370
- ```python
371
- !pip install pyrogram tgcrypto
372
-
373
- import asyncio
374
- from pyrogram import Client
375
-
376
- api_id = int(input("API ID: "))
377
- api_hash = input("API HASH: ")
378
-
379
- async def main():
380
- async with Client("temp_session", api_id, api_hash) as app:
381
- print("\nYour USER_SESSION_STRING is:\n")
382
- print(await app.export_session_string())
383
-
384
- await main()
385
- ```
386
-
387
- 5️⃣ Enter your **API ID** and **API HASH** when prompted.
388
-
389
- 6️⃣ Enter the **login code** Telegram sends you (and your 2-step password, if you have one).
390
-
391
- 7️⃣ Your **USER_SESSION_STRING** is printed on screen — copy the whole string into `config.env`.
392
-
393
- > 🔒 **Keep it private.** Anyone who has this string can access your account, so never share it or commit it to a public repository. To invalidate it instantly, just remove the session from Telegram’s **Devices** list.
394
-
395
- ---
396
-
397
- ## 🧩 Step 4: Configure Everything Else (Web Settings Page)
398
-
399
- Once the server is running, open it in your browser:
400
-
401
- | Setup | Open this URL |
402
- | :--- | :--- |
403
- | **VPS with a domain** | `https://your-domain.com` |
404
- | **Local / direct IP** | `http://<your-vps-ip>:8000` |
405
-
406
- You’ll land on the **login page** (`/login`). Sign in with the default credentials:
407
-
408
- ```
409
- Username: admin
410
- Password: admin
411
- ```
412
-
413
- Then go to **Settings** (`/admin/settings`).
414
-
415
- > 🚨 **Do this first:** change the admin password in the **Admin Authentication** card, then click **Save Settings**.
416
-
417
- Everything below is stored in the database and applied **instantly — no restart needed** (the only exception is `USER_SESSION_STRING`, which lives in `config.env`).
418
-
419
- ### ⚙️ General
420
- | Option | What it does |
421
- | :--- | :--- |
422
- | **Replace Mode** | When a new file has the same quality (`720p`, `1080p`…) as an existing one, it replaces the old entry. Recommended **ON**. |
423
- | **Hide Catalog** | Hides the public Stremio catalog (direct streams still work). |
424
-
425
- ### 🛡️ Admin Authentication
426
- | Field | What to enter |
427
- | :--- | :--- |
428
- | **Admin Username / Password** | Your Web Panel login. Leave the password blank to keep the current one. **Change the defaults right away.** |
429
- | **AUTH_CHANNELS** | The channel(s) the bot indexes and streams from. Add each one by `@username` or `-100…` ID. Make sure your bot is an **admin** in each channel. |
430
-
431
- ### 🎬 Media & Content
432
- | Field | What to enter |
433
- | :--- | :--- |
434
- | **TMDB API Key** | A free TMDB **v3** key from themoviedb.org → Settings → API. Powers automatic metadata matching. |
435
- | **Base URL** | Your public address, e.g. `https://your-domain.com`. **Important:** Stremio uses this to reach your streams. |
436
- | **Upstream Repo / Branch** | Optional — used by `/restart` to auto-update (e.g. repo `weebzone/Telegram-Stremio`, branch `master`). |
437
-
438
- ### 💳 Subscription (optional)
439
- Turn this on to monetise access. Set the **Subscription Group ID**, **Payment Instructions** (your UPI / bank / PayPal text), an optional **Payment QR image URL**, and the **Approver IDs** (who can approve requests). Renewal and "join the channel" prompts shown in Stremio point users back to **your bot automatically** — no separate URL to configure. The full flow is described in [Subscription Management](#-subscription-management).
440
-
441
- ### 🌐 Global Search (optional)
442
- Requires `USER_SESSION_STRING` in `config.env` plus one app restart to unlock. Then enable the toggle and add the **channel IDs** to search. Results that aren’t in your local catalog are tagged **🌐 GLOBAL** in Stremio.
443
-
444
- ### 🌐 Proxy (optional)
445
- Set an **HTTP Proxy URL** for outbound metadata/API requests, and optionally **show both** proxied and direct stream links.
446
-
447
- ### 🗄️ Extra Storage Databases
448
- Your first two databases (from `config.env`) are **locked** as *Tracking* and *Storage 1*. Add more MongoDB URIs here to expand storage capacity — 🟢 means connected. Remove entries only from the **end** of the list, since existing media reference databases by position.
449
-
450
- ### 📨 Multi-Token Clients
451
- Add extra **bot tokens** for faster parallel streaming under heavy load. Create more bots with @BotFather, add them as **admins** in all your AUTH channels, then paste their tokens here. Changes apply immediately.
452
-
453
- > ✅ Click **Save Settings** when you’re done. That’s it — you’re live!
454
-
455
- ---
456
-
457
- # 💳 Subscription Management
458
-
459
- The Subscription Management system allows you to **monetise access** to your Telegram Stremio server. When enabled, users must have an active subscription to stream content.
460
-
461
- ## 📋 Subscription Plans
462
-
463
- Admins can create and manage subscription plans from the **Admin Panel → Subscription Management** page.
464
-
465
- Each plan has:
466
- - **Name** (e.g. `Monthly`, `Quarterly`)
467
- - **Duration** in days
468
- - **Price** (for display)
469
- - **Description**
470
-
471
- Plans are stored in MongoDB and can be added, edited, or deleted at any time without restarting.
472
-
473
- ---
474
-
475
- ## 🤖 Bot Payment Flow
476
-
477
- Users interact with the bot to subscribe:
478
-
479
- ```
480
- User → /start → selects plan → sends payment screenshot
481
- → Approver gets notification → Approve / Reject
482
- → On Approve:
483
- ✅ Subscription saved to DB
484
- 🔑 Stremio addon token auto-generated
485
- 📨 User receives Stremio install link + group invite
486
- ```
487
-
488
- **Approver actions** (available to `APPROVER_IDS`):
489
-
490
- | Button | Action |
491
- | :--- | :--- |
492
- | ✅ Approve | Activates subscription, generates addon token, invites user to group |
493
- | ❌ Reject | Notifies user with rejection message |
494
-
495
  ---
496
-
497
- ## 🗃️ Access Management
498
-
499
- The **Admin Panel → Access Management** page gives admins full control over all users and their addon tokens.
500
-
501
- ### Columns Shown
502
-
503
- | Column | Description |
504
- | :--- | :--- |
505
- | Status | 🟢 Active / 🔴 Expired |
506
- | User | Display name or `User {id}` |
507
- | Addon Link | Stremio install URL + copy button |
508
- | Created | Token creation date |
509
- | Expires | Subscription expiry date |
510
- | Actions | Buttons for managing the user |
511
-
512
- ### Action Buttons
513
-
514
- | Button | Description |
515
- | :--- | :--- |
516
- | 📅 **Assign** | Assign or extend a subscription plan (adds days) |
517
- | ➕ **Extend** | Add extra days to an active subscription |
518
- | ➖ **Reduce** | Subtract days from an active subscription |
519
- | 🚫 **Revoke** | Wipe subscription entirely (marks expired) |
520
- | 🗑️ **Del Token** | Delete the addon token only (user still subscribed) |
521
- | 🔗 **Link User ID** | Link an old/orphan token to a Telegram user ID to enable management |
522
-
523
- > 💡 Manually created (old) tokens that have no linked user ID show a **🔗 Link User ID** button. Once linked, all action buttons become available.
524
-
525
- ### Search & Filtering
526
-
527
- - 🔍 Search by user name or ID
528
- - Filter by status: All / Active / Expired
529
- - Pagination with configurable page size
530
-
531
- ---
532
-
533
- ## 🎬 Stremio Addon Integration
534
-
535
- ### Per-User Addon Token
536
-
537
- Each user gets a **unique addon token** automatically generated on payment approval. Their Stremio addon URL is:
538
-
539
- ```
540
- https://your-domain.com/stremio/{token}/manifest.json
541
- ```
542
-
543
- ### Dynamic Manifest
544
-
545
- The addon manifest updates dynamically per user:
546
-
547
- | Scenario | Addon Name | Description |
548
- | :--- | :--- | :--- |
549
- | Active, has expiry | `Telegram — Expires 28 Mar 2026` | 📅 Subscription active until 28 Mar 2026 |
550
- | Active, no expiry | `Telegram — Active` | ✅ Subscription active |
551
- | Default (no subscription mode) | `Telegram` | Standard description |
552
-
553
- The manifest `version` encodes the expiry date — when an admin extends or revokes a subscription, the version changes and Stremio detects an update.
554
-
555
- ### Subscription Stream Gating
556
-
557
- When the subscription feature is enabled, the addon checks every stream request and shows a single actionable entry instead of the streams when the user isn't eligible. In both cases the stream link opens **your bot** (derived automatically from the bot's username — there is no URL to configure).
558
-
559
- **Plan expired** — the user's subscription has lapsed:
560
-
561
- ```json
562
- {
563
- "name": "🚫 Plan Expired",
564
- "title": "Your plan is expired.\nRenew it from the bot to continue watching.",
565
- "url": "https://t.me/your_bot"
566
- }
567
- ```
568
-
569
- **Not joined** — the user is active but has left / never joined the subscription channel (the `Subscription Group ID`):
570
-
571
- ```json
572
- {
573
- "name": "📢 Join Required",
574
- "title": "First join the channel to stream it.\nTap here to open the bot and join.",
575
- "url": "https://t.me/your_bot"
576
- }
577
- ```
578
-
579
- Clicking the stream name opens the bot directly so the user can renew or rejoin. The membership check fails open — if Telegram is briefly unreachable or the bot can't read the group, legitimate users are never blocked.
580
-
581
- ### Configure & Reinstall Page
582
-
583
- Every addon has a **Configure page** at:
584
-
585
- ```
586
- https://your-domain.com/stremio/{token}/configure
587
- ```
588
-
589
- This page shows:
590
- - User name, subscription status, expiry date
591
- - **⚡ Install / Update in Stremio** button (Stremio Web install flow)
592
- - Manual install steps + **📋 Copy URL** button
593
-
594
- The ⚙️ gear icon in Stremio opens this page so users can reinstall after an admin updates their subscription.
595
-
596
- ---
597
-
598
- # 🚀 Deployment Guide
599
-
600
- This guide will help you deploy your **Telegram Stremio Media Server** using either Heroku or a VPS with Docker.
601
-
602
- ## ✅ Recommended Prerequisites
603
-
604
- **Supported Servers:**
605
-
606
- - 🟣 **Heroku**
607
- - 🟢 **VPS**
608
-
609
- Before you begin, ensure you have:
610
-
611
- 1. ✅ A **VPS** with a public IP (e.g., Ubuntu on DigitalOcean, AWS, Vultr, etc.)
612
- 2. ✅ A **Domain name**
613
-
614
-
615
- ## 🐙 Heroku Guide
616
-
617
- Follow the instructions provided in the Google Colab Tool to deploy on Heroku.
618
-
619
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/weebzone/Colab-Tools/blob/main/telegram%20stremio.ipynb)
620
-
621
-
622
- ## 🐳 VPS Guide
623
-
624
- This section explains how to deploy your **Telegram Stremio Media Server** on a VPS using **Docker Compose (recommended)** or **Docker**.
625
-
626
-
627
- ### 1️⃣ Step 1: Clone & Configure the Project
628
-
629
- ```bash
630
- git clone https://github.com/weebzone/Telegram-Stremio
631
- cd Telegram-Stremio
632
- mv sample_config.env config.env
633
- nano config.env
634
- ```
635
-
636
- * Fill in all required variables in `config.env`.
637
- * Press `Ctrl + O`, then `Enter`, then `Ctrl + X` to save and exit.
638
-
639
- ## ⚙️ Step 2: Choose Your Deployment Method
640
-
641
- You can deploy the server using either **Docker Compose (recommended)** or **plain Docker**.
642
-
643
-
644
-
645
- ### 🟢 **Option 1: Deploy with Docker Compose (Recommended)**
646
-
647
- Docker Compose provides an easier and more maintainable setup, environment mounting, and restart policies.
648
-
649
- #### 🚀 Start the Container
650
-
651
- ```bash
652
- docker compose up -d
653
- ```
654
-
655
- Your server will now be running at:
656
- ➡️ `http://<your-vps-ip>:8000`
657
-
658
  ---
659
 
660
- #### 🛠️ Update `config.env` While Running
661
-
662
- If you need to modify environment values (like `BASE_URL`, `AUTH_CHANNEL`, etc.):
663
-
664
- 1. **Edit the file:**
665
-
666
- ```bash
667
- nano config.env
668
- ```
669
- 2. **Save your changes:** (`Ctrl + O`, `Enter`, `Ctrl + X`)
670
- 3. **Restart the container to apply updates:**
671
-
672
- ```bash
673
- docker compose restart
674
- ```
675
-
676
- ⚡ Since the config file is mounted, you **don’t need to rebuild** the image — changes apply automatically on restart.
677
-
678
-
679
-
680
- ### 🔵 **Option 2: Deploy with Docker (Manual Method)**
681
-
682
- If you prefer not to use Docker Compose, you can manually build and run the container.
683
-
684
- #### 🧩 Build the Image
685
-
686
- ```bash
687
- docker build -t telegram-stremio .
688
- ```
689
-
690
- #### 🚀 Run the Container
691
-
692
- ```bash
693
- docker run -d -p 8000:8000 telegram-stremio
694
- ```
695
-
696
- Your server should now be running at:
697
- ➡️ `http://<your-vps-ip>:8000`
698
-
699
-
700
-
701
- ### 🌐 Step 3: Add Domain (Required)
702
-
703
- #### 🅰️ Set Up DNS Records
704
-
705
- Go to your domain registrar and add an **A record** pointing to your VPS IP:
706
-
707
- | Type | Name | Value |
708
- | ---- | ---- | ----------------- |
709
- | A | @ | `195.xxx.xxx.xxx` |
710
-
711
-
712
- #### 🧱 Install Caddy (for HTTPS + Reverse Proxy)
713
-
714
- ```bash
715
- sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
716
- curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
717
- curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
718
- chmod o+r /usr/share/keyrings/caddy-stable-archive-keyring.gpg
719
- chmod o+r /etc/apt/sources.list.d/caddy-stable.list
720
- sudo apt update
721
- sudo apt install caddy
722
- ```
723
-
724
- #### ⚙️ Configure Caddy
725
-
726
- 1. **Edit the Caddyfile:**
727
-
728
- ```bash
729
- sudo nano /etc/caddy/Caddyfile
730
- ```
731
-
732
- 2. **Replace contents with:**
733
-
734
- ```caddy
735
- your-domain.com {
736
- reverse_proxy localhost:8000
737
- }
738
- ```
739
-
740
- * Replace `your-domain.com` with your actual domain name.
741
- * Adjust the port if you changed it in `config.env`.
742
-
743
- 3. **Save and reload Caddy:**
744
-
745
- ```bash
746
- sudo systemctl reload caddy
747
- ```
748
-
749
-
750
- ✅ Your API will now be available securely at:
751
- ➡️ `https://your-domain.com`
752
-
753
-
754
- # 📺 Setting Up Your App (Nuvio Recommended)
755
-
756
- Your media server works as a standard **Stremio-style addon**, so it plays in any compatible client. For the **best compatibility and smoothest experience across devices, we recommend the [Nuvio](https://play.google.com/store/apps/details?id=com.nuvio.app) app** — a free, open-source media hub for **Android, Android TV, Fire TV, iOS, Windows, and TV** that supports Stremio addon manifest URLs natively. *(Content was rephrased for compliance with licensing restrictions.)*
757
-
758
- > 💡 Already using **Stremio**? It works too — just install the same addon URL below. Nuvio simply tends to handle these Telegram streams more reliably across more devices.
759
-
760
- ## 📥 Step 1: Install Nuvio
761
-
762
- Download Nuvio from an official source:
763
-
764
- | Platform | Source |
765
- | :--- | :--- |
766
- | **Android / Android TV / Fire TV** | [Google Play](https://play.google.com/store/apps/details?id=com.nuvio.app) |
767
- | **All platforms / latest builds** | [GitHub — tapframe/NuvioStreaming](https://github.com/tapframe/NuvioStreaming) |
768
-
769
- > 🔗 *(Optional)* Connect **Trakt** in the app to sync your watch history and progress across devices.
770
-
771
- ## 🌐 Step 2: Add the Addon
772
-
773
- 1. Open **Nuvio** and go to the **Addons** section.
774
- 2. Paste your addon **manifest URL** and install it:
775
-
776
- | Deployment Method | Addon URL |
777
- | :--- | :--- |
778
- | **Heroku** | `https://<your-heroku-app>.herokuapp.com/stremio/manifest.json` |
779
- | **Custom Domain** | `https://<your-domain>/stremio/manifest.json` |
780
-
781
- 3. Done! 🎉 Your Telegram library now appears in the catalog and streams directly.
782
-
783
- > 🔑 If you run in **subscription mode**, each user installs their own **personal** addon URL (`/stremio/{token}/manifest.json`) that the bot gives them.
784
-
785
-
786
- ## 🏅 Contributors
787
-
788
- |<img width="80" src="https://avatars.githubusercontent.com/u/113664541">|<img width="80" src="https://avatars.githubusercontent.com/u/13152917">|<img width="80" src="https://avatars.githubusercontent.com/u/14957082">|<img width="80" src="https://raw.githubusercontent.com/vflixa1prime/Readme/main/VFlixPRime.png">|
789
- |:---:|:---:|:---:|:---:|
790
- |[`Karan`](https://github.com/Weebzone)|[`Stremio`](https://github.com/Stremio)|[`ChatGPT`](https://github.com/OPENAI)|[`VFlix Prime`](https://t.me/vflixprime2)|
791
- |Author|Stremio SDK|Refactor|Community Support
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: Stremio Bot
3
+ emoji: 🍿
4
+ colorFrom: blue
5
+ colorTo: indigo
6
+ sdk: docker
7
+ app_port: 7860
8
+ pinned: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  ---
10
 
11
+ # Telegram Stremio Bot
12
+ This space is running a custom Telegram bot for Stremio.