jq sort_by for getteng latest ffmpeg release

This commit is contained in:
Maksim Ivanov
2025-08-28 14:22:22 +03:00
committed by GitHub
parent c71d341623
commit 74b21fee16

View File

@@ -53,8 +53,8 @@ fi
printf 'Getting download links...\n' printf 'Getting download links...\n'
##ffmpeg ##ffmpeg
readonly FFMPEG_URL_MAIN=$(curl -sL4 $FFMPEG_SRC_MAIN | jq -r '.[0].assets[0].browser_download_url') readonly FFMPEG_URL_MAIN=$(curl -sL4 $FFMPEG_SRC_MAIN | jq -rS sort_by(.published_at).[-1].assets[0].browser_download_url)
readonly FFMPEG_URL_ALT=$(curl -sL4 $FFMPEG_SRC_ALT | jq -r '.[0].assets[0].browser_download_url') readonly FFMPEG_URL_ALT=$(curl -sL4 $FFMPEG_SRC_ALT | jq -rS sort_by(.published_at).[-1].assets[0].browser_download_url)
[[ $(basename $FFMPEG_URL_ALT) < $(basename $FFMPEG_URL_MAIN) ]] && readonly FFMPEG_URL=$FFMPEG_URL_MAIN || readonly FFMPEG_URL=$FFMPEG_URL_ALT [[ $(basename $FFMPEG_URL_ALT) < $(basename $FFMPEG_URL_MAIN) ]] && readonly FFMPEG_URL=$FFMPEG_URL_MAIN || readonly FFMPEG_URL=$FFMPEG_URL_ALT
if [[ -z $FFMPEG_URL ]]; then if [[ -z $FFMPEG_URL ]]; then
printf 'Failed to get ffmpeg download URL. Exiting...\n' printf 'Failed to get ffmpeg download URL. Exiting...\n'