I am having roughly the same problem as in this question, where the problem is, there is a certain URL that, when called in the browser, will download a file, but when called from the command line with
wget, will result in a file called
API.php?bla (where bla is a string). In that earlier question, some answers are given that suggest using the --referer option of wget. This doesn't work for me and besides seems overly complicated.
I am wondering if there is an easier solution: Is it somehow possible to call a URL from the terminal AS IF it were called from the browser, so that it does anything the browser normally does to ensure that the correct file is downloaded? We could use xdg-open, but this would also unnecessarily open a browser window, which is ugly.