feat: implement multi-part/playlist support and fix IPC crashes

This commit is contained in:
2026-02-16 00:33:52 +02:00
parent 19905a75e8
commit 18f04143ea
5 changed files with 5403 additions and 0 deletions

12
preload.js Normal file
View File

@@ -0,0 +1,12 @@
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('electronAPI', {
detectVideos: (url) => ipcRenderer.invoke('detect-videos', url),
startDownload: (url, formatId, extractAudio, audioFormat, title, downloadPlaylist) => ipcRenderer.invoke('start-download', { url, formatId, extractAudio, audioFormat, title, downloadPlaylist }),
cancelDownload: () => ipcRenderer.invoke('cancel-download'),
onProgress: (callback) => ipcRenderer.on('download-progress', (event, data) => callback(data)),
onComplete: (callback) => ipcRenderer.on('download-complete', (event, data) => callback(data)),
onError: (callback) => ipcRenderer.on('download-error', (event, message) => callback(message)),
onStatus: (callback) => ipcRenderer.on('download-status', (event, data) => callback(data))
});