This commit is contained in:
afkarxyz
2026-03-11 03:19:59 +07:00
parent d495a9851c
commit b3273b7602
42 changed files with 1807 additions and 1655 deletions
+1 -45
View File
@@ -81,28 +81,6 @@ func GetFFmpegPath() (string, error) {
return localPath, nil
}
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
homebrewPath := "/opt/homebrew/bin/" + ffmpegName
if _, err := os.Stat(homebrewPath); err == nil {
return homebrewPath, nil
}
} else if runtime.GOOS == "darwin" && runtime.GOARCH == "amd64" {
homebrewPath := "/usr/local/bin/" + ffmpegName
if _, err := os.Stat(homebrewPath); err == nil {
return homebrewPath, nil
}
}
if runtime.GOOS != "windows" {
path, err := exec.Command("which", ffmpegName).Output()
if err == nil {
trimmed := strings.TrimSpace(string(path))
if trimmed != "" {
return trimmed, nil
}
}
}
path, err := exec.LookPath(ffmpegName)
if err == nil {
return path, nil
@@ -127,28 +105,6 @@ func GetFFprobePath() (string, error) {
return localPath, nil
}
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
homebrewPath := "/opt/homebrew/bin/" + ffprobeName
if _, err := os.Stat(homebrewPath); err == nil {
return homebrewPath, nil
}
} else if runtime.GOOS == "darwin" && runtime.GOARCH == "amd64" {
homebrewPath := "/usr/local/bin/" + ffprobeName
if _, err := os.Stat(homebrewPath); err == nil {
return homebrewPath, nil
}
}
if runtime.GOOS != "windows" {
path, err := exec.Command("which", ffprobeName).Output()
if err == nil {
trimmed := strings.TrimSpace(string(path))
if trimmed != "" {
return trimmed, nil
}
}
}
path, err := exec.LookPath(ffprobeName)
if err == nil {
return path, nil
@@ -295,7 +251,7 @@ func downloadAndExtract(url, destDir string, progressCallback func(int), progres
if err != nil {
return fmt.Errorf("failed to create request: %w", err)
}
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36")
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36")
resp, err := client.Do(req)
if err != nil {