bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wget: Adding a prefix to downloaded files?


From: Richard Thomas
Subject: Re: Wget: Adding a prefix to downloaded files?
Date: Thu, 12 Dec 2019 11:15:44 -0600
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

I'd look at why it's important you maintain the sort-order. Options would be to not require that. Or you could pre-sort the input folder so the output folder can be sorted with the same algorithm. Another option would be to generate the wget commands with your prefixes using something like sed.

On 12/12/2019 6:25 AM, address@hidden wrote:
Hi,

I run into a particular problem when I'm trying to download a bunch of URLs I grouped together in file "input.txt" like this:

wget -nv -a log.txt -P .\Images\ -i input.txt

Some of these files are huge, hence take a long time to download.
As a consequence, they will not appear in the same sorting order in the download folder as int he input folder, and that's a problem, as this order has its importance.

I tried working around this problem by sorting the downloaded files using the "Date Created" info in Windows Explorer (that's a field which is not displayed by default, but it can be added to the folder pane as an extra column) But for reasons I don't understand, this order is also different --- maybe because Windows only considers a file as created when it is complete??
Hence, that's no solution either.

So I wonder:
is there a way to add a prefix (or even a counter) to a file when it is downloaded using Wget? This would be a piece of cake if it could be done in the input file "input.txt", but obviously, these are external URLs, hence they cannot be touched. Other tools like DownThemAll (aka "dTa"), the FireFox or Chrome extension which I use when a GUI can be used (as opposed to using a command line tool in a batch file), offers a prefix as a variable for the mask which can be applied to the names of the target files. This prefix is certainly not perfect (lacking a.o. some flexibility), but at least it allows to impose this desired order.
So, does Wget have a similar construct?
Or is there another solution which would preserve the source's file order?


M.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]