diff --git a/README.md b/README.md index eb34b02..0f70daa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -## res-downloader V3全新版来袭、全新实现,支持更多设置,视频号、直播流、m3u8预览等! -### 爱享素材下载器【[加入群聊](https://qm.qq.com/q/ImE37ayJmc)】 +## res-downloader +### 爱享素材下载器 🎯 基于Go + [wails](https://github.com/wailsapp/wails) 📦 操作简单、可获取不同类型资源 @@ -8,11 +8,13 @@ 💪 支持微信视频号、小程序、抖音、快手、小红书、酷狗音乐、qq音乐等网络资源下载 👼 支持设置代理以获取特殊网络下的资源 -## 软件下载(Win7下载2.3.0版本) -🆕 [github下载](https://github.com/putyy/res-downloader/releases) -🆕 [蓝奏云下载 密码:9vs5](https://wwjv.lanzoum.com/b04wgtfyb) +## [在线文档](https://res.putyy.com/)、[加入群聊](https://qm.qq.com/q/ImE37ayJmc)、[Electron版](https://github.com/putyy/res-downloader/tree/old) -## 使用方法 +## 软件下载(Win7下载2.3.0版本) +🆕 [github下载](https://github.com/putyy/res-downloader/releases) +🆕 [蓝奏云下载 密码:9vs5](https://wwjv.lanzoum.com/b04wgtfyb) + +## 使用方法 > 0. 安装时一定要同意安装证书文件、一定要允许网络访问 > 1. 打开本软件 软件首页左上角点击 “启动代理” > 2. 软件首页选择要获取的资源类型(默认选中的全部) @@ -20,7 +22,7 @@ > 4. 返回软件首页即可看到资源列表 ## 软件截图 - + ## 常见问题 m3u8: 预览和下载: diff --git a/build/.DS_Store b/build/.DS_Store index e6448f3..d957915 100644 Binary files a/build/.DS_Store and b/build/.DS_Store differ diff --git a/build/README.md b/build/README.md index afbf338..13b3939 100644 --- a/build/README.md +++ b/build/README.md @@ -1,16 +1,14 @@ ## Mac ```bash wails build -platform "darwin/universal" -create-dmg 'build/bin/res-downloader.app' \ - --overwrite --dmg-title="res-downloader" \ - --dmg-name "res-downloader_$(jq -r '.info.productVersion' wails.json).dmg" \ - ./build/bin +create-dmg 'build/bin/res-downloader.app' --overwrite ./build/bin +mv -f "build/bin/res-downloader $(jq -r '.info.productVersion' wails.json).dmg" "build/bin/res-downloader_$(jq -r '.info.productVersion' wails.json).dmg" ``` ## Windows ```bash -wails build -f -nsis -platform "windows/amd64" -webview2 Embed -wails build -f -nsis -platform "windows/arm64" -webview2 Embed +wails build -f -nsis -platform "windows/amd64" -webview2 Embed && mv -f "build/bin/res-downloader-amd64-installer.exe" "build/bin/res-downloader_$(jq -r '.info.productVersion' wails.json)_win_x64.exe" +wails build -f -nsis -platform "windows/arm64" -webview2 Embed && mv -f "build/bin/res-downloader-arm64-installer.exe" "build/bin/res-downloader_$(jq -r '.info.productVersion' wails.json)_win_arm.exe" ``` ## Linux diff --git a/core/app.go b/core/app.go index 36f03da..1422966 100644 --- a/core/app.go +++ b/core/app.go @@ -175,7 +175,7 @@ func (a *App) OpenSystemProxy() bool { a.IsProxy = true return true } - DialogErr("设置失败" + err.Error()) + DialogErr("设置失败:" + err.Error()) return false } @@ -188,7 +188,7 @@ func (a *App) UnsetSystemProxy() bool { a.IsProxy = false return true } - DialogErr("设置失败") + DialogErr("设置失败:" + err.Error()) return false } diff --git a/core/system_darwin.go b/core/system_darwin.go index 7fd9f83..e475129 100644 --- a/core/system_darwin.go +++ b/core/system_darwin.go @@ -18,15 +18,32 @@ func (s *SystemSetup) getNetworkServices() ([]string, error) { services := strings.Split(string(output), "\n") - var validServices []string + var activeServices []string for _, service := range services { service = strings.TrimSpace(service) - if service != "" && !strings.Contains(service, "*") && !strings.Contains(service, "Serial Port") { - validServices = append(validServices, service) + if service == "" || strings.Contains(service, "*") || strings.Contains(service, "Serial Port") { + continue + } + + // 检查服务是否活动 + infoCmd := exec.Command("networksetup", "-getinfo", service) + infoOutput, err := infoCmd.Output() + if err != nil { + fmt.Printf("failed to get info for service %s: %v\n", service, err) + continue + } + + // 如果输出中包含 "IP address:",说明服务是活动的 + if strings.Contains(string(infoOutput), "IP address:") { + activeServices = append(activeServices, service) } } - return validServices, nil + if len(activeServices) == 0 { + return nil, fmt.Errorf("no active network services found") + } + + return activeServices, nil } func (s *SystemSetup) setProxy() error { @@ -34,9 +51,6 @@ func (s *SystemSetup) setProxy() error { if err != nil { return err } - if len(services) == 0 { - return fmt.Errorf("find to Network failed") - } is := false for _, serviceName := range services { @@ -56,7 +70,7 @@ func (s *SystemSetup) setProxy() error { return nil } - return fmt.Errorf("find to Network failed") + return fmt.Errorf("failed to set proxy for any active network service") } func (s *SystemSetup) unsetProxy() error { @@ -64,9 +78,6 @@ func (s *SystemSetup) unsetProxy() error { if err != nil { return err } - if len(services) == 0 { - return fmt.Errorf("find to Network failed") - } is := false for _, serviceName := range services { @@ -86,7 +97,7 @@ func (s *SystemSetup) unsetProxy() error { return nil } - return fmt.Errorf("find to Network failed") + return fmt.Errorf("failed to set proxy for any active network service") } func (s *SystemSetup) installCert() (string, error) { diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 38cd6b6..364fbe9 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -5,5 +5,5 @@ ### 简单、高效、轻便 (仅 ~10M) -[开始使用 Let Go](/README.md) -[下载](/README.md) \ No newline at end of file +[开始使用 Let Go](/readme.md) +[下载](/getting-started.md) \ No newline at end of file diff --git a/docs/_sidebar.md b/docs/_sidebar.md index decdefd..8d21d4c 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -1,4 +1,4 @@ -* [简介](README.md) +* [简介](readme.md) * [快速开始](getting-started.md) * [安装指南](installation.md) * [功能演示](examples.md) diff --git a/docs/index.html b/docs/index.html index a7e51a6..984f148 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,8 +4,9 @@