tphim 1.0.0 → 1.0.2
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/README.md +47 -23
- package/index.js +11 -2
- package/package.json +10 -3
- package/pro-terminal.mjs +14 -0
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# 💎
|
|
1
|
+
# 💎 TPHIM - Ultimate Video Pipeline
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**TPHIM** là bộ công cụ tối thượng để xây dựng hệ thống VOD (Video on Demand) chuyên nghiệp. Hỗ trợ tự động hóa từ khâu tải video, transcode HLS đa chất lượng, tạo phụ đề AI và upload lên Cloud (S3/Tebi).
|
|
4
4
|
|
|
5
5
|
## 🚀 Tính năng vượt trội
|
|
6
6
|
- **Batch Pipeline:** Xử lý hàng loạt phim chỉ với 1 dòng lệnh.
|
|
7
7
|
- **AI Subtitles:** Tự động tạo phụ đề Tiếng Việt/Tiếng Anh bằng công cụ AI (Whisper) chạy offline.
|
|
8
|
-
- **Neon Hybrid Player:** Trình phát V5 hỗ trợ tận răng cho cả Desktop và Mobile với cử chỉ vuốt cực xịn.
|
|
9
8
|
- **Cloud Ready:** Upload trực tiếp lên Tebi.io hoặc bất kỳ S3-compatible storage nào.
|
|
9
|
+
- **Interactive CLI:** Giao diện terminal đẹp mắt với neon theme.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -48,7 +48,7 @@ Bạn hoàn toàn có thể chạy Pipeline này ngay trên điện thoại:
|
|
|
48
48
|
pkg update && pkg upgrade
|
|
49
49
|
pkg install nodejs ffmpeg python python-pip wget
|
|
50
50
|
```
|
|
51
|
-
2. **Cài đặt yt-dlp:**
|
|
51
|
+
2. **Cài đặt yt-dlp:**(không nhất thiết phải cài)
|
|
52
52
|
```bash
|
|
53
53
|
pip install yt-dlp
|
|
54
54
|
```
|
|
@@ -61,14 +61,14 @@ Bạn hoàn toàn có thể chạy Pipeline này ngay trên điện thoại:
|
|
|
61
61
|
|
|
62
62
|
Cài đặt vào dự án của bạn:
|
|
63
63
|
```bash
|
|
64
|
-
npm install
|
|
64
|
+
npm install tphim
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
Trong code Node.js:
|
|
68
68
|
```javascript
|
|
69
|
-
import {
|
|
69
|
+
import { executePipeline } from 'tphim';
|
|
70
70
|
|
|
71
|
-
await
|
|
71
|
+
await executePipeline({
|
|
72
72
|
input: "https://link-phim.com/phim.m3u8",
|
|
73
73
|
slug: "phim-hay-2030",
|
|
74
74
|
title: "Phim Hay 2030",
|
|
@@ -78,32 +78,56 @@ await runPipeline({
|
|
|
78
78
|
|
|
79
79
|
---
|
|
80
80
|
|
|
81
|
-
##
|
|
81
|
+
## ⌨️ Sử dụng CLI (Terminal)
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
### Cài đặt globally:
|
|
84
|
+
```bash
|
|
85
|
+
npm install -g tphim
|
|
86
|
+
```
|
|
85
87
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
### Các lệnh CLI:
|
|
89
|
+
```bash
|
|
90
|
+
# Xem hướng dẫn
|
|
91
|
+
ntxa help
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
# Chạy interactive mode
|
|
94
|
+
ntxa
|
|
95
|
+
|
|
96
|
+
# Chạy với tên phim mặc định
|
|
97
|
+
ntxa "Tên Phim Của Bạn"
|
|
91
98
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
99
|
+
# Xử lý batch nhiều link
|
|
100
|
+
ntxa
|
|
101
|
+
# (sẽ hỏi nhập nhiều link cách nhau bằng dấu phẩy)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Cấu hình bắt buộc:
|
|
105
|
+
Tạo file `.env` với các biến sau:
|
|
106
|
+
```env
|
|
107
|
+
TEBI_ENDPOINT=https://s3.tebi.io
|
|
108
|
+
TEBI_ACCESS_KEY_ID=your_access_key
|
|
109
|
+
TEBI_SECRET_ACCESS_KEY=your_secret_key
|
|
110
|
+
TEBI_BUCKET=your_bucket_name
|
|
111
|
+
TEBI_PUBLIC_URL=https://your-bucket.tebi.io
|
|
95
112
|
```
|
|
96
113
|
|
|
97
114
|
---
|
|
98
115
|
|
|
99
|
-
##
|
|
116
|
+
## 🔧 Tính năng CLI
|
|
100
117
|
|
|
101
|
-
|
|
118
|
+
**Interactive Mode:**
|
|
119
|
+
- Nhập multiple links (cách nhau bằng dấu phẩy)
|
|
120
|
+
- Tự động fetch metadata từ video
|
|
121
|
+
- Chọn ngôn ngữ phụ đề (VI/EN/Both)
|
|
122
|
+
- Batch processing với progress bar
|
|
102
123
|
|
|
124
|
+
**Help System:**
|
|
103
125
|
```bash
|
|
104
|
-
ntxa
|
|
105
|
-
#
|
|
106
|
-
ntxa
|
|
126
|
+
ntxa help # Hiển thị toàn bộ hướng dẫn
|
|
127
|
+
ntxa --help # Tương tự
|
|
128
|
+
ntxa -h # Tương tự
|
|
107
129
|
```
|
|
108
130
|
|
|
109
|
-
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
*Phát triển bởi TXA - Ultimate Video Pipeline 2030* 🍿🎬
|
package/index.js
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
// index.js
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* TPHIM - Ultimate Video Pipeline
|
|
4
4
|
* The ultimate video processing pipeline and player library
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { executePipeline } from './pipeline.mjs';
|
|
8
|
-
import { readFileSync } from 'fs';
|
|
8
|
+
import { readFileSync, copyFileSync, existsSync } from 'fs';
|
|
9
9
|
import { join, dirname } from 'path';
|
|
10
10
|
import { fileURLToPath } from 'url';
|
|
11
11
|
|
|
12
12
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
13
|
|
|
14
|
+
// Auto-copy .env.example to .env if .env doesn't exist
|
|
15
|
+
const envPath = join(__dirname, '.env');
|
|
16
|
+
const envExamplePath = join(__dirname, '.env.example');
|
|
17
|
+
|
|
18
|
+
if (!existsSync(envPath) && existsSync(envExamplePath)) {
|
|
19
|
+
copyFileSync(envExamplePath, envPath);
|
|
20
|
+
console.log('📄 Auto-copied .env.example to .env');
|
|
21
|
+
}
|
|
22
|
+
|
|
14
23
|
/**
|
|
15
24
|
* Node-side API: Run the full VOD pipeline.
|
|
16
25
|
* @param {Object} options - pipeline options { input, slug, title, langArg }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tphim",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "TPHIM - Ultimate Video Pipeline: Download, Transcode HLS, AI Subtitles, and Cloud Upload.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"author": {
|
|
28
28
|
"name": "TXA",
|
|
29
29
|
"email": "txafile@gmail.com",
|
|
30
|
-
"url": "https://nrotxa.online"
|
|
30
|
+
"url": "https://film.nrotxa.online"
|
|
31
31
|
},
|
|
32
32
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
33
33
|
"repository": {
|
|
@@ -48,5 +48,12 @@
|
|
|
48
48
|
"log-symbols": "^7.0.1",
|
|
49
49
|
"mime-types": "^3.0.2",
|
|
50
50
|
"ora": "^9.3.0"
|
|
51
|
+
},
|
|
52
|
+
"funding": {
|
|
53
|
+
"type": "individual",
|
|
54
|
+
"url": "https://film.nrotxa.online"
|
|
55
|
+
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=18.0.0"
|
|
51
58
|
}
|
|
52
|
-
}
|
|
59
|
+
}
|
package/pro-terminal.mjs
CHANGED
|
@@ -10,8 +10,22 @@ import figlet from 'figlet';
|
|
|
10
10
|
import ora from 'ora';
|
|
11
11
|
import { spawn } from 'child_process';
|
|
12
12
|
import { executePipeline } from './pipeline.mjs';
|
|
13
|
+
import { copyFileSync, existsSync } from 'fs';
|
|
14
|
+
import { join, dirname } from 'path';
|
|
15
|
+
import { fileURLToPath } from 'url';
|
|
13
16
|
import 'dotenv/config';
|
|
14
17
|
|
|
18
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
19
|
+
|
|
20
|
+
// Auto-copy .env.example to .env if .env doesn't exist
|
|
21
|
+
const envPath = join(__dirname, '.env');
|
|
22
|
+
const envExamplePath = join(__dirname, '.env.example');
|
|
23
|
+
|
|
24
|
+
if (!existsSync(envPath) && existsSync(envExamplePath)) {
|
|
25
|
+
copyFileSync(envExamplePath, envPath);
|
|
26
|
+
console.log(chalk.cyan('📄 Auto-copied .env.example to .env'));
|
|
27
|
+
}
|
|
28
|
+
|
|
15
29
|
// Color palette
|
|
16
30
|
const neonCyan = chalk.hex('#00f2ff');
|
|
17
31
|
const neonPurple = chalk.hex('#bc13fe');
|