feat: detect OS and use the ffmpeg exe name

This commit is contained in:
José Carlos Cuevas 2023-12-06 19:35:10 +01:00
parent f3cf682b38
commit 56cc38144d

10
main.go
View file

@ -46,6 +46,7 @@ import (
"net/url"
"os"
"os/exec"
"runtime"
"strings"
"time"
@ -283,10 +284,15 @@ func loadImageURL(url string) image.Image {
}
func main() {
RADIOSPIRAL_STREAM := "https://radiospiral.radio/stream.mp3"
RADIOSPIRAL_JSON_ENDPOINT := "https://radiospiral.net/wp-json/radio/broadcast"
const RADIOSPIRAL_STREAM = "https://radiospiral.radio/stream.mp3"
const RADIOSPIRAL_JSON_ENDPOINT = "https://radiospiral.net/wp-json/radio/broadcast"
PLAYER_CMD := "ffmpeg"
if runtime.GOOS == "windows" {
log.Println("Detected Windows")
PLAYER_CMD = "ffmpeg.exe"
}
// Command line arguments parsing
loggingToFilePtr := flag.Bool("log", false, "Create a log file")