@officebeats/matrix-iptv-cli 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +121 -0
- package/README.md +191 -0
- package/about.md +32 -0
- package/bin/cli.js +32 -0
- package/index.html +90 -0
- package/package.json +26 -0
- package/scripts/install-binary.js +83 -0
- package/test_config.json +85 -0
package/CHANGES.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# IPTV App Changes Summary
|
|
2
|
+
|
|
3
|
+
## Date: 2025-12-21
|
|
4
|
+
|
|
5
|
+
### Changes Implemented
|
|
6
|
+
|
|
7
|
+
#### ✅ 1. Renamed "ARCHIVE_DATA" to "MOVIE_DATA"
|
|
8
|
+
|
|
9
|
+
**Files Modified:**
|
|
10
|
+
- `src/ui.rs`
|
|
11
|
+
|
|
12
|
+
**Changes:**
|
|
13
|
+
- **Line 167-169**: Changed header tab from `ARCHIVE_ACCESS` to `MOVIE_ACCESS`
|
|
14
|
+
- **Line 799-801**: Changed VOD streams pane title from `ARCHIVE_DATA` to `MOVIE_DATA`
|
|
15
|
+
|
|
16
|
+
**Rationale:** Better reflects the content type (movies/VOD) instead of generic "archive" terminology.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
#### ✅ 2. Added "All Movies" Category for VOD
|
|
21
|
+
|
|
22
|
+
**Files Modified:**
|
|
23
|
+
- `src/main.rs`
|
|
24
|
+
|
|
25
|
+
**Changes:**
|
|
26
|
+
- **Line 237-253**: Injected "All Movies" category at index 0 of VOD categories list
|
|
27
|
+
- Category ID: "ALL"
|
|
28
|
+
- Category Name: "All Movies"
|
|
29
|
+
- Similar to how "All Channels" works for live TV
|
|
30
|
+
|
|
31
|
+
**Rationale:** Allows users to browse all VOD content across all categories without having to select individual categories.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
#### ✅ 3. Implemented "All Movies" Stream Loading
|
|
36
|
+
|
|
37
|
+
**Files Modified:**
|
|
38
|
+
- `src/main.rs`
|
|
39
|
+
|
|
40
|
+
**Changes:**
|
|
41
|
+
- **Line 1362-1403**: Modified VOD stream loading logic to handle "ALL" category
|
|
42
|
+
- When "ALL" category is selected, calls `client.get_vod_streams_all().await`
|
|
43
|
+
- Otherwise, calls `client.get_vod_streams(&cat_id).await` for specific category
|
|
44
|
+
- Properly formatted with consistent indentation and error handling
|
|
45
|
+
|
|
46
|
+
**Code Structure:**
|
|
47
|
+
```rust
|
|
48
|
+
tokio::spawn(async move {
|
|
49
|
+
// Handle "All Movies" category
|
|
50
|
+
if cat_id == "ALL" {
|
|
51
|
+
match client.get_vod_streams_all().await {
|
|
52
|
+
Ok(streams) => { /* Load all streams */ }
|
|
53
|
+
Err(e) => { /* Handle error */ }
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
match client.get_vod_streams(&cat_id).await {
|
|
57
|
+
Ok(streams) => { /* Load category streams */ }
|
|
58
|
+
Err(e) => { /* Handle error */ }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### Performance Considerations
|
|
67
|
+
|
|
68
|
+
**Existing Optimizations:**
|
|
69
|
+
- Windowed rendering is already implemented in `src/ui.rs` (lines 608-702)
|
|
70
|
+
- Only visible items are parsed and rendered, not the entire list
|
|
71
|
+
- This should provide good scrolling performance even with large datasets
|
|
72
|
+
|
|
73
|
+
**Potential Performance Issues:**
|
|
74
|
+
1. Network latency when loading large "All Movies" list
|
|
75
|
+
2. Parsing overhead in `parse_movie()` and `parse_stream()` functions
|
|
76
|
+
3. The windowed rendering uses a half-window buffer which should be optimal
|
|
77
|
+
|
|
78
|
+
**Recommendation:**
|
|
79
|
+
- Monitor performance with real-world data
|
|
80
|
+
- If issues persist, consider:
|
|
81
|
+
- Caching parsed results
|
|
82
|
+
- Implementing lazy loading/pagination
|
|
83
|
+
- Optimizing the parsing functions
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### Testing
|
|
88
|
+
|
|
89
|
+
**Status:** ✅ App compiles and runs successfully
|
|
90
|
+
|
|
91
|
+
**Test Command:**
|
|
92
|
+
```bash
|
|
93
|
+
cargo run --bin matrix-iptv
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Expected Behavior:**
|
|
97
|
+
1. Navigate to VOD section (press 'v' from live channels)
|
|
98
|
+
2. "All Movies" should appear as the first category
|
|
99
|
+
3. Selecting "All Movies" should load all VOD streams across all categories
|
|
100
|
+
4. Header should show "MOVIE_ACCESS" instead of "ARCHIVE_ACCESS"
|
|
101
|
+
5. Stream list should show "MOVIE_DATA" instead of "ARCHIVE_DATA"
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### Files Created During Implementation
|
|
106
|
+
|
|
107
|
+
- `fix_vod.py` - Python script used to fix malformed code
|
|
108
|
+
- `fix_main.ps1` - PowerShell script (not used in final solution)
|
|
109
|
+
- `update_vod.ps1` - PowerShell script (not used in final solution)
|
|
110
|
+
- `vod_all_movies.patch` - Patch file (reference only)
|
|
111
|
+
|
|
112
|
+
**Note:** These helper files can be deleted after verification.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### Next Steps
|
|
117
|
+
|
|
118
|
+
1. ✅ Test with actual IPTV playlist to verify "All Movies" functionality
|
|
119
|
+
2. Monitor scrolling performance with large datasets
|
|
120
|
+
3. Consider adding loading indicators for "All Movies" (can take longer)
|
|
121
|
+
4. Optional: Add a count indicator showing total movies in "All Movies" category
|
package/README.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# 🟢 Matrix IPTV CLI
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
**// THE_PREMIUM_TERMINAL_IPTV_DECODER //**
|
|
6
|
+
|
|
7
|
+
Matrix IPTV CLI is a blazing fast, keyboard-driven interface for browsing Live TV, Movies, and Series. Inspired by the Matrix and built with Rust, it's designed to be the ultimate premium TUI (Terminal User Interface) for IPTV power users.
|
|
8
|
+
|
|
9
|
+
This project is being actively optimized by **Ernesto "Beats"** with a primary focus on **Live TV and Sports** performance, ensuring zero-latency navigation and professional-grade video clarity.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 📸 Gallery
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<img src="./assets/playlists.png" width="45%" />
|
|
17
|
+
<img src="./assets/pill.png" width="45%" />
|
|
18
|
+
<br />
|
|
19
|
+
<img src="./assets/live.png" width="90%" />
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 🚀 Instant Installation
|
|
25
|
+
|
|
26
|
+
**Prerequisites:** Matrix IPTV CLI requires **MPV Player** (for video) and **Node.js** (for the CLI).
|
|
27
|
+
|
|
28
|
+
#### **Don't have MPV Player?**
|
|
29
|
+
|
|
30
|
+
- **Windows:** `winget install info.mpv.mpv`
|
|
31
|
+
- **Mac:** `brew install mpv`
|
|
32
|
+
- **Linux:** `sudo apt install mpv`
|
|
33
|
+
|
|
34
|
+
#### **Don't have Node.js?**
|
|
35
|
+
|
|
36
|
+
- **Windows:** `winget install OpenJS.NodeJS`
|
|
37
|
+
- **Mac:** `brew install node`
|
|
38
|
+
- **Linux:** `sudo apt install nodejs npm`
|
|
39
|
+
|
|
40
|
+
### **Global NPM Install (Recommended)**
|
|
41
|
+
|
|
42
|
+
If you have Node.js installed, this is the easiest way to stay updated:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install -g @officebeats/matrix-iptv-cli
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### **One-Click Scripts**
|
|
49
|
+
|
|
50
|
+
Alternatively, use these platform-specific one-liners:
|
|
51
|
+
|
|
52
|
+
#### **Windows**
|
|
53
|
+
|
|
54
|
+
```powershell
|
|
55
|
+
powershell -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/officebeats/matrix-iptv/main/install.ps1 | iex"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### **Mac & Linux**
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
curl -sSL https://raw.githubusercontent.com/officebeats/matrix-iptv/main/install.sh -o install_matrix.sh && bash install_matrix.sh && rm install_matrix.sh
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 🎬 How to Run
|
|
67
|
+
|
|
68
|
+
Simply open any terminal and type:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
matrix-iptv
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## ✨ Features
|
|
77
|
+
|
|
78
|
+
- **USA Mode**: Strictly optimized for **Strong 8K**, **Mega OTT**, and **TRex**. Hides international clutter and cleans channel names instantly.
|
|
79
|
+
- **⚡ Instant Response**: Built in Rust for maximum performance. Navigate tens of thousands of channels with zero lag.
|
|
80
|
+
- **📡 Xtream API Native**: Strictly optimized for **Xtream API** providers (support for M3U is not planned at this time).
|
|
81
|
+
- **🏟️ Sports & Live Focused**: Layout and performance tuned specifically for the most demanding live events.
|
|
82
|
+
- **📁 "All" Content Navigation**: Browse everything at once with "All Channels" and "All Movies" views.
|
|
83
|
+
- **🎬 Full Series Support**: Dedicated multi-column view for Series, Seasons, and Episodes.
|
|
84
|
+
- **📟 Infinite Screensaver**: High-performance Matrix rain screensaver (find it in Settings).
|
|
85
|
+
- **📡 Secure**: Uses Private DNS-over-HTTPS (DoH) for connecting to your provider.
|
|
86
|
+
- **📽️ Headless Playback**: Integrated borderless fullscreen mode for a cinematic experience without window distractions.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 🏎️ Optimized Providers
|
|
91
|
+
|
|
92
|
+
> **⚠️ Disclaimer:** This is an experimental feature strictly targeting the top 3 most widely available playlists on platforms like **z2u** and **g2g**. Please do not request support or additions for other playlists at this time.
|
|
93
|
+
|
|
94
|
+
> **💻 OS Compatibility:** Development and testing are done primarily on **Windows**. Mac and Linux variants are provided as-is and may contain platform-specific bugs. If you encounter an issue, please report it with **screenshots and a detailed description** so I can "vibe code" a fix. As a Product Manager, I rely on clear visual and descriptive data to troubleshoot!
|
|
95
|
+
|
|
96
|
+
Matrix IPTV CLI is refined for high-density, high-quality playlists, including:
|
|
97
|
+
|
|
98
|
+
- **Strong 8K**: Custom filtering logic to remove international clutter (AR|, etc.) and maximize US sports visibility.
|
|
99
|
+
- **Mega OTT**: Optimized category parsing and rapid metadata loading.
|
|
100
|
+
- **TRex IPTV**: Enhanced sport category prioritization and fast channel tuning.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## USA Mode
|
|
105
|
+
|
|
106
|
+
The **USA Mode** is a powerful filtering and cleaning engine strictly optimized for **Strong 8K**, **Mega OTT**, and **TRex IPTV** playlists.
|
|
107
|
+
|
|
108
|
+
#### **How to use:**
|
|
109
|
+
|
|
110
|
+
1. Press the **`x`** key to open **Settings**.
|
|
111
|
+
2. Navigate to **USA Mode**.
|
|
112
|
+
3. Press **`Enter`** to toggle it On/Off.
|
|
113
|
+
4. Press **`Esc`** to return and apply the filtering instantly.
|
|
114
|
+
|
|
115
|
+
- **Strict Geo-Filtering**: Automatically hides international categories (UK, AR, etc.) in these optimized playlists to keep your list clean.
|
|
116
|
+
- **Clean Channel Names**: Removes redundant tags like `US |`, `USA |`, and `FHD |` from channel names, leaving you with just the name of the network.
|
|
117
|
+
- **Smart Filtering**: Prioritizes American sports and local networks (NFL, NBA, ESPN) for an effortless viewing experience.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 📽️ MPV Enhancements
|
|
122
|
+
|
|
123
|
+
We leverage advanced **MPV** flags to ensure professional-level video quality even on lower-end hardware:
|
|
124
|
+
|
|
125
|
+
- **Headless Fullscreen**: Launches directly into borderless fullscreen (`--no-border`, `--fs`) for a professional, TV-like experience.
|
|
126
|
+
- **Advanced Anti-Aliasing**: Uses `spline36` scaling, providing superior edge smoothing and diagonal line clarity on any machine.
|
|
127
|
+
- **Oversample Upscaling**: High-quality temporal upscaling that sharpens images while reducing movement flickering (Temporal AA).
|
|
128
|
+
- **Motion Smoothing**: High-performance `display-resample` interpolation for fluid sports playback at native refresh rates.
|
|
129
|
+
- **Hardware Acceleration**: Automatic `hwdec=auto-safe` with modern Windows `d3d11-flip` presentation for zero-copy GPU decoding.
|
|
130
|
+
- **Anti-Ringing Filter**: Eliminates halos around sharp edges and logos for a cleaner, high-end look.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## ⌨️ Common Controls
|
|
135
|
+
|
|
136
|
+
| Key | Action |
|
|
137
|
+
| :---------------------- | :--------------------------------------------------------- |
|
|
138
|
+
| **`Enter`** | **Play Channel / Select Category** |
|
|
139
|
+
| **`Esc` / `Backspace`** | **Go Back** |
|
|
140
|
+
| **`f`** | **Favorite** (Add/Remove current item from Favorites) |
|
|
141
|
+
| **`/`** | **Search** (Filters results instantly) |
|
|
142
|
+
| **`j` / `↓`** | Move Down |
|
|
143
|
+
| **`k` / `↑`** | Move Up |
|
|
144
|
+
| **`x`** | **Settings** (Update your playlist or turn on Screensaver) |
|
|
145
|
+
| **`q`** | **Quit** |
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 🛠️ Prerequisites
|
|
150
|
+
|
|
151
|
+
The installation scripts will attempt to install these for you:
|
|
152
|
+
|
|
153
|
+
- **MPV Player**: [mpv.io](https://mpv.io)
|
|
154
|
+
- **Rust Compiler**: [rustup.rs](https://rustup.rs) (Only required for manual builds)
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
> **⚠️ Disclaimer:** Matrix IPTV CLI and its creator, are **not affiliated** with z2u, g2g, or any IPTV provider. We do not sell or distribute content. All transactions on these platforms are at your own risk. This guide is for informational purposes only (experimental "USA Mode" testing).
|
|
159
|
+
|
|
160
|
+
<details>
|
|
161
|
+
<summary><strong>🛒 Where to Buy Playlists (Click to Expand)</strong></summary>
|
|
162
|
+
|
|
163
|
+
<br>
|
|
164
|
+
|
|
165
|
+
The experimental "USA Mode" is optimized for **Strong 8K**, **TRex**, and **Mega OTT** playlists. These are typically sourced from third-party marketplaces:
|
|
166
|
+
|
|
167
|
+
- **Platforms**: **z2u.com** or **g2g.com**
|
|
168
|
+
- **Search Terms**: "Strong 8k IPTV", "Trex IPTV", "Mega OTT"
|
|
169
|
+
- **Duration**: Usually sold in **1-month**, **6-month**, or **1-year** increments.
|
|
170
|
+
|
|
171
|
+
### ✅ Buying Tips
|
|
172
|
+
|
|
173
|
+
1. **Check Ratings**: Always choose a seller with a **high rating (98%+)** and a high sales count. These are 2-sided marketplaces, so reputation is everything.
|
|
174
|
+
2. **Safe Payment**: Use strictly secure payment methods like **Google Pay** or **Apple Pay** directly through your device. Avoid direct bank transfers or obscure payment links.
|
|
175
|
+
|
|
176
|
+
</details>
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## ⚡ Community & Support
|
|
181
|
+
|
|
182
|
+
Built and optimized with ❤️ by **Ernesto "Beats"** with the help of google antigravity and vibe coding during his PTO vacation time.
|
|
183
|
+
|
|
184
|
+
[](https://x.com/officebeats)
|
|
185
|
+
[](https://discord.com/users/317887730703138826)
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## 📜 License
|
|
190
|
+
|
|
191
|
+
MIT // [ProductMG.com](https://www.productmg.com)
|
package/about.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Vibe IPTV CLI
|
|
2
|
+
|
|
3
|
+
Learning how to vibecode with Google antigravity by building tools
|
|
4
|
+
I casually need. Made this possible thanks to the use of Google Antigravity AI. :)
|
|
5
|
+
|
|
6
|
+
I'm Ernesto "Beats", a product manager by profession.
|
|
7
|
+
|
|
8
|
+
*+* ++++++++++
|
|
9
|
+
+++ *++++++++++++++*
|
|
10
|
+
+++++++* *+++*
|
|
11
|
+
+++++ *++* *+++
|
|
12
|
+
+++* +++++++++* ++*
|
|
13
|
+
+++ ++* *+* ++
|
|
14
|
+
+++ +++ +++ +++
|
|
15
|
+
+++ +++* *++* +++
|
|
16
|
+
+++ ++++* +++* *++
|
|
17
|
+
+++ ++++++++++* +++*
|
|
18
|
+
+++ +++ ++++
|
|
19
|
+
+++ +++ ++++*
|
|
20
|
+
+++ ++++++++++++++
|
|
21
|
+
+++ +++ *+++++
|
|
22
|
+
+++ +++
|
|
23
|
+
+++ +++
|
|
24
|
+
*+* *++
|
|
25
|
+
|
|
26
|
+
@@@@@@ @ @ ++ ++ ++++++
|
|
27
|
+
@@ @@ @@@@ @@@@@ @@@@@ @@ @@ @@@@ @@@@+++ +++ +
|
|
28
|
+
@@ @@@ @@ @@ @@@ @ @@ @@ @ @ ++ + ++ + ++ ++
|
|
29
|
+
@@ @@ @@ @@@@ @@ @@ @@ @@ @ @ ++ ++ + ++ ++
|
|
30
|
+
@@ @@ @@@ @@@@ @@@ @ @@@ @@@ + + ++++
|
|
31
|
+
|
|
32
|
+
www.ProductMG.com
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const os = require("os");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
|
|
8
|
+
const binaryName =
|
|
9
|
+
os.platform() === "win32" ? "matrix-iptv.exe" : "matrix-iptv";
|
|
10
|
+
const binaryPath = path.join(__dirname, binaryName);
|
|
11
|
+
|
|
12
|
+
if (!fs.existsSync(binaryPath)) {
|
|
13
|
+
console.error("\n❌ Matrix IPTV binary not found.");
|
|
14
|
+
console.log(
|
|
15
|
+
"Please try reinstalling the package: npm install -g @officebeats/matrix-iptv-cli\n"
|
|
16
|
+
);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
21
|
+
stdio: "inherit",
|
|
22
|
+
windowsHide: false,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
child.on("error", (err) => {
|
|
26
|
+
console.error("Failed to start Matrix IPTV:", err);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
child.on("exit", (code) => {
|
|
31
|
+
process.exit(code || 0);
|
|
32
|
+
});
|
package/index.html
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>IPTV CLI Web</title>
|
|
7
|
+
<style>
|
|
8
|
+
body {
|
|
9
|
+
background-color: #0d0d0d;
|
|
10
|
+
color: #ccc;
|
|
11
|
+
font-family: 'Courier New', Courier, monospace;
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
height: 100vh;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
#terminal-container {
|
|
20
|
+
border: 2px solid #555;
|
|
21
|
+
padding: 10px;
|
|
22
|
+
background: #000;
|
|
23
|
+
box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
|
|
24
|
+
}
|
|
25
|
+
pre {
|
|
26
|
+
margin: 0;
|
|
27
|
+
font-size: 14px;
|
|
28
|
+
line-height: 14px;
|
|
29
|
+
}
|
|
30
|
+
.controls {
|
|
31
|
+
position: absolute;
|
|
32
|
+
bottom: 10px;
|
|
33
|
+
color: #666;
|
|
34
|
+
font-size: 12px;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
37
|
+
</head>
|
|
38
|
+
<body>
|
|
39
|
+
<div id="terminal-container">
|
|
40
|
+
<pre id="terminal-output">Loading WebAssembly...</pre>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="controls">
|
|
43
|
+
Use Arrow Keys or j/k to navigate. Enter to select.
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<script type="module">
|
|
47
|
+
// Import init function and WasmClient class
|
|
48
|
+
// Note: The path depends on where wasm-pack outputs files. Usually ./pkg/
|
|
49
|
+
import init, { WasmClient } from './pkg/iptv_cli.js';
|
|
50
|
+
|
|
51
|
+
async function main() {
|
|
52
|
+
try {
|
|
53
|
+
await init();
|
|
54
|
+
console.log("Wasm initialized");
|
|
55
|
+
|
|
56
|
+
const client = new WasmClient();
|
|
57
|
+
const termOutput = document.getElementById('terminal-output');
|
|
58
|
+
|
|
59
|
+
function renderLoop() {
|
|
60
|
+
const output = client.draw();
|
|
61
|
+
termOutput.innerText = output;
|
|
62
|
+
requestAnimationFrame(renderLoop);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Initial render
|
|
66
|
+
renderLoop();
|
|
67
|
+
|
|
68
|
+
// Input handling
|
|
69
|
+
document.addEventListener('keydown', (e) => {
|
|
70
|
+
// Prevent default scrolling for arrow keys
|
|
71
|
+
if (["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Tab"].includes(e.key)) {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Filter out modifier keys alone
|
|
76
|
+
if (["Shift", "Control", "Alt", "Meta"].includes(e.key)) return;
|
|
77
|
+
|
|
78
|
+
client.handle_key(e.key);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
} catch (err) {
|
|
82
|
+
console.error("Failed to start Wasm:", err);
|
|
83
|
+
document.getElementById('terminal-output').innerText = "Error loading Wasm:\n" + err;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
main();
|
|
88
|
+
</script>
|
|
89
|
+
</body>
|
|
90
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@officebeats/matrix-iptv-cli",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "The premium Terminal IPTV Decoder",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"matrix-iptv": "./bin/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "node scripts/install-binary.js"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"iptv",
|
|
14
|
+
"cli",
|
|
15
|
+
"tui",
|
|
16
|
+
"matrix",
|
|
17
|
+
"sports",
|
|
18
|
+
"xtream"
|
|
19
|
+
],
|
|
20
|
+
"author": "Beats",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"axios": "^1.6.2",
|
|
24
|
+
"cli-progress": "^3.12.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const https = require("https");
|
|
4
|
+
const os = require("os");
|
|
5
|
+
|
|
6
|
+
const binaryName =
|
|
7
|
+
os.platform() === "win32" ? "matrix-iptv.exe" : "matrix-iptv";
|
|
8
|
+
const binDir = path.join(__dirname, "..", "bin");
|
|
9
|
+
const binaryPath = path.join(binDir, binaryName);
|
|
10
|
+
|
|
11
|
+
const platformMap = {
|
|
12
|
+
win32: "windows.exe",
|
|
13
|
+
linux: "linux",
|
|
14
|
+
darwin: "macos",
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const archMap = {
|
|
18
|
+
x64: "x64",
|
|
19
|
+
arm64: "arm64",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const platform = platformMap[os.platform()];
|
|
23
|
+
if (!platform) {
|
|
24
|
+
console.error(`Unsupported platform: ${os.platform()}`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Note: Re-using the naming convention from install.ps1
|
|
29
|
+
// https://github.com/officebeats/matrix-iptv/releases/latest/download/matrix-iptv-windows.exe
|
|
30
|
+
const releaseUrl = `https://github.com/officebeats/matrix-iptv/releases/latest/download/matrix-iptv-${platform}`;
|
|
31
|
+
|
|
32
|
+
console.log(`[*] Matrix IPTV CLI // One-Click Install`);
|
|
33
|
+
console.log(`[*] Platform: ${os.platform()} (${os.arch()})`);
|
|
34
|
+
console.log(`[*] Downloading: ${releaseUrl}`);
|
|
35
|
+
|
|
36
|
+
if (!fs.existsSync(binDir)) {
|
|
37
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function download(url, dest) {
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
const file = fs.createWriteStream(dest);
|
|
43
|
+
https
|
|
44
|
+
.get(url, (response) => {
|
|
45
|
+
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
46
|
+
// Handle Redirect
|
|
47
|
+
download(response.headers.location, dest).then(resolve).catch(reject);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (response.statusCode !== 200) {
|
|
51
|
+
reject(new Error(`Failed to download: ${response.statusCode}`));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
response.pipe(file);
|
|
55
|
+
file.on("finish", () => {
|
|
56
|
+
file.close();
|
|
57
|
+
resolve();
|
|
58
|
+
});
|
|
59
|
+
})
|
|
60
|
+
.on("error", (err) => {
|
|
61
|
+
fs.unlink(dest, () => {});
|
|
62
|
+
reject(err);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
download(releaseUrl, binaryPath)
|
|
68
|
+
.then(() => {
|
|
69
|
+
console.log(`[+] Download complete.`);
|
|
70
|
+
if (os.platform() !== "win32") {
|
|
71
|
+
fs.chmodSync(binaryPath, "755");
|
|
72
|
+
console.log(`[+] Executable permissions set.`);
|
|
73
|
+
}
|
|
74
|
+
console.log(`\n✅ Matrix IPTV CLI is ready.`);
|
|
75
|
+
console.log(`Type 'matrix-iptv' to start.`);
|
|
76
|
+
})
|
|
77
|
+
.catch((err) => {
|
|
78
|
+
console.error(`\n❌ Installation failed: ${err.message}`);
|
|
79
|
+
console.log(
|
|
80
|
+
`Please ensure the GitHub repository is public and has a 'latest' release.`
|
|
81
|
+
);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
});
|
package/test_config.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"accounts": [
|
|
3
|
+
{
|
|
4
|
+
"name": "Strong 8K",
|
|
5
|
+
"base_url": "http://pledge78502.cdn-akm.me:80",
|
|
6
|
+
"username": "7c34d33c9e21",
|
|
7
|
+
"password": "037dacb169",
|
|
8
|
+
"epg_url": null,
|
|
9
|
+
"last_refreshed": null,
|
|
10
|
+
"total_channels": null,
|
|
11
|
+
"total_movies": null,
|
|
12
|
+
"total_series": null,
|
|
13
|
+
"server_timezone": null
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "Trex",
|
|
17
|
+
"base_url": "http://line.offcial-trex.pro",
|
|
18
|
+
"username": "3a6aae52fb",
|
|
19
|
+
"password": "39c165888139",
|
|
20
|
+
"epg_url": null,
|
|
21
|
+
"last_refreshed": null,
|
|
22
|
+
"total_channels": null,
|
|
23
|
+
"total_movies": null,
|
|
24
|
+
"total_series": null,
|
|
25
|
+
"server_timezone": null
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "Premium Mega 4k FHD",
|
|
29
|
+
"base_url": "http://smarters.live:80",
|
|
30
|
+
"username": "ZPY7BP5A",
|
|
31
|
+
"password": "ZX2JVDNQ",
|
|
32
|
+
"epg_url": null,
|
|
33
|
+
"last_refreshed": null,
|
|
34
|
+
"total_channels": null,
|
|
35
|
+
"total_movies": null,
|
|
36
|
+
"total_series": null,
|
|
37
|
+
"server_timezone": null
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "Promax 4k OTT",
|
|
41
|
+
"base_url": "http://line.queen-4k.cc/",
|
|
42
|
+
"username": "11D246",
|
|
43
|
+
"password": "41D1C5",
|
|
44
|
+
"epg_url": null,
|
|
45
|
+
"last_refreshed": null,
|
|
46
|
+
"total_channels": null,
|
|
47
|
+
"total_movies": null,
|
|
48
|
+
"total_series": null,
|
|
49
|
+
"server_timezone": null
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "Mega OTT 1",
|
|
53
|
+
"base_url": "http://line.4smart.in",
|
|
54
|
+
"username": "45Z88W6",
|
|
55
|
+
"password": "Z7PHTX3",
|
|
56
|
+
"epg_url": null,
|
|
57
|
+
"last_refreshed": null,
|
|
58
|
+
"total_channels": null,
|
|
59
|
+
"total_movies": null,
|
|
60
|
+
"total_series": null,
|
|
61
|
+
"server_timezone": null
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "Mega OTT 2",
|
|
65
|
+
"base_url": "http://pwwkvdbn.qastertv.xyz",
|
|
66
|
+
"username": "CZ2FWXLS",
|
|
67
|
+
"password": "AQ9CFKL6",
|
|
68
|
+
"epg_url": null,
|
|
69
|
+
"last_refreshed": null,
|
|
70
|
+
"total_channels": null,
|
|
71
|
+
"total_movies": null,
|
|
72
|
+
"total_series": null,
|
|
73
|
+
"server_timezone": null
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"last_used_account_index": null,
|
|
77
|
+
"favorites": {
|
|
78
|
+
"categories": [],
|
|
79
|
+
"streams": [],
|
|
80
|
+
"vod_categories": [],
|
|
81
|
+
"vod_streams": []
|
|
82
|
+
},
|
|
83
|
+
"timezone": null,
|
|
84
|
+
"american_mode": true
|
|
85
|
+
}
|