Results 1 to 6 of 6

Thread: Download images from internet

  1. #1
    Join Date
    Jun 2008
    Location
    Chicago
    Beans
    202
    Distro
    Ubuntu 14.04 Trusty Tahr

    Download images from internet

    I want to google images but I don't want to download one by one, how can I
    Download a google website full of images in one shot?
    Fertech

  2. #2
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Download images from internet

    1. What images do you want, pictures or iso images or some other kind of image files?

    2. It depends on the web-site what is possible to do. If you can connect via wget, it is easy to download several images in one shot.

    Code:
    man wget

  3. #3
    Join Date
    Jun 2008
    Location
    Chicago
    Beans
    202
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Download images from internet

    .jpg and .png
    Fertech

  4. #4
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Download images from internet

    If the owners of the website wants people to download many files, they might make it easy by setting up anonymous ftp, so that you can connect via ftp and use
    Code:
    mget *
    or some GUI tool to get all files in a particular directory.

    You can try with wget, but the owners of the website might not want massive downloading, so they might have made it hard to connect via wget. See the next post by ofnuts. Anyway, it might work, so try it.

    As an example, you can try the following command, which should download a png file illustrating a tool to make USB boot drives by cloning iso files and compressed image files.

    Code:
    wget 'https://help.ubuntu.com/community/mkusb/pictures?action=AttachFile&do=get&target=13-toggle-USB-only_show-all-drives.png'
    works but gives you an ugly file name. This command creates a nicer file name

    Code:
    wget -O 13-toggle-USB-only_show-all-drives.png 'https://help.ubuntu.com/community/mkusb/pictures?action=AttachFile&do=get&target=13-toggle-USB-only_show-all-drives.png'
    It is hard to get several files with one command, when the files are stored like that, because you must create a list and then use that list.

    Another example shows that it can be easier, when the files are there like at the web page http://phillw.net/isos/linux-tools/mkusb/

    Cut and paste the list of content to an editor, remove everything except the file names, and you get

    Code:
    md5sum.txt.asc
    mkUSB-quick-start-manual-74.pdf
    mkUSB-quick-start-manual.pdf
    mkusb
    mkusb-old
    mkusb-old-plus-minor-fix
    mkusb74
    which you save as the file 'list'. Then this command will download all those files

    Code:
    while read i;do wget "http://phillw.net/isos/linux-tools/mkusb/$i";done<list
    Last edited by sudodus; August 3rd, 2014 at 10:29 AM. Reason: updated the text according to ofnut's explanation

  5. #5
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,172
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Download images from internet

    They cannot disable wget. What they can try to do is:
    • check the "user agent" string, but wget allows you specify the user agent, so you can spoof a regular browser
    • prevent "hot linking" (ie, serve images only if they are referred to by one page on the site) but wget also lets you specify a forged "referer" (sic) URL


    What you cannot bypass (unless you have a botnet ) is the server limiting traffic per IP address (and banning your address in case of abuse)

    If the images are stored with consecutive numbers, you can take advantage the brace expansion in bash:
    Code:
    wget http://some.site.on.the.net/images/image{000..100}.png
    Warning: unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.

  6. #6
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Download images from internet

    Thanks ofnuts, I'll edit my post accordingly

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •