diff --git a/scripts/fix-opera.sh b/scripts/fix-opera.sh index f059b62..9cd1171 100755 --- a/scripts/fix-opera.sh +++ b/scripts/fix-opera.sh @@ -53,8 +53,8 @@ fi printf 'Getting download links...\n' ##ffmpeg -readonly FFMPEG_URL_MAIN=$(curl -sL4 $FFMPEG_SRC_MAIN | jq -r '.[0].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_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 -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 if [[ -z $FFMPEG_URL ]]; then printf 'Failed to get ffmpeg download URL. Exiting...\n'