修改doc、优化Mac设置代理等

This commit is contained in:
putyy
2025-02-11 21:40:29 +08:00
parent 69f8224453
commit 8ed7e144e1
10 changed files with 46 additions and 35 deletions

View File

@@ -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. 返回软件首页即可看到资源列表
## 软件截图
![](docs/images/show.webp)
![](docs/images/show.webp)
## 常见问题
m3u8: 预览和下载:

BIN
build/.DS_Store vendored

Binary file not shown.

View File

@@ -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

View File

@@ -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
}

View File

@@ -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) {

View File

@@ -5,5 +5,5 @@
### 简单、高效、轻便 (仅 ~10M)
[开始使用 Let Go](/README.md)
[下载](/README.md)
[开始使用 Let Go](/readme.md)
[下载](/getting-started.md)

View File

@@ -1,4 +1,4 @@
* [简介](README.md)
* [简介](readme.md)
* [快速开始](getting-started.md)
* [安装指南](installation.md)
* [功能演示](examples.md)

View File

@@ -4,8 +4,9 @@
<meta charset="UTF-8">
<title>res-downloader</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<meta name="keywords" content="res-downloader,视频号下载,抖音下载,快手下载,小红书下载,万能下载器,爱享素材,爱享素材下载器">
<meta name="description" content="res-downloader是一款集网络资源嗅探 + 高速下载功能于一体的软件,高颜值、高性能和多样化,提供个人用户下载自己上传到各大平台的网络资源功能!">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
</head>
<body>

View File

@@ -301,7 +301,7 @@ const dataAction = (row: appType.MediaInfo, index: number, type: string) => {
})
break
case "json":
ClipboardSetText(JSON.stringify(row)).then((is: boolean) => {
ClipboardSetText(encodeURIComponent(JSON.stringify(row))).then((is: boolean) => {
if (is) {
window?.$message?.success("复制成功")
} else {
@@ -477,8 +477,7 @@ const triggerEvent = ()=>{
const handleImport = (content: string)=>{
content.split("\n").forEach((line, index) => {
try {
let res = JSON.parse(line)
console.log("handleImport", res)
let res = JSON.parse(decodeURIComponent(line))
if (res && res?.Id) {
res.Id = res.Id + Math.floor(Math.random() * 100000)
res.SavePath = ""