Answer the question
In order to leave comments, you need to log in
How to download a file via the command line in Linux?
There is hosting Beget.ru You
need to download a large backup and put it on another server.
The hoster has generated a link to download a file of the form https://cp.beget.ru/backup/download/file123123123
When you open this link, if there was no authorization before, the browser redirects to the login page, otherwise it allows you to download.
On GUI machines, of course, there are no problems, but what about the servers, where do I want to actually transfer this backup?
There is a Linux server, on debian 9. I tried to download via WGET with the indication of cookies, but it did not work.
I would be grateful for any help!
Ps I ask you not to offer the option of jumping and applause, because My internet is a miserable 10 Mb/s. And if you download through the server, then over 150 mb / s!
Answer the question
In order to leave comments, you need to log in
Try to start downloading in the browser, and in the developer tools, the Network tab in FireFox, if you right-click on the download of this file, there is an item Copy - Copy as cURL:
The copied command includes all the correct headers, cookies, etc.
Don't forget to direct the output of the command to a file , otherwise an unreadable binary mess will fall on the screen.
Add a greater than sign and the name of the file where to save to the command: curl -всякие опции и ссылка > file.zip
Should work from the command line, unless the cookie is bound to the uploader's IP.
ssh -ND 5555 my_ssh_host_config_name
где в файле ~/.ssh/config
указан конфиг хоста: Host my_ssh_host_config_name
HostName 123.12.12.123
Port 1234
User username
IdentityFile ~/.ssh/id_rsa
127.0.0.1
, Port: 5555
, SOCKS v5
Can't get a direct link?
Did you do it this way?
wget --user=login --password='pass' --save-cookies=cooke -U "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5" "http://xxxxxxxxxxx/"
wget --load-cookies=cooke --keep-session-cookies -U "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5" "http://xxxxxxxxxxx/download.php?id=8762&name=xxxxxxxxxxx"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question