diff --git a/README.md b/README.md index b8ed2af..7a441f6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ afkarxyz%2FSpotiFLAC | Trendshift -Get Spotify tracks in true FLAC from Tidal, Qobuz, Amazon Music & Deezer — no account required. +Get Spotify tracks in true FLAC from Tidal, Qobuz & Amazon Music — no account required. ![Windows](https://img.shields.io/badge/Windows-10%2B-0078D6?style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiB2aWV3Qm94PSIwIDAgMjAgMjAiPjxwYXRoIGZpbGw9IiNmZmZmZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTIwIDEwLjg3M1YyMEw4LjQ3OSAxOC41MzdsLjAwMS03LjY2NEgyMFptLTEzLjEyIDBsLS4wMDEgNy40NjFMMCAxNy40NjF2LTYuNTg4aDYuODhaTTIwIDkuMjczSDguNDhsLS4wMDEtNy44MUwyMCAwdjkuMjczWk02Ljg3OSAxLjY2NmwuMDAxIDcuNjA3SDBWMi41MzlsNi44NzktLjg3M1oiLz48L3N2Zz4=) ![macOS](https://img.shields.io/badge/macOS-10.13%2B-000000?style=for-the-badge&logo=apple&logoColor=white) @@ -18,9 +18,9 @@ Get Spotify tracks in true FLAC from Tidal, Qobuz, Amazon Music & Deezer — no ## Other projects -### [SpotiFLAC Next](https://github.com/spotiverse/SpotiFLAC-Next) +### [SpotiFLAC Next](https://github.com/afkarxyz/SpotiFLAC-Next) -Get Spotify tracks in Hi-Res lossless FLACs — no account required. +Get Spotify tracks in true FLAC from Tidal, Qobuz, Amazon Music & Deezer — no account required. ### [SpotiDownloader](https://github.com/afkarxyz/SpotiDownloader) @@ -88,7 +88,7 @@ The software is provided "as is", without warranty of any kind. The author assum ## API Credits -[MusicBrainz](https://musicbrainz.org) · [Spotify Lyrics API](https://github.akashrchandran.in/spotify-lyrics-api) · [LRCLIB](https://lrclib.net) · [Song.link](https://song.link) · [hifi-api](https://github.com/binimum/hifi-api) · [dabmusic.xyz](https://dabmusic.xyz) · [yoinkify.lol](https://github.com/chasemarshall/yoink) +[MusicBrainz](https://musicbrainz.org) · [LRCLIB](https://lrclib.net) · [Song.link](https://song.link) · [hifi-api](https://github.com/binimum/hifi-api) · [dabmusic.xyz](https://dabmusic.xyz) > [!TIP] > diff --git a/backend/ffmpeg.go b/backend/ffmpeg.go index 92cadb8..a84bfa9 100644 --- a/backend/ffmpeg.go +++ b/backend/ffmpeg.go @@ -81,6 +81,28 @@ 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 @@ -105,6 +127,28 @@ 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