From d7e34d9c216188a13cd54e55e853ddfa832b74a4 Mon Sep 17 00:00:00 2001 From: putyy Date: Tue, 29 Oct 2024 10:51:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84content=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 +++++++++ electron/main/proxyServer.ts | 18 +++++++++--------- electron/main/utils.ts | 1 + 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 22f9c5a..4ca1bd7 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,12 @@ ![](public/show.webp) ## 常见问题 +m3u8预览和下载: +> [下载](https://m3u8-down.gowas.cn/) [预览](https://m3u8play.com/) + +直播流 预览和录制: +> [使用obs进行预览和录制]( https://obsproject.com/) + 下载慢、大视频下载失败(最新版本以内置aria2下载器) > 推荐使用如下工具加速下载,视频号可以下载完成后再到对应视频操作项选择 “视频解密(视频号)” 按钮 >> [Neat Download Manager](https://www.neatdownloadmanager.com/index.php/en/)、[Motrix](https://motrix.app/download)等软件进行下载 @@ -59,6 +65,9 @@ yarn run build --universal --mac # 打包win yarn run build --win + +# 打包win +yarn run build --linux ``` ## 实现&初衷 diff --git a/electron/main/proxyServer.ts b/electron/main/proxyServer.ts index b214313..a3929b3 100755 --- a/electron/main/proxyServer.ts +++ b/electron/main/proxyServer.ts @@ -46,15 +46,15 @@ export async function startServer({win, upstreamProxy, setProxyErrorCallback = f cert: fs.readFileSync(CONFIG.CERT_PUBLIC_PATH), }, }) - .listen(port, () => { - setProxy('127.0.0.1', port) - .then((res) => { - resolve() - }) - .catch((err) => { - setProxyErrorCallback(err) - reject('setting proxy err: ' + err.toString()) - }); + .listen(port, async () => { + try { + await setProxy('127.0.0.1', port) + resolve() + } catch (err) { + console.error(err); + setProxyErrorCallback(err) + reject("请手动设置系统代理" + err.toString()) + } }) .on('error', err => { setProxyErrorCallback(err) diff --git a/electron/main/utils.ts b/electron/main/utils.ts index 0a7c159..e6c8f5a 100755 --- a/electron/main/utils.ts +++ b/electron/main/utils.ts @@ -140,6 +140,7 @@ function typeSuffix(type: string) { case "audio/webm": case "audio/mp4": case "audio/mp3": + case "audio/mp4;charset=UTF-8": return ["audio", ".mp3"]; case "application/vnd.apple.mpegurl": case "application/x-mpegURL":