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

Re: wget file name is too long



On Sun, Apr 26, 2009 at 15:07:19 +0200, Erik Xavior wrote:
> $ wget -tc '?' URL
> wget: --tries: Invalid number `c'.
> 
> $ wget --trimcharacter '?' URL
> wget: unrecognized option `--trimcharacter'
> Usage: wget [OPTION]... [URL]...
> 
> Try `wget --help' for more options.
> 
> 
> man wget says nothing about -tc
> my wget version: 1.11.4-2
> 
> 
> "--content-disposition" still gives "filename too long"

Base on your original statement of the problem (please try to keep the
relevant context in the messages as the discussion progress), something
like this might be an acceptable, though clunky, solution:

for URL in $(script); do wget -O $(echo "${URL#*://}" | tr / _) "$URL"; done

This bash-snippet loops of the URLs in the output of your script and
calls wget such that each page is saved under the name of the original,
non-redirected URL. Basic sanitizing of the output filenames is
performed by removing the scheme name from the beginning of the URLs and
replacing all slashes with underscores.

-- 
Regards,            | http://users.icfo.es/Florian.Kulzer
          Florian   |


Reply to: