From 652708388eab335eb29151d13ac764cc17ed1269 Mon Sep 17 00:00:00 2001 From: Silke Hofstra Date: Sun, 27 Oct 2024 20:26:49 +0100 Subject: [PATCH] fix(solus): update Solus URLs The latest Solus release has changed the naming of ISOs: - Update all related functions to support the ISO name format used in the latest release. - Use the directory listings in order to support more releases in the future. --- quickget | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/quickget b/quickget index 9888fa9..ac01549 100755 --- a/quickget +++ b/quickget @@ -1006,12 +1006,12 @@ function releases_slitaz() { function releases_solus() { #shellcheck disable=SC2046,SC2005 - echo $(web_pipe "https://getsol.us/download/" | grep "isos" | grep Download | cut -d'-' -f 2 | sort -ru) + echo $(web_pipe_json "https://downloads.getsol.us/isos/" | jq -r '.[].name[:-1]' | grep -E "^[0-9-]+$" | sort -u) } function editions_solus() { #shellcheck disable=SC2046,SC2005 - echo $(web_pipe "https://getsol.us/download/" | grep "isos" | grep Download | cut -d'.' -f5 | cut -d'-' -f2- | sort -u) + echo $(web_pipe_json "https://downloads.getsol.us/isos/$(releases_solus | tail -n1)/" | jq -r '.[].name | sub("Solus-(?.*)-Release-.*"; "\(.e)")' | sort -u) } function releases_sparkylinux() { @@ -1184,6 +1184,11 @@ function web_pipe() { curl --silent --location "${1}" } +# Download a JSON file from the web and pipe it to stdout +function web_pipe_json() { + curl --silent --location --header "Accept: application/json" "${1}" +} + # Download a file from the web function web_get() { local CHECK="" @@ -2461,7 +2466,7 @@ function get_slitaz() { function get_solus() { local HASH="" - local ISO="Solus-${RELEASE}-${EDITION}.iso" + local ISO="Solus-${EDITION}-Release-${RELEASE}.iso" local URL="https://downloads.getsol.us/isos/${RELEASE}" HASH=$(web_pipe "${URL}/${ISO}.sha256sum" | cut -d' ' -f1) echo "${URL}/${ISO} ${HASH}"