Here is one way to do it. Use at your own risk.
Download https://github.com/talwrii/curlfire
Log into splunkbase.splunk.com with firefox
curlfire will access the firefox cookies so that we can avoid the "please log in to download" message that curl would get.
For this example the app is the splunk add-on for Unix and Linux. The url says it is app 833. These instructions assume we know that the app id number is 833.
After running this command
username@computername:~/Downloads/splunk/curlfire-master$ ./curlfire "https://splunkbase.splunk.com/app/833/" | grep 833 | grep download | grep release
The output is
sb-href="/app/833/release/6.0.0/download/">
sb-href="/app/833/release/5.2.4/download/">
Now we know the Download URL for the latest version is
https://splunkbase.splunk.com/app/833/release/6.0.0/download/
Download the file using curlfire (see notes for curlfire chanages to make it work better below)
username@computername:~/Downloads/splunk/curlfire-master$ ./curlfire "https://splunkbase.splunk.com/app/833/release/6.0.0/download"
Output
curl: Saved to filename 'splunk-add-on-for-unix-and-linux_600.tgz'
Notes
In order to get the download to work properly, 3 flags were changed when curl was run in the curlfire bash file.
Before
curl -b "$curlcookies" "${args[@]}" ;
After
curl -O -J -L -b "$curlcookies" "${args[@]}" ;
option -O Write output to a local file name like the remote file
option -J Tell the -O option to use the filename found in the http header
option -L Follow redirects
Also, after looking at a random script that I downloaded from github I usually will change this.
!/bin/bash
to this.
!/bin/bash -x
in order to display all of the bash scripts commands and their expanded arguments.
And obviously don't forget to change your curl user agent to something common like "I ❤️ splunk."
... View more