I have a list of URIs in a file uris.txt
:
http://example.com/file1.pdf
http://example.com/file2.pdf
http://example.com/Folder/file3.pdf
http://example.com/Folder/Subfolder/file4.pdf
The resulting directory structure on my HDD is supposed to be as follows:
|
|-file1.pdf
|-file2.pdf
|-Folder
|-file3.pdf
|-Subfolder
|-file4.pdf
My current command is: wget -i uris.txt -P downloads
Unfortunately, wget flattens all directories, i.e. the filename is determined by concatenating the base directory (given by -P on the command line) and the last part of the URI's path.
Maintaining the directory structure a server serves is possible, albeit only with the recursive mode, which only operates on HTML and CSS as opposed to a given list of URIs.