A opção --trust-server-names deve fazer isso.
--trust-server-names
If this is set to on, on a redirect the last component of the redirection URL will be used as the local file name. By default it is used the last component in the original URL.
Estou tentando baixar todos os arquivos no link principal, todos eles baixam, mas são nomeados de acordo com o link curto separado
wget –content-disposition -i http://ligman.me/2sZVmcG
Um dos resultados:
--2017-08-03 12:12:16-- http://ligman.me/1IW1oab
Connecting to ligman.me (ligman.me)|67.199.248.12|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://download.microsoft.com/DOWNLOAD/D/6/7/D670D322-5771-409E-BF34-5B98496DEB0A/MICROSOFT_PRESS_EBOOK_INTRODUCING_AZURE_PDF.PDF [following]
--2017-08-03 12:12:16-- http://download.microsoft.com/DOWNLOAD/D/6/7/D670D322-5771-409E-BF34-5B98496DEB0A/MICROSOFT_PRESS_EBOOK_INTRODUCING_AZURE_PDF.PDF
Resolving download.microsoft.com (download.microsoft.com)... 23.211.1.18, 2a02:26f0:ce:29c::e59, 2a02:26f0:ce:298::e59
Connecting to download.microsoft.com (download.microsoft.com)|23.211.1.18|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8395026 (8.0M) [application/octet-stream]
Saving to: ‘1IW1oab.2’
1IW1oab.2 100%[===============================================================================================>] 8.01M 5.17MB/s in 1.5s
2017-08-03 12:12:18 (5.17 MB/s) - ‘1IW1oab.2’ saved [8395026/8395026]
Como posso obter wget para salvar o arquivo como seu nome original, que claramente pode ser 'visto'?
A opção --trust-server-names deve fazer isso.
--trust-server-names
If this is set to on, on a redirect the last component of the redirection URL will be used as the local file name. By default it is used the last component in the original URL.
Tags wget