#1070146 aria2: The -o option could offer a substitution pattern for the original basename

Package:
aria2
Source:
aria2
Description:
High speed download utility
Submitter:
Manny
Date:
2024-05-01 04:09:04 UTC
Severity:
normal
Tags:
#1070146#5
Date:
2024-04-30 19:50:24 UTC
From:
To:
The -o option is documented as follows:

===8<----------------------------------------
-o, --out=<FILE>
        The file name of the downloaded file.  It is  always  relative  to  the  directory  given  in  --dir  option.   When  the
        --force-sequential option is used, this option is ignored.

        NOTE:
           You  cannot  specify a file name for Metalink or BitTorrent downloads.  The file name specified here is only used when
           the URIs fed to aria2 are given on the command line directly, but not when using --input-file, --force-sequential  op‐
           tion.

           Example:

               $ aria2c -o myfile.zip "http://mirror1/file.zip" "http://mirror2/file.zip"
===8<----------------------------------------

There is an ambiguity in the first sentence: “The file name of the
downloaded file.”  It’s unclear from that phrasing if the parameter
will be taken as the name of the source file or the a potentially new
name. The example disambiguates it but it would be better if the
wording were more clear to begin with so readers are not confused
until they study the example.

Simply changing it to: “The name to give the downloaded file” would
make a difference.

I also suggest introducing a pattern substitution mechanism. It’s very
common to want to preserve the original filename but add something to
the name to clarify what it is. For example, consider this file:

http://download.virtualbox.org/virtualbox/UserManual.pdf

It’s contextually clear from the source path that it’s a user manual
for vbox. But we typically do not want to preserve the original
path. A good filename to produce would be:

  virtualbox_UserManual.pdf

But if there are a lot of files it’s tedious to copy-paste and error
prone to retype them. If a token like “%o” were designated to hold the
original basename, a user could simply write: -o virtualbox_%o.

#1070146#10
Date:
2024-05-01 04:07:36 UTC
From:
To:
forwarded 1070146 https://github.com/aria2/aria2/issues/2207
thanks