I am currently trying to write a bash script on a linux machine to settle the environment for my project. I need to use specific version of Meshroom binaries which you can get from https://www.fosshub.com/Meshroom-old.html?dwl=Meshroom-2019.2.0-linux.tar.gz
If you directly click the link, the link will lead you to another website while simultaneously downloading the pre compiled binary
However, since the website is not an actual download link, directly wget <link> won't work. How can i download the target file through terminal then?
Thanks a lot for you help!
CodePudding user response:
You can start the download in the browser, pause it, go to the download page in the browser and see the real URL.
Then you can take it and use it in wget.
CodePudding user response:
I do not think you will get this working without a JavaScript engine. Most likely the link gets crafted by JavaScript. Wget and Curl can not do this.
If you use the network monitor of Firefox, you will find the menu entry Copy as cURL address. This will give you the following command for the download:
curl 'https://download.fosshub.com/Protected/expiretime=1643262581;badurl=aHR0cHM6Ly93d3cuZm9zc2h1Yi5jb20vaHR0cHM6JiN4MkY7JiN4MkY7Zm9zc2h1Yi5jb20mI3gyRjtNZXNocm9vbS1vbGQuaHRtbA==/15114e8a159778c5070c8f4840c98dda1c6afe1d173182137c0f14ac62bc3686/5c6fe99776dd983e3dec2213/5d542fd4ac7f050a7d2389e0/Meshroom-2019.2.0-linux.tar.gz' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0' -H 'Accept: text/html,application/xhtml xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' -H 'Accept-Language: de,en-US;q=0.7,en;q=0.3' -H 'Accept-Encoding: gzip, deflate, br' -H 'Referer: https://www.fosshub.com/' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -H 'Sec-Fetch-Dest: document' -H 'Sec-Fetch-Mode: navigate' -H 'Sec-Fetch-Site: same-site'
You can add the option --output Meshroom-2019.2.0-linux.tar.gz to store the download with the right file name. This works fine, I have just tested it.
But as you can see by the attribute expiretime=1643262581, this link will not work forever. If the number is the number of seconds since epoch
$ echo $(((1643262581 - $(date %s))/60/60))
13
then the link and the curl command will work for halve a day.
CodePudding user response:
When I started the download, it actually came from:
https://download.fosshub.com/Protected/expiretime=1643256991;badurl=aHR0cHM6Ly93d3cuZm9zc2h1Yi5jb20vaHR0cHM6JiN4MkY7JiN4MkY7Zm9zc2h1Yi5jb20mI3gyRjtNZXNocm9vbS1vbGQuaHRtbA==/93f2ee74b2853766fd7d063c92e0971bce67988102a9bf8a802de8858baeb0e4/5c6fe99776dd983e3dec2213/5d542fd4ac7f050a7d2389e0/Meshroom-2019.2.0-linux.tar.gz
I doubt you'll be able to do that automatically from wget/curl. However, you could try what I have just posted.
