@lynker-desktop/electron-sdk 0.0.9-alpha.7 → 0.0.9-alpha.72
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 +160 -1
- package/common/index.d.ts +96 -0
- package/common/index.d.ts.map +1 -1
- package/common/index.js.map +1 -1
- package/esm/common/index.d.ts +96 -0
- package/esm/common/index.d.ts.map +1 -1
- package/esm/common/index.js.map +1 -1
- package/esm/main/clipboard.d.ts +32 -0
- package/esm/main/clipboard.d.ts.map +1 -0
- package/esm/main/clipboard.js +1208 -0
- package/esm/main/clipboard.js.map +1 -0
- package/esm/main/downloader.d.ts +212 -0
- package/esm/main/downloader.d.ts.map +1 -0
- package/esm/main/downloader.js +674 -0
- package/esm/main/downloader.js.map +1 -0
- package/esm/main/index.d.ts +20 -67
- package/esm/main/index.d.ts.map +1 -1
- package/esm/main/index.js +51 -202
- package/esm/main/index.js.map +1 -1
- package/esm/main/resource-cache.d.ts +245 -0
- package/esm/main/resource-cache.d.ts.map +1 -0
- package/esm/main/resource-cache.js +857 -0
- package/esm/main/resource-cache.js.map +1 -0
- package/esm/main/shortcut.d.ts +14 -0
- package/esm/main/shortcut.d.ts.map +1 -0
- package/esm/main/shortcut.js +173 -0
- package/esm/main/shortcut.js.map +1 -0
- package/esm/main/store.d.ts +10 -0
- package/esm/main/store.d.ts.map +1 -0
- package/esm/main/store.js +62 -0
- package/esm/main/store.js.map +1 -0
- package/esm/main/video-downloader.d.ts +39 -0
- package/esm/main/video-downloader.d.ts.map +1 -0
- package/esm/main/video-downloader.js +505 -0
- package/esm/main/video-downloader.js.map +1 -0
- package/esm/preload/index.js +19 -1
- package/esm/preload/index.js.map +1 -1
- package/esm/renderer/index.d.ts +8 -0
- package/esm/renderer/index.d.ts.map +1 -1
- package/esm/renderer/index.js +25 -0
- package/esm/renderer/index.js.map +1 -1
- package/main/clipboard.d.ts +32 -0
- package/main/clipboard.d.ts.map +1 -0
- package/main/clipboard.js +1208 -0
- package/main/clipboard.js.map +1 -0
- package/main/downloader.d.ts +212 -0
- package/main/downloader.d.ts.map +1 -0
- package/main/downloader.js +674 -0
- package/main/downloader.js.map +1 -0
- package/main/index.d.ts +20 -67
- package/main/index.d.ts.map +1 -1
- package/main/index.js +54 -205
- package/main/index.js.map +1 -1
- package/main/resource-cache.d.ts +245 -0
- package/main/resource-cache.d.ts.map +1 -0
- package/main/resource-cache.js +857 -0
- package/main/resource-cache.js.map +1 -0
- package/main/shortcut.d.ts +14 -0
- package/main/shortcut.d.ts.map +1 -0
- package/main/shortcut.js +173 -0
- package/main/shortcut.js.map +1 -0
- package/main/store.d.ts +10 -0
- package/main/store.d.ts.map +1 -0
- package/main/store.js +64 -0
- package/main/store.js.map +1 -0
- package/main/video-downloader.d.ts +39 -0
- package/main/video-downloader.d.ts.map +1 -0
- package/main/video-downloader.js +510 -0
- package/main/video-downloader.js.map +1 -0
- package/package.json +9 -5
- package/preload/index.js +19 -1
- package/preload/index.js.map +1 -1
- package/renderer/index.d.ts +8 -0
- package/renderer/index.d.ts.map +1 -1
- package/renderer/index.js +25 -0
- package/renderer/index.js.map +1 -1
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import http from 'node:http';
|
|
4
|
+
import https from 'node:https';
|
|
5
|
+
import { spawn } from 'node:child_process';
|
|
6
|
+
import { app } from 'electron';
|
|
7
|
+
import md5 from 'md5';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 生成跨平台的文件URL
|
|
11
|
+
* @param filePath 文件路径
|
|
12
|
+
* @returns file:// URL
|
|
13
|
+
*/
|
|
14
|
+
function getFileUrl(filePath) {
|
|
15
|
+
if (!filePath) {
|
|
16
|
+
return '';
|
|
17
|
+
}
|
|
18
|
+
if (filePath.startsWith('file://')) {
|
|
19
|
+
return filePath;
|
|
20
|
+
}
|
|
21
|
+
// 在Windows上,需要添加驱动器字母前的斜杠
|
|
22
|
+
if (process.platform === 'win32') {
|
|
23
|
+
// 如果路径是绝对路径(如 C:\path\to\file),转换为 /C:/path/to/file
|
|
24
|
+
if (filePath.match(/^[A-Za-z]:/)) {
|
|
25
|
+
return `file:///${filePath}`;
|
|
26
|
+
}
|
|
27
|
+
// 如果已经是 /C:/path/to/file 格式,直接添加 file://
|
|
28
|
+
return `file://${filePath}`;
|
|
29
|
+
}
|
|
30
|
+
// macOS 和 Linux 使用 file:/// 前缀
|
|
31
|
+
return `file://${filePath}`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 视频下载和转码类
|
|
35
|
+
*/
|
|
36
|
+
class VideoDownloader {
|
|
37
|
+
constructor() {
|
|
38
|
+
this.ffmpegPath = '';
|
|
39
|
+
this.defaultCacheTTL = 24 * 60 * 60 * 1000; // 24小时缓存有效期
|
|
40
|
+
}
|
|
41
|
+
static getInstance() {
|
|
42
|
+
if (!VideoDownloader.instance) {
|
|
43
|
+
VideoDownloader.instance = new VideoDownloader();
|
|
44
|
+
}
|
|
45
|
+
return VideoDownloader.instance;
|
|
46
|
+
}
|
|
47
|
+
setFFmpegPath(ffmpegPath) {
|
|
48
|
+
this.ffmpegPath = ffmpegPath;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 下载视频文件
|
|
52
|
+
*/
|
|
53
|
+
async downloadVideoFile(url, outputPath, onProgress) {
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
const lib = url.startsWith('https') ? https : http;
|
|
56
|
+
const file = fs.createWriteStream(outputPath);
|
|
57
|
+
let downloadedBytes = 0;
|
|
58
|
+
let totalBytes = 0;
|
|
59
|
+
let startTime = Date.now();
|
|
60
|
+
let lastTime = startTime;
|
|
61
|
+
let lastBytes = 0;
|
|
62
|
+
const cleanup = () => {
|
|
63
|
+
if (file) {
|
|
64
|
+
file.close();
|
|
65
|
+
fs.unlinkSync(outputPath);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const request = lib.get(url, (res) => {
|
|
69
|
+
if (res.statusCode !== 200) {
|
|
70
|
+
cleanup();
|
|
71
|
+
reject(new Error(`下载失败,状态码: ${res.statusCode}`));
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
totalBytes = parseInt(res.headers['content-length'] || '0', 10);
|
|
75
|
+
res.on('data', (chunk) => {
|
|
76
|
+
downloadedBytes += chunk.length;
|
|
77
|
+
const now = Date.now();
|
|
78
|
+
if (onProgress && (now - lastTime > 100 || downloadedBytes === totalBytes)) {
|
|
79
|
+
const speed = ((downloadedBytes - lastBytes) * 1000) / (now - lastTime);
|
|
80
|
+
onProgress({
|
|
81
|
+
downloaded: downloadedBytes,
|
|
82
|
+
total: totalBytes,
|
|
83
|
+
percentage: totalBytes > 0 ? (downloadedBytes / totalBytes) * 100 : 0,
|
|
84
|
+
speed: speed || 0
|
|
85
|
+
});
|
|
86
|
+
lastTime = now;
|
|
87
|
+
lastBytes = downloadedBytes;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
res.pipe(file);
|
|
91
|
+
file.on('finish', () => {
|
|
92
|
+
file.close();
|
|
93
|
+
resolve();
|
|
94
|
+
});
|
|
95
|
+
file.on('error', (err) => {
|
|
96
|
+
cleanup();
|
|
97
|
+
reject(err);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
request.on('error', (err) => {
|
|
101
|
+
cleanup();
|
|
102
|
+
reject(err);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* 使用FFmpeg转码视频
|
|
108
|
+
*/
|
|
109
|
+
async transcodeVideo(inputPath, outputPath, options, onProgress) {
|
|
110
|
+
return new Promise((resolve, reject) => {
|
|
111
|
+
const ffmpegPath = options.ffmpegPath || this.ffmpegPath;
|
|
112
|
+
if (!ffmpegPath) {
|
|
113
|
+
reject(new Error('FFmpeg路径未设置'));
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const format = options.format || 'mp4';
|
|
117
|
+
const quality = options.quality || 18;
|
|
118
|
+
const videoCodec = options.videoCodec || 'h264';
|
|
119
|
+
const audioCodec = options.audioCodec || 'aac';
|
|
120
|
+
// 根据格式选择合适的编码器
|
|
121
|
+
const getCodecForFormat = (format, videoCodec, audioCodec) => {
|
|
122
|
+
switch (format) {
|
|
123
|
+
case 'webm':
|
|
124
|
+
return {
|
|
125
|
+
videoCodec: videoCodec === 'h264' ? 'libvpx-vp9' : videoCodec,
|
|
126
|
+
audioCodec: audioCodec === 'aac' ? 'libopus' : audioCodec
|
|
127
|
+
};
|
|
128
|
+
case 'avi':
|
|
129
|
+
return {
|
|
130
|
+
videoCodec: videoCodec === 'h265' ? 'h264' : videoCodec, // AVI不支持H265
|
|
131
|
+
audioCodec: audioCodec === 'opus' ? 'mp3' : audioCodec
|
|
132
|
+
};
|
|
133
|
+
case 'mov':
|
|
134
|
+
return {
|
|
135
|
+
videoCodec: videoCodec === 'vp9' ? 'h264' : videoCodec, // MOV对VP9支持有限
|
|
136
|
+
audioCodec: audioCodec === 'opus' ? 'aac' : audioCodec
|
|
137
|
+
};
|
|
138
|
+
default: // mp4, mkv
|
|
139
|
+
return { videoCodec, audioCodec };
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
const { videoCodec: finalVideoCodec, audioCodec: finalAudioCodec } = getCodecForFormat(format, videoCodec, audioCodec);
|
|
143
|
+
// 构建FFmpeg命令
|
|
144
|
+
const args = [
|
|
145
|
+
'-i', inputPath,
|
|
146
|
+
'-c:v', finalVideoCodec,
|
|
147
|
+
'-c:a', finalAudioCodec,
|
|
148
|
+
'-crf', quality.toString(),
|
|
149
|
+
'-preset', 'medium',
|
|
150
|
+
'-f', format, // 指定输出格式
|
|
151
|
+
'-y', // 覆盖输出文件
|
|
152
|
+
outputPath
|
|
153
|
+
];
|
|
154
|
+
const ffmpegProcess = spawn(ffmpegPath, args);
|
|
155
|
+
let duration = 0;
|
|
156
|
+
let stderr = '';
|
|
157
|
+
ffmpegProcess.stderr.on('data', (data) => {
|
|
158
|
+
stderr += data.toString();
|
|
159
|
+
// 解析FFmpeg输出获取进度
|
|
160
|
+
if (onProgress) {
|
|
161
|
+
const durationMatch = stderr.match(/Duration: (\d{2}):(\d{2}):(\d{2})\.(\d{2})/);
|
|
162
|
+
if (durationMatch && duration === 0) {
|
|
163
|
+
const hours = parseInt(durationMatch[1] || '0', 10);
|
|
164
|
+
const minutes = parseInt(durationMatch[2] || '0', 10);
|
|
165
|
+
const seconds = parseInt(durationMatch[3] || '0', 10);
|
|
166
|
+
const centiseconds = parseInt(durationMatch[4] || '0', 10);
|
|
167
|
+
duration = hours * 3600 + minutes * 60 + seconds + centiseconds / 100;
|
|
168
|
+
}
|
|
169
|
+
const timeMatch = stderr.match(/time=(\d{2}):(\d{2}):(\d{2})\.(\d{2})/);
|
|
170
|
+
if (timeMatch && duration > 0) {
|
|
171
|
+
const hours = parseInt(timeMatch[1] || '0', 10);
|
|
172
|
+
const minutes = parseInt(timeMatch[2] || '0', 10);
|
|
173
|
+
const seconds = parseInt(timeMatch[3] || '0', 10);
|
|
174
|
+
const centiseconds = parseInt(timeMatch[4] || '0', 10);
|
|
175
|
+
const currentTime = hours * 3600 + minutes * 60 + seconds + centiseconds / 100;
|
|
176
|
+
const percentage = (currentTime / duration) * 100;
|
|
177
|
+
const speedMatch = stderr.match(/speed=([\d.]+)x/);
|
|
178
|
+
const speed = speedMatch ? parseFloat(speedMatch[1] || '1') : 1;
|
|
179
|
+
onProgress({
|
|
180
|
+
percentage: Math.min(percentage, 100),
|
|
181
|
+
time: currentTime,
|
|
182
|
+
speed: speed
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
ffmpegProcess.on('close', (code) => {
|
|
188
|
+
if (code === 0) {
|
|
189
|
+
resolve();
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
reject(new Error(`FFmpeg转码失败,退出码: ${code}\n${stderr}`));
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
ffmpegProcess.on('error', (err) => {
|
|
196
|
+
reject(new Error(`FFmpeg执行失败: ${err.message}`));
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* 检查FFmpeg是否可用
|
|
202
|
+
*/
|
|
203
|
+
async checkFFmpegAvailable(ffmpegPath) {
|
|
204
|
+
return new Promise((resolve) => {
|
|
205
|
+
const command = ffmpegPath || this.ffmpegPath;
|
|
206
|
+
if (!command) {
|
|
207
|
+
resolve(false);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
const childProcess = spawn(command, ['-version']);
|
|
211
|
+
childProcess.on('error', (error) => {
|
|
212
|
+
console.log("checkFFmpegAvailable", error);
|
|
213
|
+
resolve(false);
|
|
214
|
+
});
|
|
215
|
+
childProcess.on('close', (code) => {
|
|
216
|
+
console.log("checkFFmpegAvailable", code);
|
|
217
|
+
resolve(code === 0);
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* 获取视频信息
|
|
223
|
+
*/
|
|
224
|
+
async getVideoInfo(inputPath, ffmpegPath) {
|
|
225
|
+
return new Promise((resolve, reject) => {
|
|
226
|
+
const ffmpegPath_cmd = ffmpegPath || this.ffmpegPath;
|
|
227
|
+
const args = ['-i', inputPath, '-f', 'null', '-'];
|
|
228
|
+
if (!ffmpegPath_cmd) {
|
|
229
|
+
resolve({ duration: 0, fileSize: 0 });
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const ffmpegProcess = spawn(ffmpegPath_cmd, args);
|
|
233
|
+
let stderr = '';
|
|
234
|
+
let duration = 0;
|
|
235
|
+
ffmpegProcess.stderr.on('data', (data) => {
|
|
236
|
+
stderr += data.toString();
|
|
237
|
+
const durationMatch = stderr.match(/Duration: (\d{2}):(\d{2}):(\d{2})\.(\d{2})/);
|
|
238
|
+
if (durationMatch) {
|
|
239
|
+
const hours = parseInt(durationMatch[1] || '0', 10);
|
|
240
|
+
const minutes = parseInt(durationMatch[2] || '0', 10);
|
|
241
|
+
const seconds = parseInt(durationMatch[3] || '0', 10);
|
|
242
|
+
const centiseconds = parseInt(durationMatch[4] || '0', 10);
|
|
243
|
+
duration = hours * 3600 + minutes * 60 + seconds + centiseconds / 100;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
ffmpegProcess.on('close', () => {
|
|
247
|
+
const stats = fs.statSync(inputPath);
|
|
248
|
+
resolve({
|
|
249
|
+
duration,
|
|
250
|
+
fileSize: stats.size
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
ffmpegProcess.on('error', (err) => {
|
|
254
|
+
reject(err);
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* 生成缓存文件名(基于URL的MD5)
|
|
260
|
+
*/
|
|
261
|
+
generateCacheFileName(options) {
|
|
262
|
+
const format = options.format || 'mp4';
|
|
263
|
+
const urlMd5 = md5(options.url);
|
|
264
|
+
return `${urlMd5}.${format}`;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* 检查缓存文件是否存在
|
|
268
|
+
*/
|
|
269
|
+
isCacheFileExists(cacheFilePath) {
|
|
270
|
+
console.log('检查缓存文件是否存在: ', cacheFilePath);
|
|
271
|
+
return fs.existsSync(cacheFilePath);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* 清理过期缓存文件
|
|
275
|
+
*/
|
|
276
|
+
cleanExpiredCacheFiles(outputDir, cacheTTL = this.defaultCacheTTL) {
|
|
277
|
+
try {
|
|
278
|
+
const files = fs.readdirSync(outputDir);
|
|
279
|
+
const now = Date.now();
|
|
280
|
+
files.forEach(file => {
|
|
281
|
+
const filePath = path.join(outputDir, file);
|
|
282
|
+
try {
|
|
283
|
+
const stats = fs.statSync(filePath);
|
|
284
|
+
// 如果文件超过缓存时间,删除它
|
|
285
|
+
if (now - stats.mtimeMs > cacheTTL) {
|
|
286
|
+
fs.unlinkSync(filePath);
|
|
287
|
+
console.log(`🧹 删除过期缓存文件: ${file}`);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
// 忽略单个文件错误
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
catch (error) {
|
|
296
|
+
// 忽略目录读取错误
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* 下载并转码视频
|
|
301
|
+
*/
|
|
302
|
+
async downloadAndTranscode(options, callbacks) {
|
|
303
|
+
try {
|
|
304
|
+
const outputDir = options.outputDir || app.getPath('temp');
|
|
305
|
+
// 获取缓存配置
|
|
306
|
+
const cacheConfig = options.cache || { enabled: true, ttl: this.defaultCacheTTL };
|
|
307
|
+
const cacheEnabled = cacheConfig.enabled !== false;
|
|
308
|
+
const cacheTTL = cacheConfig.ttl || this.defaultCacheTTL;
|
|
309
|
+
// 确保输出目录存在
|
|
310
|
+
if (!fs.existsSync(outputDir)) {
|
|
311
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
312
|
+
}
|
|
313
|
+
// 清理过期缓存文件
|
|
314
|
+
this.cleanExpiredCacheFiles(outputDir, cacheTTL);
|
|
315
|
+
// 生成缓存文件名
|
|
316
|
+
const cacheFileName = this.generateCacheFileName(options);
|
|
317
|
+
const cacheFilePath = path.join(outputDir, cacheFileName);
|
|
318
|
+
// 如果启用缓存,检查缓存文件是否存在
|
|
319
|
+
if (cacheEnabled && this.isCacheFileExists(cacheFilePath)) {
|
|
320
|
+
console.log('🎯 命中缓存,直接返回缓存文件');
|
|
321
|
+
// 获取文件信息
|
|
322
|
+
const stats = fs.statSync(cacheFilePath);
|
|
323
|
+
const result = {
|
|
324
|
+
success: true,
|
|
325
|
+
outputPath: getFileUrl(cacheFilePath),
|
|
326
|
+
fileSize: stats.size,
|
|
327
|
+
fromCache: true
|
|
328
|
+
};
|
|
329
|
+
callbacks?.onComplete?.({
|
|
330
|
+
success: true,
|
|
331
|
+
outputPath: result.outputPath
|
|
332
|
+
});
|
|
333
|
+
return result;
|
|
334
|
+
}
|
|
335
|
+
// 检查FFmpeg是否可用
|
|
336
|
+
const ffmpegAvailable = await this.checkFFmpegAvailable(options.ffmpegPath);
|
|
337
|
+
if (!ffmpegAvailable) {
|
|
338
|
+
throw new Error('FFmpeg不可用,请确保已安装FFmpeg或提供正确的路径');
|
|
339
|
+
}
|
|
340
|
+
// 生成临时文件名和最终输出路径
|
|
341
|
+
const fileName = options.outputName || md5(options.url);
|
|
342
|
+
const format = options.format || 'mp4';
|
|
343
|
+
const tempPath = path.join(outputDir, `${fileName}.temp`);
|
|
344
|
+
const finalOutputPath = path.join(outputDir, `${fileName}.${format}`);
|
|
345
|
+
const outputPath = cacheEnabled ? cacheFilePath : finalOutputPath;
|
|
346
|
+
console.log('📥 开始下载视频...');
|
|
347
|
+
// 下载视频
|
|
348
|
+
await this.downloadVideoFile(options.url, tempPath, callbacks?.onDownloadProgress);
|
|
349
|
+
console.log('🔄 开始转码视频...');
|
|
350
|
+
// 转码视频
|
|
351
|
+
await this.transcodeVideo(tempPath, outputPath, {
|
|
352
|
+
...options,
|
|
353
|
+
outputDir
|
|
354
|
+
}, callbacks?.onTranscodeProgress);
|
|
355
|
+
// 如果启用了缓存,将缓存文件复制到最终输出路径
|
|
356
|
+
if (cacheEnabled && outputPath !== finalOutputPath) {
|
|
357
|
+
fs.copyFileSync(outputPath, finalOutputPath);
|
|
358
|
+
console.log('📋 缓存文件已复制到最终输出路径');
|
|
359
|
+
}
|
|
360
|
+
// 获取视频信息
|
|
361
|
+
const videoInfo = await this.getVideoInfo(outputPath, options.ffmpegPath);
|
|
362
|
+
// 清理临时文件
|
|
363
|
+
if (!options.keepOriginal) {
|
|
364
|
+
fs.unlinkSync(tempPath);
|
|
365
|
+
}
|
|
366
|
+
console.log('💾 文件已保存到缓存');
|
|
367
|
+
const result = {
|
|
368
|
+
success: true,
|
|
369
|
+
outputPath: getFileUrl(cacheEnabled ? finalOutputPath : outputPath),
|
|
370
|
+
originalPath: options.keepOriginal ? getFileUrl(tempPath) : undefined,
|
|
371
|
+
duration: videoInfo.duration,
|
|
372
|
+
fileSize: videoInfo.fileSize,
|
|
373
|
+
fromCache: false
|
|
374
|
+
};
|
|
375
|
+
callbacks?.onComplete?.({
|
|
376
|
+
success: true,
|
|
377
|
+
outputPath: result.outputPath
|
|
378
|
+
});
|
|
379
|
+
return result;
|
|
380
|
+
}
|
|
381
|
+
catch (error) {
|
|
382
|
+
const errorMessage = error instanceof Error ? error.message : '未知错误';
|
|
383
|
+
const result = {
|
|
384
|
+
success: false,
|
|
385
|
+
error: errorMessage
|
|
386
|
+
};
|
|
387
|
+
callbacks?.onComplete?.({
|
|
388
|
+
success: false,
|
|
389
|
+
error: errorMessage
|
|
390
|
+
});
|
|
391
|
+
return result;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* 清除指定目录的所有缓存文件
|
|
396
|
+
*/
|
|
397
|
+
clearCache(outputDir) {
|
|
398
|
+
try {
|
|
399
|
+
const files = fs.readdirSync(outputDir);
|
|
400
|
+
files.forEach(file => {
|
|
401
|
+
const filePath = path.join(outputDir, file);
|
|
402
|
+
try {
|
|
403
|
+
fs.unlinkSync(filePath);
|
|
404
|
+
}
|
|
405
|
+
catch (error) {
|
|
406
|
+
// 忽略单个文件删除错误
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
console.log('🧹 缓存文件已清空');
|
|
410
|
+
}
|
|
411
|
+
catch (error) {
|
|
412
|
+
console.log('⚠️ 清理缓存时发生错误:', error instanceof Error ? error.message : '未知错误');
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* 获取缓存统计信息
|
|
417
|
+
*/
|
|
418
|
+
getCacheStats(outputDir) {
|
|
419
|
+
try {
|
|
420
|
+
const files = fs.readdirSync(outputDir);
|
|
421
|
+
const entries = files.map(file => {
|
|
422
|
+
const filePath = path.join(outputDir, file);
|
|
423
|
+
try {
|
|
424
|
+
const stats = fs.statSync(filePath);
|
|
425
|
+
return {
|
|
426
|
+
fileName: file,
|
|
427
|
+
filePath: filePath,
|
|
428
|
+
fileSize: stats.size,
|
|
429
|
+
mtime: stats.mtimeMs
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
catch {
|
|
433
|
+
return null;
|
|
434
|
+
}
|
|
435
|
+
}).filter((entry) => entry !== null);
|
|
436
|
+
return {
|
|
437
|
+
size: entries.length,
|
|
438
|
+
entries
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
catch (error) {
|
|
442
|
+
return { size: 0, entries: [] };
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* 删除指定URL的缓存文件
|
|
447
|
+
*/
|
|
448
|
+
removeCache(options) {
|
|
449
|
+
try {
|
|
450
|
+
const cacheFileName = this.generateCacheFileName(options);
|
|
451
|
+
const cacheFilePath = path.join(options.outputDir, cacheFileName);
|
|
452
|
+
if (fs.existsSync(cacheFilePath)) {
|
|
453
|
+
fs.unlinkSync(cacheFilePath);
|
|
454
|
+
console.log(`🗑️ 删除缓存文件: ${cacheFileName}`);
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
return false;
|
|
458
|
+
}
|
|
459
|
+
catch (error) {
|
|
460
|
+
console.log('⚠️ 删除缓存文件时发生错误:', error instanceof Error ? error.message : '未知错误');
|
|
461
|
+
return false;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* 下载视频并转码
|
|
467
|
+
* @param options 下载和转码选项
|
|
468
|
+
* @param callbacks 进度回调
|
|
469
|
+
* @returns 转码结果
|
|
470
|
+
*/
|
|
471
|
+
const downloadVideo = async (options, callbacks) => {
|
|
472
|
+
const downloader = VideoDownloader.getInstance();
|
|
473
|
+
return downloader.downloadAndTranscode(options, callbacks);
|
|
474
|
+
};
|
|
475
|
+
/**
|
|
476
|
+
* 清除指定目录的所有缓存文件
|
|
477
|
+
*/
|
|
478
|
+
const clearVideoCache = (outputDir) => {
|
|
479
|
+
const downloader = VideoDownloader.getInstance();
|
|
480
|
+
downloader.clearCache(outputDir);
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* 获取缓存统计信息
|
|
484
|
+
*/
|
|
485
|
+
const getVideoCacheStats = (outputDir) => {
|
|
486
|
+
const downloader = VideoDownloader.getInstance();
|
|
487
|
+
return downloader.getCacheStats(outputDir);
|
|
488
|
+
};
|
|
489
|
+
/**
|
|
490
|
+
* 删除指定URL的缓存文件
|
|
491
|
+
*/
|
|
492
|
+
const removeVideoCache = (options) => {
|
|
493
|
+
const downloader = VideoDownloader.getInstance();
|
|
494
|
+
return downloader.removeCache(options);
|
|
495
|
+
};
|
|
496
|
+
/**
|
|
497
|
+
* 设置FFmpeg路径
|
|
498
|
+
*/
|
|
499
|
+
const setFFmpegPath = (ffmpegPath) => {
|
|
500
|
+
const downloader = VideoDownloader.getInstance();
|
|
501
|
+
downloader.setFFmpegPath(ffmpegPath);
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
export { clearVideoCache, downloadVideo, getFileUrl, getVideoCacheStats, removeVideoCache, setFFmpegPath };
|
|
505
|
+
//# sourceMappingURL=video-downloader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-downloader.js","sources":["../../src/main/video-downloader.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport http from 'node:http';\nimport https from 'node:https';\nimport { spawn } from 'node:child_process';\nimport { app } from 'electron';\nimport md5 from 'md5';\nimport type { VideoDownloadOptions, VideoProgressCallback, VideoDownloadResult } from '../common';\n\n/**\n * 生成跨平台的文件URL\n * @param filePath 文件路径\n * @returns file:// URL\n */\nexport function getFileUrl(filePath: string): string {\n if (!filePath) {\n return '';\n }\n if (filePath.startsWith('file://')) {\n return filePath;\n }\n // 在Windows上,需要添加驱动器字母前的斜杠\n if (process.platform === 'win32') {\n // 如果路径是绝对路径(如 C:\\path\\to\\file),转换为 /C:/path/to/file\n if (filePath.match(/^[A-Za-z]:/)) {\n return `file:///${filePath}`;\n }\n // 如果已经是 /C:/path/to/file 格式,直接添加 file://\n return `file://${filePath}`;\n }\n\n // macOS 和 Linux 使用 file:/// 前缀\n return `file://${filePath}`;\n}\n\n/**\n * 视频下载和转码类\n */\nclass VideoDownloader {\n private ffmpegPath: string = '';\n private static instance: VideoDownloader;\n private defaultCacheTTL: number = 24 * 60 * 60 * 1000; // 24小时缓存有效期\n\n static getInstance(): VideoDownloader {\n if (!VideoDownloader.instance) {\n VideoDownloader.instance = new VideoDownloader();\n }\n return VideoDownloader.instance;\n }\n\n setFFmpegPath(ffmpegPath: string): void {\n this.ffmpegPath = ffmpegPath;\n }\n\n /**\n * 下载视频文件\n */\n private async downloadVideoFile(\n url: string,\n outputPath: string,\n onProgress?: (progress: { downloaded: number; total: number; percentage: number; speed: number }) => void\n ): Promise<void> {\n return new Promise((resolve, reject) => {\n const lib = url.startsWith('https') ? https : http;\n const file = fs.createWriteStream(outputPath);\n let downloadedBytes = 0;\n let totalBytes = 0;\n let startTime = Date.now();\n let lastTime = startTime;\n let lastBytes = 0;\n\n const cleanup = () => {\n if (file) {\n file.close();\n fs.unlinkSync(outputPath);\n }\n };\n\n const request = lib.get(url, (res) => {\n if (res.statusCode !== 200) {\n cleanup();\n reject(new Error(`下载失败,状态码: ${res.statusCode}`));\n return;\n }\n\n totalBytes = parseInt(res.headers['content-length'] || '0', 10);\n\n res.on('data', (chunk) => {\n downloadedBytes += chunk.length;\n const now = Date.now();\n\n if (onProgress && (now - lastTime > 100 || downloadedBytes === totalBytes)) {\n const speed = ((downloadedBytes - lastBytes) * 1000) / (now - lastTime);\n onProgress({\n downloaded: downloadedBytes,\n total: totalBytes,\n percentage: totalBytes > 0 ? (downloadedBytes / totalBytes) * 100 : 0,\n speed: speed || 0\n });\n lastTime = now;\n lastBytes = downloadedBytes;\n }\n });\n\n res.pipe(file);\n\n file.on('finish', () => {\n file.close();\n resolve();\n });\n\n file.on('error', (err) => {\n cleanup();\n reject(err);\n });\n });\n\n request.on('error', (err) => {\n cleanup();\n reject(err);\n });\n });\n }\n\n /**\n * 使用FFmpeg转码视频\n */\n private async transcodeVideo(\n inputPath: string,\n outputPath: string,\n options: VideoDownloadOptions,\n onProgress?: (progress: { percentage: number; time: number; speed: number }) => void\n ): Promise<void> {\n return new Promise((resolve, reject) => {\n const ffmpegPath = options.ffmpegPath || this.ffmpegPath;\n if (!ffmpegPath) {\n reject(new Error('FFmpeg路径未设置'));\n return;\n }\n const format = options.format || 'mp4';\n const quality = options.quality || 18;\n const videoCodec = options.videoCodec || 'h264';\n const audioCodec = options.audioCodec || 'aac';\n\n // 根据格式选择合适的编码器\n const getCodecForFormat = (format: string, videoCodec: string, audioCodec: string) => {\n switch (format) {\n case 'webm':\n return {\n videoCodec: videoCodec === 'h264' ? 'libvpx-vp9' : videoCodec,\n audioCodec: audioCodec === 'aac' ? 'libopus' : audioCodec\n };\n case 'avi':\n return {\n videoCodec: videoCodec === 'h265' ? 'h264' : videoCodec, // AVI不支持H265\n audioCodec: audioCodec === 'opus' ? 'mp3' : audioCodec\n };\n case 'mov':\n return {\n videoCodec: videoCodec === 'vp9' ? 'h264' : videoCodec, // MOV对VP9支持有限\n audioCodec: audioCodec === 'opus' ? 'aac' : audioCodec\n };\n default: // mp4, mkv\n return { videoCodec, audioCodec };\n }\n };\n\n const { videoCodec: finalVideoCodec, audioCodec: finalAudioCodec } = getCodecForFormat(format, videoCodec, audioCodec);\n\n // 构建FFmpeg命令\n const args = [\n '-i', inputPath,\n '-c:v', finalVideoCodec,\n '-c:a', finalAudioCodec,\n '-crf', quality.toString(),\n '-preset', 'medium',\n '-f', format, // 指定输出格式\n '-y', // 覆盖输出文件\n outputPath\n ];\n\n const ffmpegProcess = spawn(ffmpegPath, args);\n let duration = 0;\n let stderr = '';\n\n ffmpegProcess.stderr.on('data', (data: Buffer) => {\n stderr += data.toString();\n\n // 解析FFmpeg输出获取进度\n if (onProgress) {\n const durationMatch = stderr.match(/Duration: (\\d{2}):(\\d{2}):(\\d{2})\\.(\\d{2})/);\n if (durationMatch && duration === 0) {\n const hours = parseInt(durationMatch[1] || '0', 10);\n const minutes = parseInt(durationMatch[2] || '0', 10);\n const seconds = parseInt(durationMatch[3] || '0', 10);\n const centiseconds = parseInt(durationMatch[4] || '0', 10);\n duration = hours * 3600 + minutes * 60 + seconds + centiseconds / 100;\n }\n\n const timeMatch = stderr.match(/time=(\\d{2}):(\\d{2}):(\\d{2})\\.(\\d{2})/);\n if (timeMatch && duration > 0) {\n const hours = parseInt(timeMatch[1] || '0', 10);\n const minutes = parseInt(timeMatch[2] || '0', 10);\n const seconds = parseInt(timeMatch[3] || '0', 10);\n const centiseconds = parseInt(timeMatch[4] || '0', 10);\n const currentTime = hours * 3600 + minutes * 60 + seconds + centiseconds / 100;\n\n const percentage = (currentTime / duration) * 100;\n const speedMatch = stderr.match(/speed=([\\d.]+)x/);\n const speed = speedMatch ? parseFloat(speedMatch[1] || '1') : 1;\n\n onProgress({\n percentage: Math.min(percentage, 100),\n time: currentTime,\n speed: speed\n });\n }\n }\n });\n\n ffmpegProcess.on('close', (code: number) => {\n if (code === 0) {\n resolve();\n } else {\n reject(new Error(`FFmpeg转码失败,退出码: ${code}\\n${stderr}`));\n }\n });\n\n ffmpegProcess.on('error', (err: Error) => {\n reject(new Error(`FFmpeg执行失败: ${err.message}`));\n });\n });\n }\n\n /**\n * 检查FFmpeg是否可用\n */\n private async checkFFmpegAvailable(ffmpegPath?: string): Promise<boolean> {\n return new Promise((resolve) => {\n const command = ffmpegPath || this.ffmpegPath;\n if (!command) {\n resolve(false);\n return;\n }\n const childProcess = spawn(command, ['-version']);\n childProcess.on('error', (error) => {\n console.log(\"checkFFmpegAvailable\", error);\n resolve(false);\n });\n childProcess.on('close', (code) => {\n console.log(\"checkFFmpegAvailable\", code);\n resolve(code === 0);\n });\n });\n }\n\n /**\n * 获取视频信息\n */\n private async getVideoInfo(inputPath: string, ffmpegPath?: string): Promise<{ duration: number; fileSize: number }> {\n return new Promise((resolve, reject) => {\n const ffmpegPath_cmd = ffmpegPath || this.ffmpegPath;\n const args = ['-i', inputPath, '-f', 'null', '-'];\n if (!ffmpegPath_cmd) {\n resolve({ duration: 0, fileSize: 0 });\n return;\n }\n const ffmpegProcess = spawn(ffmpegPath_cmd, args);\n let stderr = '';\n let duration = 0;\n\n ffmpegProcess.stderr.on('data', (data: Buffer) => {\n stderr += data.toString();\n const durationMatch = stderr.match(/Duration: (\\d{2}):(\\d{2}):(\\d{2})\\.(\\d{2})/);\n if (durationMatch) {\n const hours = parseInt(durationMatch[1] || '0', 10);\n const minutes = parseInt(durationMatch[2] || '0', 10);\n const seconds = parseInt(durationMatch[3] || '0', 10);\n const centiseconds = parseInt(durationMatch[4] || '0', 10);\n duration = hours * 3600 + minutes * 60 + seconds + centiseconds / 100;\n }\n });\n\n ffmpegProcess.on('close', () => {\n const stats = fs.statSync(inputPath);\n resolve({\n duration,\n fileSize: stats.size\n });\n });\n\n ffmpegProcess.on('error', (err: Error) => {\n reject(err);\n });\n });\n }\n\n /**\n * 生成缓存文件名(基于URL的MD5)\n */\n private generateCacheFileName(options: VideoDownloadOptions): string {\n const format = options.format || 'mp4';\n const urlMd5 = md5(options.url);\n return `${urlMd5}.${format}`;\n }\n\n /**\n * 检查缓存文件是否存在\n */\n private isCacheFileExists(cacheFilePath: string): boolean {\n console.log('检查缓存文件是否存在: ', cacheFilePath);\n return fs.existsSync(cacheFilePath);\n }\n\n /**\n * 清理过期缓存文件\n */\n private cleanExpiredCacheFiles(outputDir: string, cacheTTL: number = this.defaultCacheTTL): void {\n try {\n const files = fs.readdirSync(outputDir);\n const now = Date.now();\n\n files.forEach(file => {\n const filePath = path.join(outputDir, file);\n try {\n const stats = fs.statSync(filePath);\n // 如果文件超过缓存时间,删除它\n if (now - stats.mtimeMs > cacheTTL) {\n fs.unlinkSync(filePath);\n console.log(`🧹 删除过期缓存文件: ${file}`);\n }\n } catch (error) {\n // 忽略单个文件错误\n }\n });\n } catch (error) {\n // 忽略目录读取错误\n }\n }\n\n /**\n * 下载并转码视频\n */\n async downloadAndTranscode(\n options: VideoDownloadOptions,\n callbacks?: VideoProgressCallback\n ): Promise<VideoDownloadResult> {\n try {\n const outputDir = options.outputDir || app.getPath('temp');\n // 获取缓存配置\n const cacheConfig = options.cache || { enabled: true, ttl: this.defaultCacheTTL };\n const cacheEnabled = cacheConfig.enabled !== false;\n const cacheTTL = cacheConfig.ttl || this.defaultCacheTTL;\n\n // 确保输出目录存在\n if (!fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, { recursive: true });\n }\n\n // 清理过期缓存文件\n this.cleanExpiredCacheFiles(outputDir, cacheTTL);\n\n // 生成缓存文件名\n const cacheFileName = this.generateCacheFileName(options);\n const cacheFilePath = path.join(outputDir, cacheFileName);\n\n // 如果启用缓存,检查缓存文件是否存在\n if (cacheEnabled && this.isCacheFileExists(cacheFilePath)) {\n console.log('🎯 命中缓存,直接返回缓存文件');\n\n // 获取文件信息\n const stats = fs.statSync(cacheFilePath);\n\n const result: VideoDownloadResult = {\n success: true,\n outputPath: getFileUrl(cacheFilePath),\n fileSize: stats.size,\n fromCache: true\n };\n\n callbacks?.onComplete?.({\n success: true,\n outputPath: result.outputPath\n });\n\n return result;\n }\n\n // 检查FFmpeg是否可用\n const ffmpegAvailable = await this.checkFFmpegAvailable(options.ffmpegPath);\n if (!ffmpegAvailable) {\n throw new Error('FFmpeg不可用,请确保已安装FFmpeg或提供正确的路径');\n }\n\n // 生成临时文件名和最终输出路径\n const fileName = options.outputName || md5(options.url);\n const format = options.format || 'mp4';\n const tempPath = path.join(outputDir, `${fileName}.temp`);\n const finalOutputPath = path.join(outputDir, `${fileName}.${format}`);\n const outputPath = cacheEnabled ? cacheFilePath : finalOutputPath;\n\n console.log('📥 开始下载视频...');\n // 下载视频\n await this.downloadVideoFile(\n options.url,\n tempPath,\n callbacks?.onDownloadProgress\n );\n\n console.log('🔄 开始转码视频...');\n // 转码视频\n await this.transcodeVideo(\n tempPath,\n outputPath,\n {\n ...options,\n outputDir\n },\n callbacks?.onTranscodeProgress\n );\n\n // 如果启用了缓存,将缓存文件复制到最终输出路径\n if (cacheEnabled && outputPath !== finalOutputPath) {\n fs.copyFileSync(outputPath, finalOutputPath);\n console.log('📋 缓存文件已复制到最终输出路径');\n }\n\n // 获取视频信息\n const videoInfo = await this.getVideoInfo(outputPath, options.ffmpegPath);\n\n // 清理临时文件\n if (!options.keepOriginal) {\n fs.unlinkSync(tempPath);\n }\n\n console.log('💾 文件已保存到缓存');\n\n const result: VideoDownloadResult = {\n success: true,\n outputPath: getFileUrl(cacheEnabled ? finalOutputPath : outputPath),\n originalPath: options.keepOriginal ? getFileUrl(tempPath) : undefined,\n duration: videoInfo.duration,\n fileSize: videoInfo.fileSize,\n fromCache: false\n };\n\n callbacks?.onComplete?.({\n success: true,\n outputPath: result.outputPath\n });\n\n return result;\n\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : '未知错误';\n\n const result: VideoDownloadResult = {\n success: false,\n error: errorMessage\n };\n\n callbacks?.onComplete?.({\n success: false,\n error: errorMessage\n });\n\n return result;\n }\n }\n\n /**\n * 清除指定目录的所有缓存文件\n */\n clearCache(outputDir: string): void {\n try {\n const files = fs.readdirSync(outputDir);\n files.forEach(file => {\n const filePath = path.join(outputDir, file);\n try {\n fs.unlinkSync(filePath);\n } catch (error) {\n // 忽略单个文件删除错误\n }\n });\n console.log('🧹 缓存文件已清空');\n } catch (error) {\n console.log('⚠️ 清理缓存时发生错误:', error instanceof Error ? error.message : '未知错误');\n }\n }\n\n /**\n * 获取缓存统计信息\n */\n getCacheStats(outputDir: string): { size: number; entries: Array<{ fileName: string; filePath: string; fileSize: number; mtime: number }> } {\n try {\n const files = fs.readdirSync(outputDir);\n const entries = files.map(file => {\n const filePath = path.join(outputDir, file);\n try {\n const stats = fs.statSync(filePath);\n return {\n fileName: file,\n filePath: filePath,\n fileSize: stats.size,\n mtime: stats.mtimeMs\n };\n } catch {\n return null;\n }\n }).filter((entry): entry is { fileName: string; filePath: string; fileSize: number; mtime: number } => entry !== null);\n\n return {\n size: entries.length,\n entries\n };\n } catch (error) {\n return { size: 0, entries: [] };\n }\n }\n\n /**\n * 删除指定URL的缓存文件\n */\n removeCache(options: VideoDownloadOptions): boolean {\n try {\n const cacheFileName = this.generateCacheFileName(options);\n const cacheFilePath = path.join(options.outputDir, cacheFileName);\n\n if (fs.existsSync(cacheFilePath)) {\n fs.unlinkSync(cacheFilePath);\n console.log(`🗑️ 删除缓存文件: ${cacheFileName}`);\n return true;\n }\n return false;\n } catch (error) {\n console.log('⚠️ 删除缓存文件时发生错误:', error instanceof Error ? error.message : '未知错误');\n return false;\n }\n }\n}\n\n/**\n * 下载视频并转码\n * @param options 下载和转码选项\n * @param callbacks 进度回调\n * @returns 转码结果\n */\nexport const downloadVideo = async (\n options: VideoDownloadOptions,\n callbacks?: VideoProgressCallback\n): Promise<VideoDownloadResult> => {\n const downloader = VideoDownloader.getInstance();\n return downloader.downloadAndTranscode(options, callbacks);\n};\n\n/**\n * 清除指定目录的所有缓存文件\n */\nexport const clearVideoCache = (outputDir: string): void => {\n const downloader = VideoDownloader.getInstance();\n downloader.clearCache(outputDir);\n};\n\n/**\n * 获取缓存统计信息\n */\nexport const getVideoCacheStats = (outputDir: string): { size: number; entries: Array<{ fileName: string; filePath: string; fileSize: number; mtime: number }> } => {\n const downloader = VideoDownloader.getInstance();\n return downloader.getCacheStats(outputDir);\n};\n\n/**\n * 删除指定URL的缓存文件\n */\nexport const removeVideoCache = (options: VideoDownloadOptions): boolean => {\n const downloader = VideoDownloader.getInstance();\n return downloader.removeCache(options);\n};\n\n/**\n * 设置FFmpeg路径\n */\nexport const setFFmpegPath = (ffmpegPath: string): void => {\n const downloader = VideoDownloader.getInstance();\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const preload = {
|
|
15
|
-
ipcRenderer:
|
|
15
|
+
ipcRenderer: {
|
|
16
|
+
...ipcRenderer,
|
|
17
|
+
emit: ipcRenderer.emit.bind(ipcRenderer),
|
|
18
|
+
prependListener: ipcRenderer.prependListener.bind(ipcRenderer),
|
|
19
|
+
prependOnceListener: ipcRenderer.prependOnceListener.bind(ipcRenderer),
|
|
20
|
+
once: ipcRenderer.once.bind(ipcRenderer),
|
|
21
|
+
on: ipcRenderer.on.bind(ipcRenderer),
|
|
22
|
+
off: ipcRenderer.off.bind(ipcRenderer),
|
|
23
|
+
send: ipcRenderer.send.bind(ipcRenderer),
|
|
24
|
+
sendSync: ipcRenderer.sendSync.bind(ipcRenderer),
|
|
25
|
+
sendToHost: ipcRenderer.sendToHost.bind(ipcRenderer),
|
|
26
|
+
invoke: ipcRenderer.invoke.bind(ipcRenderer),
|
|
27
|
+
addListener: ipcRenderer.addListener.bind(ipcRenderer),
|
|
28
|
+
removeAllListeners: ipcRenderer.removeAllListeners.bind(ipcRenderer),
|
|
29
|
+
removeListener: ipcRenderer.removeListener.bind(ipcRenderer),
|
|
30
|
+
},
|
|
16
31
|
remote: remote,
|
|
32
|
+
getRemote: () => {
|
|
33
|
+
return remote;
|
|
34
|
+
},
|
|
17
35
|
webFrame: webFrame,
|
|
18
36
|
};
|
|
19
37
|
// @ts-ignore
|
package/esm/preload/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/src/preload/index.ts"],"sourcesContent":["import { contextBridge, ipcRenderer, webFrame } from 'electron';\nimport remote from '@electron/remote/renderer';\nimport '@lynker-desktop/electron-ipc/preload';\nimport '@lynker-desktop/electron-logs/preload';\nimport '@lynker-desktop/electron-window-manager/preload';\n\n// @ts-ignore\nif (window.__ELECTRON_SDK__) {\n // eslint-disable-next-line no-console\n console.log('electron-sdk Electron preload has already been run');\n} else {\n try {\n const preload = {\n ipcRenderer: ipcRenderer,\n remote: remote,\n webFrame: webFrame,\n }\n // @ts-ignore\n window.__ELECTRON_SDK__ = preload;\n if (contextBridge) {\n try {\n // This will fail if contextIsolation is not enabled\n contextBridge.exposeInMainWorld('__ELECTRON_SDK__', preload);\n } catch (error) {\n // console.error(error)\n }\n\n }\n }\n catch (e) {\n console.error(e)\n }\n}\n"],"names":[],"mappings":";;;;;;AAMA;AACA,IAAI,MAAM,CAAC,gBAAgB,EAAE;;AAE3B,IAAA,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;AACpE,CAAC;KAAM;AACL,IAAA,IAAI;AACF,QAAA,MAAM,OAAO,GAAG;AACd,YAAA,WAAW,EAAE,WAAW;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/src/preload/index.ts"],"sourcesContent":["import { contextBridge, ipcRenderer, webFrame } from 'electron';\nimport remote from '@electron/remote/renderer';\nimport '@lynker-desktop/electron-ipc/preload';\nimport '@lynker-desktop/electron-logs/preload';\nimport '@lynker-desktop/electron-window-manager/preload';\n\n// @ts-ignore\nif (window.__ELECTRON_SDK__) {\n // eslint-disable-next-line no-console\n console.log('electron-sdk Electron preload has already been run');\n} else {\n try {\n const preload = {\n ipcRenderer: {\n ...ipcRenderer,\n emit: ipcRenderer.emit.bind(ipcRenderer),\n prependListener: ipcRenderer.prependListener.bind(ipcRenderer),\n prependOnceListener: ipcRenderer.prependOnceListener.bind(ipcRenderer),\n once: ipcRenderer.once.bind(ipcRenderer),\n on: ipcRenderer.on.bind(ipcRenderer),\n off: ipcRenderer.off.bind(ipcRenderer),\n send: ipcRenderer.send.bind(ipcRenderer),\n sendSync: ipcRenderer.sendSync.bind(ipcRenderer),\n sendToHost: ipcRenderer.sendToHost.bind(ipcRenderer),\n invoke: ipcRenderer.invoke.bind(ipcRenderer),\n addListener: ipcRenderer.addListener.bind(ipcRenderer),\n removeAllListeners: ipcRenderer.removeAllListeners.bind(ipcRenderer),\n removeListener: ipcRenderer.removeListener.bind(ipcRenderer),\n },\n remote: remote,\n getRemote:() => {\n return remote;\n },\n webFrame: webFrame,\n }\n // @ts-ignore\n window.__ELECTRON_SDK__ = preload;\n if (contextBridge) {\n try {\n // This will fail if contextIsolation is not enabled\n contextBridge.exposeInMainWorld('__ELECTRON_SDK__', preload);\n } catch (error) {\n // console.error(error)\n }\n\n }\n }\n catch (e) {\n console.error(e)\n }\n}\n"],"names":[],"mappings":";;;;;;AAMA;AACA,IAAI,MAAM,CAAC,gBAAgB,EAAE;;AAE3B,IAAA,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;AACpE,CAAC;KAAM;AACL,IAAA,IAAI;AACF,QAAA,MAAM,OAAO,GAAG;AACd,YAAA,WAAW,EAAE;AACX,gBAAA,GAAG,WAAW;gBACd,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;gBACxC,eAAe,EAAE,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC;gBAC9D,mBAAmB,EAAE,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC;gBACtE,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;gBACxC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC;gBACpC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC;gBACtC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;gBACxC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC;gBAChD,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC;gBACpD,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;gBAC5C,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;gBACtD,kBAAkB,EAAE,WAAW,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC;gBACpE,cAAc,EAAE,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC;AAC7D,aAAA;AACD,YAAA,MAAM,EAAE,MAAM;YACd,SAAS,EAAC,MAAK;AACb,gBAAA,OAAO,MAAM,CAAC;aACf;AACD,YAAA,QAAQ,EAAE,QAAQ;SACnB,CAAA;;AAED,QAAA,MAAM,CAAC,gBAAgB,GAAG,OAAO,CAAC;QAClC,IAAI,aAAa,EAAE;AACjB,YAAA,IAAI;;AAEF,gBAAA,aAAa,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;aAC9D;YAAC,OAAO,KAAK,EAAE;;aAEf;SAEF;KACF;IACD,OAAO,CAAC,EAAE;AACR,QAAA,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;KACjB;AACH"}
|
package/esm/renderer/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ProcessMetric } from 'electron';
|
|
|
3
3
|
import EventEmitter from 'events';
|
|
4
4
|
import ipc from '@lynker-desktop/electron-ipc/renderer';
|
|
5
5
|
import windowManager from '@lynker-desktop/electron-window-manager/renderer';
|
|
6
|
+
import { VideoTranscodeChangeCallback, type VideoDownloadOptions } from '../common';
|
|
6
7
|
declare class SDK extends EventEmitter {
|
|
7
8
|
remote: typeof RemoteType;
|
|
8
9
|
ipc: typeof ipc.RendererIPC;
|
|
@@ -41,6 +42,13 @@ declare class SDK extends EventEmitter {
|
|
|
41
42
|
* @returns
|
|
42
43
|
*/
|
|
43
44
|
getAppMetrics: () => Promise<ProcessMetric[]>;
|
|
45
|
+
/**
|
|
46
|
+
* 转码视频
|
|
47
|
+
* @param options
|
|
48
|
+
* @param callbacks
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
transcodeVideo: (options: VideoDownloadOptions, callbacks?: (data: VideoTranscodeChangeCallback) => void) => Promise<string>;
|
|
44
52
|
}
|
|
45
53
|
/** 临时写法,后期用rollup生成umd包 */
|
|
46
54
|
declare const core: SDK;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/renderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,YAAY,MAAM,QAAQ,CAAC;AAGlC,OAAO,GAAG,MAAM,uCAAuC,CAAA;AAEvD,OAAO,aAAa,MAAM,kDAAkD,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/renderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,YAAY,MAAM,QAAQ,CAAC;AAGlC,OAAO,GAAG,MAAM,uCAAuC,CAAA;AAEvD,OAAO,aAAa,MAAM,kDAAkD,CAAA;AAC5E,OAAO,EAA4C,4BAA4B,EAA2C,KAAK,oBAAoB,EAA8B,MAAM,WAAW,CAAC;AAYnM,cAAM,GAAI,SAAQ,YAAY;IAC5B,MAAM,EAAkB,OAAO,UAAU,CAAC;IAC1C,GAAG,yBAAmB;IACtB,GAAG,wFAAY;IACf,UAAU,wBAAmB;IAC7B,aAAa,uBAAiB;;IAe9B;;OAEG;IACH,gBAAgB,QAAa,OAAO,CAAC,MAAM,CAAC,CAG3C;IAED;;;OAGG;IACH,gBAAgB,QAAa,OAAO,CAAC,MAAM,CAAC,CAG3C;IAED;;;;OAIG;IACH,eAAe,aAAc,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,KAAG,MAAM,IAAI,CAMlE;IAED;;;;OAIG;IACH,aAAa,CAAC,GAAG,GAAE,MAAwB,GAAG,MAAM;IAmBpD;;;OAGG;IACH,MAAM,kBAAmB,MAAM,UAE9B;IAED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