Como fazer o download do arquivo de dados com o link php (URL dinâmica) e faça o login com o wget

0

Durante o download de um link do banco de dados Human 3.6 M, recebi o seguinte erro.

user@ubuntu:/disk1/user/Human_3.6m_data$ bash download0.sh
user@ubuntu:/disk1/user/Human_3.6m_data$ --2017-12-18 23:52:10--  http://vision.imar.ro/human3.6m/filebrowser.php?download=1
Connecting to [ip address]... connected.
Proxy request sent, awaiting response... 302 Found
Location: main_login.php [following]
--2017-12-18 23:52:11--  http://vision.imar.ro/human3.6m/main_login.php
Reusing existing connection to [ip address].
Proxy request sent, awaiting response... 302 Found
Location: https://vision.imar.ro/human3.6m/main_login.php [following]
--2017-12-18 23:52:11--  https://vision.imar.ro/human3.6m/main_login.php
Connecting to [ip address]... connected.
WARNING: cannot verify vision.imar.ro's certificate, issued by ‘emailAddress=root@vision,CN=vision,OU=SomeOrganizationalUnit,O=SomeOrganization,L=SomeCity,ST=SomeState,C=--’:
   Self-signed certificate encountered.
     WARNING: certificate common name ‘vision’ doesn't match requested host name ‘vision.imar.ro’.
Proxy request sent, awaiting response... 200 OK
Length: 2600 (2.5K) [text/html]
Saving to: ‘filebrowser.php?download=1.1’

filebrowser.php?download=1.1                    100%[====================================================================================================>]   2.54K  --.-KB/s    in 0s

2017-12-18 23:52:13 (74.0 MB/s) - ‘filebrowser.php?download=1.1’ saved [2600/2600]

Link para download é

http://vision.imar.ro/human3.6m/filebrowser.php?download=1&filepath=Videos&filename=ActivitySpecific_1.tgz&downloadname=Directions

Eu usei esses comandos do linux:

wget --no-check-certificate --user usr --password pswd http://vision.imar.ro/human3.6m/filebrowser.php?download=1&filepath=Videos&filename=ActivitySpecific_1.tgz&downloadname=Directions

wget --no-check-certificate --trust-server-names --user usr --password pswd -O Directions http://vision.imar.ro/human3.6m/filebrowser.php?download=1&filepath=Videos&filename=ActivitySpecific_1.tgz&downloadname=Directions

Os dados reais têm 6 GB de tamanho.

    
por Harsh Patel 18.12.2017 / 12:01

1 resposta

2

Primeiro você deve citar o URL:

wget --no-check-certificate --user usr --password pswd \
'http://vision.imar.ro/human3.6m/filebrowser.php?download=1&filepath=Videos&filename=ActivitySpecific_1.tgz&downloadname=Directions'

Caso contrário, tudo após o primeiro & é cortado pelo shell, e você também verá isso:

[1] 20618
[2] 20619
[1]-  Done                    filepath=Videos
$ 
[2]+  Done                    filename=ActivitySpecific_1.tgz

Em segundo lugar, o arquivo pequeno foi provavelmente isso.

As opções --user e --password geralmente não funcionam. Para logins baseados em cookies, você precisa fazer algo assim (Adaptado de info at man wget , / , --post ):

wget --no-check-certificate --keep-session-cookies --save-cookies cookies.txt \
--post-data 'username=foo&password=bar' \
'https://vision.imar.ro/human3.6m/checklogin.php'

# Now grab the page or pages we care about.
wget --no-check-certificate --load-cookies cookies.txt \
'https://vision.imar.ro/human3.6m/filebrowser.php?download=1&filepath=Videos&filename=ActivitySpecific_1.tgz&downloadname=Directions'
    
por Martin Thornton 18.12.2017 / 13:02