Download all images from one website directory

I need to get all the images from one site, which are contained in one folder. For example, (site.com/images/.*). Is it possible? If so, what is the best way?

+8
javascript linux php perl image
source share
5 answers

Take a look at HTTrack . It can load entire sites. Give the site.com/images/ website address and it will load everything in this directory. (if access to the directory is not limited to the owner)

+8
source share

Do you have FTP access?

Do you have shell access?

With Linux, this is pretty easy. Not sure about the windows.

 wget -H -r --level=1 -k -p http://example.com/path/to/images 

Edit: just found wget for windows .

Edit 2: I just saw the PHP tag to create a PHP script that loads all the images in one go, you will have to create a zip archive (or equivalent) and send it with the correct headers. Here's how to encrypt a folder in php , it would be difficult to extract only the images in this folder, just edit the code above to say something like:

 foreach ($iterator as $key=>$value) { if (!is_dir($key)) { $file = basename($key); list($name, $ext) = explode('.', $key); switch ($ext) { case "png": case "gif": case "jpg": $zip->addFile(realpath($key), $key) or die ("ERROR: Could not add file: $key"); break; } } } 
+8
source share

if the site allows indexing, all you need to do is wget -r --no-parent http://site.com/images/

+4
source share

Depends on whether image catalogs are allowed to list content. If so, excellent, otherwise you will need to spider the website to find the entire image link in this directory.

Anyway, look at wget .

+1
source share

If you want to see the images that the web page uses: if you use Chrome, you can simply press F-12 (or find the developer tools in the menu) and on the "Resources" tab, the tree bottom left and then in the "Frames" section "you will see the" Images "folder, after which you will see all the images that the page listed there uses.

0
source share

Source: https://habr.com/ru/post/650786/


All Articles