@lzwme/m3u8-dl 1.5.0 → 1.6.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/README.MD +445 -71
- package/README.zh-CN.md +580 -0
- package/cjs/cli.js +37 -24
- package/cjs/i18n/locales/en.d.ts +108 -0
- package/cjs/i18n/locales/en.js +109 -0
- package/cjs/i18n/locales/zh-CN.d.ts +108 -0
- package/cjs/i18n/locales/zh-CN.js +109 -0
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/lib/file-download.js +8 -5
- package/cjs/lib/format-options.js +27 -4
- package/cjs/lib/getM3u8Urls.d.ts +6 -0
- package/cjs/lib/getM3u8Urls.js +45 -27
- package/cjs/lib/i18n.d.ts +27 -0
- package/cjs/lib/i18n.js +108 -0
- package/cjs/lib/m3u8-convert.js +2 -7
- package/cjs/lib/m3u8-download.js +36 -15
- package/cjs/lib/utils.js +4 -4
- package/cjs/server/download-server.d.ts +1 -0
- package/cjs/server/download-server.js +112 -39
- package/cjs/types/index.d.ts +1 -1
- package/cjs/types/index.js +1 -1
- package/cjs/types/m3u8.d.ts +4 -2
- package/client/assets/main-ChJ1yjNN.css +1 -0
- package/client/assets/main-DZTEqg-V.js +29 -0
- package/client/index.html +5 -1145
- package/client/m3u8-capture.user.js +94 -0
- package/client/play.html +223 -16
- package/package.json +34 -21
- package/client/style.css +0 -137
package/README.MD
CHANGED
|
@@ -12,137 +12,366 @@
|
|
|
12
12
|
[![GitHub forks][forks-badge]][forks-url]
|
|
13
13
|
[![GitHub stars][stars-badge]][stars-url]
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
> **Language**: [English](README.md) | [中文简体](README.zh-CN.MD)
|
|
16
|
+
|
|
17
|
+
A free, open-source, and powerful m3u8 video batch downloader with multi-threaded downloading, play-while-downloading, WebUI management, video parsing, and more. Supports multiple usage methods including CLI command line, browser, PC client, Docker deployment, and Node.js API calls.
|
|
18
|
+
|
|
19
|
+
## ✨ Features
|
|
20
|
+
|
|
21
|
+
### 🚀 Core Download Features
|
|
22
|
+
|
|
23
|
+
- **Multi-threaded Downloading**: Uses thread pool mode with customizable thread count, significantly improving download speed
|
|
24
|
+
- **Play-While-Downloading Mode**: Supports online playback using downloaded ts cache files without waiting for complete download
|
|
25
|
+
- **Batch Downloading**: Supports batch downloading of multiple m3u8 addresses, supports batch import from text files
|
|
26
|
+
- **Resume from Cache**: Failed downloads retain cache, retries only download failed segments, saving bandwidth and time
|
|
27
|
+
- **AES Encryption Support**: Automatically identifies and decrypts common AES-128 encrypted video streams
|
|
28
|
+
- **Format Conversion**: Automatically merges and converts downloaded ts segments to mp4 format (requires [ffmpeg](https://ffmpeg.org/download.html))
|
|
29
|
+
- **Multi-format Support**: Supports downloading video files in mp4, mkv, and other formats
|
|
30
|
+
- **Segment Filtering**: Supports ignoring video segments in specified time ranges (e.g., skip intro and outro)
|
|
31
|
+
|
|
32
|
+
### 🌐 WebUI Download Management
|
|
33
|
+
|
|
34
|
+
- **Modern Interface**: Modern web interface built with Vue 3 + TypeScript
|
|
35
|
+
- **Real-time Progress**: Real-time display of download progress and status via WebSocket
|
|
36
|
+
- **Task Management**: Supports pausing, resuming, and deleting download tasks, supports batch operations
|
|
37
|
+
- **Download Center**: Centralized management of all download tasks, supports search and filtering
|
|
38
|
+
- **Configuration Management**: Visual configuration of download parameters (thread count, save directory, etc.)
|
|
39
|
+
- **Access Control**: Supports setting access password (token) to protect the service
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
### 🎬 Video Parsing Features
|
|
44
|
+
|
|
45
|
+
- **Multi-platform Support**: Supports parsing video sharing links from platforms like Douyin, Weibo, Pipixia, etc.
|
|
46
|
+
- **Watermark-free Download**: Automatically extracts watermark-free video addresses and downloads
|
|
47
|
+
- **Smart Recognition**: Automatically recognizes video platforms and selects appropriate parsers
|
|
48
|
+
|
|
49
|
+
### 🔍 Smart m3u8 Address Extraction
|
|
50
|
+
|
|
51
|
+
- **Web Page Extraction**: Supports automatic extraction of m3u8 addresses from video playback pages
|
|
52
|
+
- **Deep Search**: Supports multi-level page search, automatically discovers video links
|
|
53
|
+
- **Batch Extraction**: Extract multiple video links at once, supports batch downloading
|
|
54
|
+
|
|
55
|
+

|
|
56
|
+
|
|
57
|
+
### 🎯 Browser Userscript Capture Tool
|
|
58
|
+
|
|
59
|
+
- **Auto Capture**: Automatically intercepts and captures m3u8 and mp4 video links in web pages
|
|
60
|
+
- **Real-time Monitoring**: Monitors network requests (XMLHttpRequest, fetch, Performance API), automatically discovers video links
|
|
61
|
+
- **Smart Recognition**: Automatically recognizes video types (M3U8/MP4) and extracts video names
|
|
62
|
+
- **One-click Jump**: Supports one-click jump to m3u8-dl WebUI for downloading
|
|
63
|
+
- **Flexible Configuration**: Supports configuring exclusion URL rules to avoid capturing on specific pages
|
|
64
|
+
- **Draggable Panel**: Supports dragging to move panel position, automatically saves position
|
|
65
|
+
- **Link Management**: Supports copying links, clearing list, and other operations
|
|
66
|
+
|
|
67
|
+
> This is a Tampermonkey/Greasemonkey userscript that can automatically capture video links in browsers, working with m3u8-dl WebUI to provide a seamless download experience.
|
|
68
|
+
|
|
69
|
+
### 📺 Video Search Features
|
|
70
|
+
|
|
71
|
+
- **Collection Site Support**: Supports standard collection site APIs, search and download through command-line interaction
|
|
72
|
+
- **Cache Mechanism**: Automatically caches search history, supports continuing unfinished downloads
|
|
16
73
|
|
|
17
74
|

|
|
18
75
|
|
|
19
|
-
|
|
76
|
+
### ▶️ Video Playback
|
|
77
|
+
|
|
78
|
+
- **Built-in Player**: Both WebUI and desktop client have built-in lightweight video players, can directly play downloaded or downloading videos online without waiting for completion.
|
|
79
|
+
- **Play-While-Downloading**: Supports automatic splicing of ts cache segments, can play while downloading, achieving "download and watch" experience.
|
|
80
|
+
- **Multi-format Support**: Player supports playback of mainstream video formats like mp4, ts, with drag, speed control, fullscreen, picture-in-picture, and other operations.
|
|
81
|
+
- **History**: Automatically records playback progress, supports resume playback, convenient for long video series watching.
|
|
82
|
+
|
|
83
|
+
> No need to rely on third-party players, you can directly watch downloaded content in the browser or client, improving convenience.
|
|
84
|
+
|
|
85
|
+

|
|
86
|
+
|
|
87
|
+
### 💻 Multiple Usage Methods
|
|
88
|
+
|
|
89
|
+
- **Command Line Tool**: Provides complete CLI commands with various parameter configurations
|
|
90
|
+
- **Node.js API**: Provides programming interface for easy integration into other projects
|
|
91
|
+
- **Web Service**: Supports starting as a web service, manage downloads through browser
|
|
92
|
+
- **Docker Deployment**: Provides Docker image for one-click deployment to server
|
|
93
|
+
- **Electron Desktop App**: Supports packaging as desktop application with built-in browser functionality
|
|
20
94
|
|
|
21
|
-
|
|
22
|
-
- `边下边播模式`。支持使用已下载的 ts 缓存文件在线播放。
|
|
23
|
-
- 支持指定多个 m3u8 地址批量下载。
|
|
24
|
-
- 支持缓存续传。下载失败会保留缓存,重试时只下载失败的片段。
|
|
25
|
-
- 支持常见的 AES 加密视频流解密。
|
|
26
|
-
- 自动转换为 mp4。**需全局安装 [ffmpeg](https://ffmpeg.org/download.html)**
|
|
27
|
-
- 支持指定采集站标准 API,以命令行交互的方式搜索和下载。
|
|
28
|
-
- `[NEW!]` 新增下载中心,支持启动为 webui 服务方式进行下载管理。
|
|
29
|
-
- `[NEW!]` 新增支持抖音、微博视频分享地址解析及无水印下载。
|
|
95
|
+
### 🌍 Internationalization Support
|
|
30
96
|
|
|
31
|
-
|
|
97
|
+
- Supports Chinese and English multi-language
|
|
98
|
+
- Both command line and WebUI support language switching
|
|
99
|
+
|
|
100
|
+
## 📦 Installation
|
|
101
|
+
|
|
102
|
+
**Method 1: Global Installation with Node.js**
|
|
103
|
+
|
|
104
|
+
Use as a CLI command-line tool.
|
|
32
105
|
|
|
33
106
|
```bash
|
|
34
107
|
npm i -g @lzwme/m3u8-dl
|
|
35
108
|
m3u8dl -h
|
|
36
109
|
```
|
|
37
110
|
|
|
38
|
-
|
|
111
|
+
Or use `npx` to run directly:
|
|
39
112
|
|
|
40
113
|
```bash
|
|
41
114
|
npx @lzwme/m3u8-dl -h
|
|
42
115
|
```
|
|
43
116
|
|
|
44
|
-
|
|
117
|
+
**Method 2: Desktop Application Download**
|
|
118
|
+
|
|
119
|
+
Install as a PC client. Easy to use, suitable for most regular users, with built-in browser functionality to automatically extract video addresses. Download the latest version from one of the following addresses:
|
|
120
|
+
|
|
121
|
+
- [https://m3u8-player.lzw.me/download.html](https://m3u8-player.lzw.me/download.html)
|
|
122
|
+
- [https://github.com/lzwme/m3u8-dl/releases](https://github.com/lzwme/m3u8-dl/releases)
|
|
123
|
+
|
|
124
|
+
## 📖 Usage Guide
|
|
125
|
+
|
|
126
|
+
> **Tip**: If you need to download and convert to `mp4` video format, you need to globally install [ffmpeg](https://ffmpeg.org/download.html).
|
|
127
|
+
> Or use the `--ffmpeg-path` parameter to specify the path to ffmpeg.
|
|
45
128
|
|
|
46
|
-
|
|
129
|
+
### Using as CLI Command Line Tool
|
|
47
130
|
|
|
48
|
-
|
|
131
|
+
View all available commands and options:
|
|
49
132
|
|
|
50
133
|
```bash
|
|
51
134
|
m3u8dl --help
|
|
52
135
|
```
|
|
53
136
|
|
|
54
|
-
####
|
|
137
|
+
#### Basic Download
|
|
55
138
|
|
|
56
139
|
```bash
|
|
57
|
-
|
|
140
|
+
# Download a single m3u8 file
|
|
141
|
+
m3u8dl https://example.com/video.m3u8
|
|
142
|
+
|
|
143
|
+
# Specify filename and save directory
|
|
144
|
+
m3u8dl https://example.com/video.m3u8 --filename "My Video" --save-dir "./downloads"
|
|
145
|
+
|
|
146
|
+
# Enable play-while-downloading mode
|
|
147
|
+
m3u8dl https://example.com/video.m3u8 --play
|
|
148
|
+
|
|
149
|
+
# Set thread count (default 4)
|
|
150
|
+
m3u8dl https://example.com/video.m3u8 --thread-num 8
|
|
151
|
+
|
|
152
|
+
# Don't convert to mp4 (only download ts segments)
|
|
153
|
+
m3u8dl https://example.com/video.m3u8 --no-convert
|
|
154
|
+
|
|
155
|
+
# Ignore specified time segments (e.g., skip first 30 seconds and last 60 seconds)
|
|
156
|
+
m3u8dl https://example.com/video.m3u8 --ignore-segments "0-30,END-60"
|
|
58
157
|
```
|
|
59
158
|
|
|
60
|
-
####
|
|
159
|
+
#### Batch Download
|
|
160
|
+
|
|
161
|
+
**Method 1: Command Line Parameters**
|
|
61
162
|
|
|
62
163
|
```bash
|
|
63
|
-
#
|
|
64
|
-
m3u8dl "
|
|
164
|
+
# Download multiple files, use | to separate filename and URL
|
|
165
|
+
m3u8dl "Episode 1|https://example.com/ep1.m3u8" "Episode 2|https://example.com/ep2.m3u8" --filename "Series Name"
|
|
65
166
|
```
|
|
66
167
|
|
|
67
|
-
|
|
168
|
+
**Method 2: Batch Import from Text File**
|
|
68
169
|
|
|
69
|
-
|
|
170
|
+
Create a `series-list.txt` file with the following format (use `$` to separate filename and URL):
|
|
70
171
|
|
|
71
172
|
```txt
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
173
|
+
Episode 1$https://example.com/ep1.m3u8
|
|
174
|
+
Episode 2$https://example.com/ep2.m3u8
|
|
175
|
+
Episode 3$https://example.com/ep3.m3u8
|
|
75
176
|
```
|
|
76
177
|
|
|
77
|
-
|
|
178
|
+
Then execute:
|
|
78
179
|
|
|
79
180
|
```bash
|
|
80
|
-
m3u8dl
|
|
181
|
+
m3u8dl series-list.txt --filename "Series Name"
|
|
81
182
|
```
|
|
82
183
|
|
|
83
|
-
|
|
184
|
+
#### Video Parsing Download
|
|
84
185
|
|
|
85
|
-
|
|
186
|
+
Supports sharing links from platforms like Douyin, Weibo, etc.:
|
|
86
187
|
|
|
87
188
|
```bash
|
|
88
|
-
|
|
189
|
+
# Douyin video sharing link
|
|
190
|
+
m3u8dl "https://v.douyin.com/xxxxx/" --type parser
|
|
89
191
|
|
|
90
|
-
#
|
|
91
|
-
m3u8dl
|
|
192
|
+
# Weibo video sharing link
|
|
193
|
+
m3u8dl "https://weibo.com/xxxxx" --type parser
|
|
92
194
|
```
|
|
93
195
|
|
|
94
|
-
|
|
196
|
+
#### Extract m3u8 Address from Web Page
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
# Automatically extract m3u8 address from video playback page and download
|
|
200
|
+
m3u8dl "https://example.com/play/12345" --type web
|
|
201
|
+
```
|
|
95
202
|
|
|
96
|
-
|
|
203
|
+
#### Video Search Download
|
|
97
204
|
|
|
98
205
|
```bash
|
|
99
|
-
#
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
206
|
+
# View search command help
|
|
207
|
+
m3u8dl search --help
|
|
208
|
+
|
|
209
|
+
# Specify collection site API and search download (will cache API address)
|
|
210
|
+
m3u8dl search -u https://api.example.com/provide/vod/
|
|
211
|
+
|
|
212
|
+
# Search keyword directly
|
|
213
|
+
m3u8dl search "keyword" -u https://api.example.com/provide/vod/
|
|
103
214
|
```
|
|
104
215
|
|
|
105
|
-
|
|
216
|
+
> **Disclaimer**: The above are examples only. Please search for available collection site APIs yourself. This tool is only for technical research and learning purposes and does not provide any specific resource information.
|
|
106
217
|
|
|
107
|
-
|
|
218
|
+
#### Common Command Line Options
|
|
108
219
|
|
|
109
|
-
|
|
220
|
+
| Option | Description |
|
|
221
|
+
|--------|-------------|
|
|
222
|
+
| `-f, --filename <name>` | Specify filename |
|
|
223
|
+
| `-n, --thread-num <number>` | Set download thread count (default 4) |
|
|
224
|
+
| `-p, --play` | Enable play-while-downloading mode |
|
|
225
|
+
| `-C, --cache-dir <dirpath>` | Specify cache directory |
|
|
226
|
+
| `-S, --save-dir <dirpath>` | Specify save directory |
|
|
227
|
+
| `--no-convert` | Don't convert to mp4 |
|
|
228
|
+
| `--no-del-cache` | Don't delete cache after download completes |
|
|
229
|
+
| `--ffmpeg-path <path>` | Specify ffmpeg path |
|
|
230
|
+
| `-H, --headers <headers>` | Set request headers (JSON format) |
|
|
231
|
+
| `-I, --ignore-segments <time>` | Ignore specified time segments |
|
|
232
|
+
| `--debug` | Enable debug mode |
|
|
233
|
+
| `--lang <lang>` | Set language (zh-CN/en) |
|
|
110
234
|
|
|
111
|
-
|
|
112
|
-
|
|
235
|
+
### WebUI Download Management
|
|
236
|
+
|
|
237
|
+
Start web service to manage download tasks through browser:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
# Start service (default port 6600)
|
|
241
|
+
m3u8dl server
|
|
242
|
+
|
|
243
|
+
# Specify port and access password
|
|
244
|
+
m3u8dl server -p 8080 -t "your-secret-token"
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
After starting, visit `http://localhost:6600` in your browser to use WebUI.
|
|
248
|
+
|
|
249
|
+
**WebUI Main Features:**
|
|
250
|
+
|
|
251
|
+
- 📥 Create download tasks (supports m3u8 links, Weibo and Pipixia video sharing links, video playback page extraction)
|
|
252
|
+
- 📊 View download progress and speed in real-time
|
|
253
|
+
- ⏸️ Pause/Resume download tasks
|
|
254
|
+
- 🗑️ Delete tasks and downloaded files
|
|
255
|
+
- ⚙️ Configure download parameters (thread count, save directory, etc.)
|
|
256
|
+
- 🔍 Search and filter tasks
|
|
257
|
+
- 📁 View completed downloads
|
|
258
|
+
|
|
259
|
+
**Environment Variable Configuration:**
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
# Set port
|
|
263
|
+
export DS_PORT=6600
|
|
264
|
+
|
|
265
|
+
# Set access password
|
|
266
|
+
export DS_SECRET=your-secret-token
|
|
267
|
+
|
|
268
|
+
# Set save directory
|
|
269
|
+
export DS_SAVE_DIR=./downloads
|
|
270
|
+
|
|
271
|
+
# Set cache directory
|
|
272
|
+
export DS_CACHE_DIR=./cache
|
|
273
|
+
|
|
274
|
+
# Set ffmpeg path
|
|
275
|
+
export DS_FFMPEG_PATH=/usr/local/bin/ffmpeg
|
|
276
|
+
|
|
277
|
+
# Enable debug mode
|
|
278
|
+
export DS_DEBUG=1
|
|
113
279
|
|
|
114
|
-
|
|
115
|
-
|
|
280
|
+
# Limit file access (only allow access to download and cache directories)
|
|
281
|
+
export DS_LIMTE_FILE_ACCESS=1
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Integration as Node.js API
|
|
285
|
+
|
|
286
|
+
Call related APIs in your project. Code examples:
|
|
287
|
+
|
|
288
|
+
```ts
|
|
289
|
+
import { m3u8Download, m3u8BatchDownload, VideoParser, getM3u8Urls } from '@lzwme/m3u8-dl';
|
|
290
|
+
|
|
291
|
+
// Example 1: Single file download
|
|
292
|
+
const result = await m3u8Download('https://example.com/video.m3u8', {
|
|
293
|
+
filename: 'My Video',
|
|
294
|
+
saveDir: './downloads',
|
|
295
|
+
threadNum: 8,
|
|
296
|
+
debug: true,
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
if (result.errmsg) {
|
|
300
|
+
console.error('Download failed:', result.errmsg);
|
|
301
|
+
} else {
|
|
302
|
+
console.log('Download successful:', result.filepath);
|
|
303
|
+
}
|
|
116
304
|
|
|
117
|
-
//
|
|
118
|
-
const fileList = [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
305
|
+
// Example 2: Batch download
|
|
306
|
+
const fileList = [
|
|
307
|
+
'Episode 1$https://example.com/ep1.m3u8',
|
|
308
|
+
'Episode 2$https://example.com/ep2.m3u8',
|
|
309
|
+
];
|
|
310
|
+
await m3u8BatchDownload(fileList, {
|
|
311
|
+
filename: 'Series Name',
|
|
312
|
+
threadNum: 4,
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
// Example 3: Video parsing download (Douyin, Weibo, etc.)
|
|
316
|
+
const parser = new VideoParser();
|
|
317
|
+
const parseResult = await parser.parse('https://v.douyin.com/xxxxx/');
|
|
318
|
+
if (parseResult.data) {
|
|
319
|
+
console.log('Video title:', parseResult.data.title);
|
|
320
|
+
console.log('Video URL:', parseResult.data.url);
|
|
321
|
+
|
|
322
|
+
// Download video
|
|
323
|
+
await parser.download('https://v.douyin.com/xxxxx/', {
|
|
324
|
+
filename: parseResult.data.title,
|
|
325
|
+
});
|
|
122
326
|
}
|
|
327
|
+
|
|
328
|
+
// Example 4: Extract m3u8 addresses from web page
|
|
329
|
+
const urls = await getM3u8Urls({
|
|
330
|
+
url: 'https://example.com/play/12345',
|
|
331
|
+
headers: {
|
|
332
|
+
'User-Agent': 'Mozilla/5.0...',
|
|
333
|
+
},
|
|
334
|
+
deep: 2, // Search depth
|
|
335
|
+
});
|
|
336
|
+
console.log('Extracted addresses:', Array.from(urls.keys()));
|
|
337
|
+
|
|
338
|
+
// Example 5: Specify ffmpeg path
|
|
339
|
+
import ffmpegStatic from 'ffmpeg-static';
|
|
340
|
+
m3u8Download('https://example.com/video.m3u8', {
|
|
341
|
+
filename: 'Test Video',
|
|
342
|
+
ffmpegPath: ffmpegStatic, // Use ffmpeg-static package. Suitable for scenarios where ffmpeg is not globally installed
|
|
343
|
+
// Or specify the absolute path of installed ffmpeg (if already in PATH environment variable, no need to specify)
|
|
344
|
+
// ffmpegPath: '/usr/local/bin/ffmpeg',
|
|
345
|
+
});
|
|
123
346
|
```
|
|
124
347
|
|
|
125
|
-
|
|
348
|
+
### Docker Deployment
|
|
126
349
|
|
|
127
|
-
|
|
350
|
+
#### Using Docker Command
|
|
128
351
|
|
|
129
352
|
```bash
|
|
130
|
-
#
|
|
353
|
+
# Pull image
|
|
131
354
|
docker pull renxia/m3u8dl-dl:latest
|
|
132
355
|
|
|
356
|
+
# Run container
|
|
133
357
|
docker run --rm -it \
|
|
134
358
|
-v ./cache:/app/cache \
|
|
135
359
|
-v ./downloads:/app/downloads \
|
|
136
360
|
-p 6600:6600 \
|
|
361
|
+
-e DS_PORT=6600 \
|
|
362
|
+
-e DS_SECRET=your-secret-token \
|
|
137
363
|
renxia/m3u8dl-dl:latest
|
|
138
364
|
```
|
|
139
365
|
|
|
140
|
-
|
|
366
|
+
#### Using Docker Compose
|
|
367
|
+
|
|
368
|
+
Create `docker-compose.yml` file:
|
|
141
369
|
|
|
142
370
|
```yml
|
|
143
371
|
services:
|
|
144
|
-
|
|
145
|
-
image: renxia/
|
|
372
|
+
m3u8-dl:
|
|
373
|
+
image: renxia/m3u8dl-dl:latest
|
|
374
|
+
container_name: m3u8-dl
|
|
146
375
|
volumes:
|
|
147
376
|
- ./downloads:/app/downloads
|
|
148
377
|
- ./cache:/app/cache
|
|
@@ -152,35 +381,180 @@ services:
|
|
|
152
381
|
DS_PORT: '6600'
|
|
153
382
|
DS_SAVE_DIR: '/app/downloads'
|
|
154
383
|
DS_CACHE_DIR: '/app/cache'
|
|
155
|
-
DS_SECRET: '' #
|
|
384
|
+
DS_SECRET: '' # Set access password
|
|
156
385
|
DS_DEBUG: ''
|
|
157
|
-
|
|
158
|
-
|
|
386
|
+
DS_FFMPEG_PATH: '' # Leave empty to use ffmpeg from system PATH
|
|
387
|
+
DS_LIMTE_FILE_ACCESS: '1' # Limit file access
|
|
159
388
|
restart: unless-stopped
|
|
160
389
|
```
|
|
161
390
|
|
|
162
|
-
|
|
391
|
+
Start service:
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
docker-compose up -d
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
After successful deployment, visit `http://your-server-ip:6600` in your browser to use.
|
|
398
|
+
|
|
399
|
+
> **Tip**: The Docker image already includes ffmpeg, no need for additional installation. The image also includes [AriaNg](https://github.com/mayswind/AriaNg) static resources.
|
|
400
|
+
|
|
401
|
+
### Electron Desktop Application
|
|
402
|
+
|
|
403
|
+
The project supports packaging as an Electron desktop application with richer features:
|
|
163
404
|
|
|
164
|
-
|
|
405
|
+
- 🖥️ Native desktop experience
|
|
406
|
+
- 🌐 Built-in browser, supports extracting video links from web pages
|
|
407
|
+
- 📱 System tray support
|
|
408
|
+
- 🔄 Auto-update functionality
|
|
165
409
|
|
|
166
|
-
|
|
410
|
+
Download the built application:
|
|
411
|
+
|
|
412
|
+
- https://m3u8-player.lzw.me/download.html
|
|
413
|
+
- https://github.com/lzwme/m3u8-dl/releases
|
|
414
|
+
|
|
415
|
+
### Browser Script Installation and Usage
|
|
416
|
+
|
|
417
|
+
**Installation Steps:**
|
|
418
|
+
|
|
419
|
+
1. Install browser extension (choose one):
|
|
420
|
+
- [Violentmonkey](https://violentmonkey.github.io/) (【Recommended】Open-source alternative)
|
|
421
|
+
- [Tampermonkey](https://www.tampermonkey.net/) (【Official】Supports Chrome, Firefox, Edge, Safari, etc.)
|
|
422
|
+
- [Greasemonkey](https://www.greasespot.net/) (Firefox only)
|
|
423
|
+
|
|
424
|
+
2. Install script:
|
|
425
|
+
- Open Tampermonkey management panel
|
|
426
|
+
- Click "Add new script"
|
|
427
|
+
- Copy content from `client/m3u8-capture.user.js` file
|
|
428
|
+
- Paste into editor and save
|
|
429
|
+
- Or directly visit the link in browser: [https://raw.githubusercontent.com/lzwme/m3u8-dl/refs/heads/main/client/m3u8-capture.user.js](https://raw.githubusercontent.com/lzwme/m3u8-dl/refs/heads/main/client/m3u8-capture.user.js)
|
|
430
|
+
|
|
431
|
+
3. Configure WebUI address:
|
|
432
|
+
- Visit any web page, click the 🎬 icon in the top right corner to open the capture panel
|
|
433
|
+
- Click the settings button ⚙️
|
|
434
|
+
- Enter your m3u8-dl WebUI address (e.g., `http://localhost:6600`)
|
|
435
|
+
- Save settings
|
|
436
|
+
|
|
437
|
+
**Feature Description:**
|
|
438
|
+
|
|
439
|
+
- **Auto Capture**: The script automatically monitors network requests in web pages, when m3u8 or mp4 video links are detected, automatically adds them to the list
|
|
440
|
+
- **Video Name Extraction**: Prioritizes extracting video names from page `h1`, `h2`, or `document.title`
|
|
441
|
+
- **Jump to Download**: Click the "Jump to Download" button to automatically jump to m3u8-dl WebUI and fill in video link and name (format: `url|name`)
|
|
442
|
+
- **Exclusion Rules**: In settings, you can configure exclusion URL rule list, matching URLs will not show panel and will not capture video links
|
|
443
|
+
- Supports plain string matching (contains match)
|
|
444
|
+
- Supports regular expressions (starts and ends with `/`, e.g., `/example\.com/`)
|
|
445
|
+
|
|
446
|
+
**Usage Example:**
|
|
447
|
+
|
|
448
|
+
1. Visit video playback page
|
|
449
|
+
2. Script automatically captures video links, displayed in the panel in the bottom right corner
|
|
450
|
+
3. Click "Jump to Download" button
|
|
451
|
+
4. Automatically jumps to m3u8-dl WebUI, video link and name are automatically filled
|
|
452
|
+
5. Click "Start Download" in WebUI
|
|
453
|
+
|
|
454
|
+
**Exclusion Rule Configuration Example:**
|
|
455
|
+
|
|
456
|
+
```
|
|
457
|
+
localhost:6600
|
|
458
|
+
127.0.0.1
|
|
459
|
+
/example\.com/
|
|
460
|
+
admin
|
|
461
|
+
```
|
|
167
462
|
|
|
168
|
-
|
|
463
|
+
> **Tip**: The script automatically excludes WebUI address pages to avoid capturing in WebUI pages. You can also manually add more exclusion rules.
|
|
464
|
+
|
|
465
|
+
## 🛠️ Tech Stack
|
|
466
|
+
|
|
467
|
+
- **Backend**: Node.js + TypeScript + Express + WebSocket
|
|
468
|
+
- **Frontend**: Vue 3 + TypeScript + Vite + Pinia + TailwindCSS
|
|
469
|
+
- **Desktop App**: Electron
|
|
470
|
+
- **Code Quality**: Biome (Linter & Formatter)
|
|
471
|
+
- **Build Tool**: TypeScript Compiler
|
|
472
|
+
|
|
473
|
+
## 💻 Development Guide
|
|
474
|
+
|
|
475
|
+
### Local Development
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
# Clone project
|
|
479
|
+
git clone https://github.com/lzwme/m3u8-dl.git
|
|
480
|
+
cd m3u8-dl
|
|
481
|
+
|
|
482
|
+
# Install dependencies
|
|
483
|
+
pnpm install
|
|
484
|
+
|
|
485
|
+
# Development mode (watch file changes and auto-compile)
|
|
486
|
+
pnpm dev
|
|
487
|
+
|
|
488
|
+
# Build project
|
|
489
|
+
pnpm build
|
|
490
|
+
|
|
491
|
+
# Code check
|
|
492
|
+
pnpm lint
|
|
493
|
+
|
|
494
|
+
# Code format
|
|
495
|
+
pnpm format
|
|
496
|
+
|
|
497
|
+
# Fix code issues
|
|
498
|
+
pnpm fix
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
Build desktop application:
|
|
169
502
|
|
|
170
503
|
```bash
|
|
171
|
-
|
|
504
|
+
# Enter application directory
|
|
505
|
+
cd packages/m3u8dl-app
|
|
506
|
+
|
|
507
|
+
# Install dependencies
|
|
172
508
|
pnpm install
|
|
509
|
+
|
|
510
|
+
# Run in development mode
|
|
173
511
|
pnpm dev
|
|
174
|
-
|
|
512
|
+
|
|
513
|
+
# Build application
|
|
514
|
+
pnpm build
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
### Project Structure
|
|
518
|
+
|
|
519
|
+
```
|
|
520
|
+
m3u8-dl/
|
|
521
|
+
├── src/ # Source code (TypeScript)
|
|
522
|
+
│ ├── cli.ts # Command line entry
|
|
523
|
+
│ ├── lib/ # Core library
|
|
524
|
+
│ ├── server/ # Web service
|
|
525
|
+
│ ├── video-parser/ # Video parser
|
|
526
|
+
│ └── types/ # Type definitions
|
|
527
|
+
├── packages/
|
|
528
|
+
│ ├── frontend/ # Vue 3 frontend project
|
|
529
|
+
│ ├── m3u8dl-app/ # Electron desktop application
|
|
530
|
+
│ └── m3u8-capture/ # Browser userscript (TypeScript + Vite)
|
|
531
|
+
├── cjs/ # Compiled CommonJS code
|
|
532
|
+
└── client/ # Frontend build output
|
|
533
|
+
└── m3u8-capture.user.js # Browser video address capture userscript (built from packages/m3u8-capture)
|
|
175
534
|
```
|
|
176
535
|
|
|
177
|
-
|
|
536
|
+
### Contributing
|
|
537
|
+
|
|
538
|
+
Welcome to submit Issues and Pull Requests!
|
|
539
|
+
|
|
540
|
+
1. [Fork](https://github.com/lzwme/m3u8-dl/fork) this project
|
|
541
|
+
2. Create feature branch (`git checkout -b feature/AmazingFeature`)
|
|
542
|
+
3. Commit changes (`git commit -m 'Add some AmazingFeature'`)
|
|
543
|
+
4. Push to branch (`git push origin feature/AmazingFeature`)
|
|
544
|
+
5. Open Pull Request
|
|
545
|
+
|
|
546
|
+
**Welcome to contribute ideas and code!** 🎉
|
|
547
|
+
|
|
548
|
+
## 📚 Related Resources
|
|
549
|
+
|
|
550
|
+
- [ffmpeg Download](https://ffmpeg.org/download.html) - Video processing tool
|
|
551
|
+
- [m3u8 Format Specification](https://en.wikipedia.org/wiki/M3U) - M3U8 playlist format
|
|
552
|
+
- [Project Changelog](./CHANGELOG.md) - View version update history
|
|
178
553
|
|
|
179
|
-
|
|
554
|
+
## 🙏 Acknowledgments
|
|
180
555
|
|
|
181
|
-
|
|
556
|
+
Thanks to the following projects for inspiration and reference:
|
|
182
557
|
|
|
183
|
-
- [ffmpeg download](https://ffmpeg.org/download.html)
|
|
184
558
|
- [m3u8-multi-thread-downloader](https://github.com/sahadev/m3u8Downloader)
|
|
185
559
|
- [m3u8Utils](https://github.com/liupishui/m3u8Utils)
|
|
186
560
|
|
|
@@ -188,7 +562,7 @@ pnpm dev
|
|
|
188
562
|
|
|
189
563
|
`@lzwme/m3u8-dl` is released under the MIT license.
|
|
190
564
|
|
|
191
|
-
|
|
565
|
+
This plugin is developed and maintained by [Zhiwen Studio](https://lzw.me).
|
|
192
566
|
|
|
193
567
|
[stars-badge]: https://img.shields.io/github/stars/lzwme/m3u8-dl.svg
|
|
194
568
|
[stars-url]: https://github.com/lzwme/m3u8-dl/stargazers
|