Skip to content

Commit

Permalink
downloa with token
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanb committed Jun 24, 2024
1 parent 9a3eb7c commit c29664b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion getSource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,19 @@ echo Running on: "${machine}", using $SEDCMD and $STATCMD commands
function downloadFile() {
mkdir -p "${DownloadDest}"
echo "Downloading ${DownloadDest}$3..."
urlWithToken=$(curl \
--compressed \
--fail \
--progress-bar \
"https://ipi.eprostor.gov.si/jgp-service-api/display-views/groups/$1/composite-products/$2/file?filterParam=DRZAVA&filterValue=1" | jq -r ".url")

echo "urlWithToken: $urlWithToken"
curl \
--compressed \
--output "${DownloadDest}$3" \
--fail \
--progress-bar \
"https://ipi.eprostor.gov.si/jgp-service-api/display-views/groups/$1/composite-products/$2/file?filterParam=DRZAVA&filterValue=1"
"$urlWithToken" || (echo "Failed to download $3" && exit 1)
}

function extractDownloaded() {
Expand Down

0 comments on commit c29664b

Please sign in to comment.