wget

James Dugger james.dugger at gmail.com
Tue Jan 27 13:45:20 MST 2015


Todds answer is perfect as long as the filenames to be downloaded are
explicitly named.  However the image files that you are downloading are
named based on a query string and are hashed with filename that is longer
than the allowable character limit of a filename in Linux.  So the wget
will fail. You need use the -O option which allows you to rename the file
as you download it but it can only be used for a single file not
recursively.

you could do this for a single file case:

$ wget -O new_image_name.jpg http://url-to-image-name

Normally the -r and -A options will add a numerical suffix if it encounters
another file with the same name, however option -O turns suffixing off, so
it is only good for one file at a time.  You could write a small bash
script to handle it:

#!usr/env/bin/ bash

while read -r image
  do
  output=`echo $image | cut -c 1-50`
  wget "${image}" -O "${output}"
done < ./images.txt


On Tue, Jan 27, 2015 at 1:05 PM, Michael Havens <bmike1 at gmail.com> wrote:

> Todd.... I am so glad I asked the question. I wondered if there was a way
> to do the 'A' option. Now I know! So cool.
>
> :-)~MIKE~(-:
>
> On Tue, Jan 27, 2015 at 12:26 PM, Todd Millecam <tyggna at gmail.com> wrote:
>
>>  wget -r -A jpg -P /tmp/
>> http://sites.google.com/site/thebookofgimp/home/chapter-2-photograph-retouching/
>>
>> will put them all in /tmp/
>> sites.google.com/bookofgim/home/chapter-2-photograph-retouching
>>
>> On Tue, Jan 27, 2015 at 12:12 PM, Michael Havens <bmike1 at gmail.com>
>> wrote:
>>
>>> H0w can I us wget to retrieve the photos here
>>> <http://the-book-of-gimp.blogspot.com/p/chapter-2-photograph-retouching.html>.
>>> I tried:
>>>
>>> wget -r
>>> http://the-book-of-gimp.blogspot.com/p/chapter-2-photograph-retouching.html
>>>
>>> but it didn't download the pictures. It downloaded a bunch of web pages.
>>> :-)~MIKE~(-:
>>>
>>> ---------------------------------------------------
>>> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
>>> To subscribe, unsubscribe, or to change your mail settings:
>>> http://lists.phxlinux.org/mailman/listinfo/plug-discuss
>>>
>>
>>
>>
>> --
>> Todd Millecam
>>
>> ---------------------------------------------------
>> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
>> To subscribe, unsubscribe, or to change your mail settings:
>> http://lists.phxlinux.org/mailman/listinfo/plug-discuss
>>
>
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.phxlinux.org/mailman/listinfo/plug-discuss
>



-- 
James

*Linkedin <http://www.linkedin.com/pub/james-h-dugger/15/64b/74a/>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phxlinux.org/pipermail/plug-discuss/attachments/20150127/1e96c3d6/attachment.html>


More information about the PLUG-discuss mailing list