diff --git a/mac.sh b/mac.sh index 3abe4fa..5e8d06e 100644 --- a/mac.sh +++ b/mac.sh @@ -1,12 +1,25 @@ #!/bin/bash # >> Check if curl is installed or nor -if ! command -V curl > /dev/null 2>&1; then +if ! command -v curl > /dev/null 2>&1; then echo "curl not installed, please install it and try again" - exit + exit 1 fi +ARCH=$(uname -m) mkdir -p ffmpeg/bin -curl -L https://github.com/aandrew-me/ffmpeg-builds/releases/download/v8/ffmpeg_mac_arm64 -o ffmpeg/bin/ffmpeg -curl -L https://github.com/aandrew-me/ffmpeg-builds/releases/download/v8/ffprobe_mac_arm64 -o ffmpeg/bin/ffprobe + +if [ "$ARCH" = "arm64" ]; then + FF_URL="https://github.com/aandrew-me/ffmpeg-builds/releases/download/v8/ffmpeg_macos_arm64" + FP_URL="https://github.com/aandrew-me/ffmpeg-builds/releases/download/v8/ffprobe_macos_arm64" +elif [ "$ARCH" = "x86_64" ]; then + FF_URL="https://github.com/aandrew-me/ffmpeg-builds/releases/download/v8/ffmpeg_macos_amd64" + FP_URL="https://github.com/aandrew-me/ffmpeg-builds/releases/download/v8/ffprobe_macos_amd64" +else + echo "Unsupported architecture: $ARCH" + exit 1 +fi + +curl -L "$FF_URL" -o ffmpeg/bin/ffmpeg +curl -L "$FP_URL" -o ffmpeg/bin/ffprobe chmod +x ffmpeg/bin/ffmpeg chmod +x ffmpeg/bin/ffprobe