bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] How to tell wget to strip part following question mark in


From: Tim Rühsen
Subject: Re: [Bug-wget] How to tell wget to strip part following question mark in local filenames?
Date: Wed, 8 May 2013 21:54:43 +0200
User-agent: KMail/1.13.7 (Linux/3.8-1-amd64; KDE/4.8.4; x86_64; ; )

Hi,

Am Mittwoch, 8. Mai 2013 schrieb Mark:
> Hi,
> 
> I noticed some problems relating to URLs like
>   
http://www.example.com/path/to/filename.zip?arg1=somestring&arg2=anotherstring&;...
> 
> Wget doesn't strip the ? and following characters from the filename when
> creating local files. As far as I can tell it doesn't have an option to do
> that. This can cause several problems:
> 
>  - Local filenames have "garbage" following the actual extension which the
> user has to manually remove.

In many (most?) cases this is not garbage.
It is common, that different argument values returns different content.
To change the output file name for single downloads, use -O / --output-
document.

>  - Depending on the web server, each download session may result in unique
> arguments in the URL (e.g. some kind of session ID), making it impossible
> to easily resume downloading partially-downloaded files. Wget would
> instead re-download the whole file, saving it under a different name.

When to resume a download, you are not in --recursive mode.
Again, -O should do it.

>  - The worst problem is that when the arguments following the actual
> filename in the URL are very long, wget is unable to create the file at
> all, reporting
>   File name too long

Again, this is only a problem when in recursive mode.
Here, a hash string (e.g. sha1 or md5) instead of the query part (and / or the 
filename part) could be helpful.
If needed, Wget could create a flat text file that maps hash codes to real 
filenames / urls in this cases.

Anyone with other ideas ?

> So this message is to suggest adding an option to tell wget to strip a
> question mark and everything after that from the filename part of URLs to
> get the local file name.

Thanks for your suggestion.

Regards, Tim



reply via email to

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