Saturday, November 24, 2007

Download all the images in a gallery …

I have the hobby of collecting wallpapers and pics. Its always been a problem to save each image manually as it takes a lot of time to save 100+ images. I have been always thinking to develop a method to download all the images in the gallery at once and developed this trick. You should have download accelerator to perform this trick. You can find many download accelerators in the web of them all i found mass downloader is the best one, you can also use DAP( Download accelerator + ) or IDM ( Internet download manager ).

Here is the trick

Most of the sites save the images of a particular gallery with a common name followed by a number for example “image1″,”image2″,”image3″ and so on, first we are going to get the image url and then use a “C” program to produce a html page ( dload.htm) which contains links to all the images in the gallery.

How to get the url of the image..?

You should have mozilla firefox if you don’t have it you can download it hereFirefox 2
open the gallery which you want to download in mozilla . Now open 3 to 4 images of the gallery , right click on the image and select view image now you will get the url of the image in the address bar compare the urls 3-4 images to find a pattern in them.Now copy the url and replace the url in the code given below with it.Now replace the numbers in the image name which are varying with %d in our case replace “image1″ with “image%d”. You can get the upper limit of “i” by checking the url of the last image

compile and run the code given below after replacing the url and open the dload.htm file produced in your favourite browser right click on any of the link and select download all files with mass downloader in case you installed mass downloader now all the files will be downloaded automatically :)

C code with explanation

#include
main()
{
FILE *fp;
int i;
fp=fopen(”dload.htm”,”w”); /*creates a file named dload.htm */

/*We are using this for loop to write the url’s of the images in to dload.htm */

for(i=0;i<100;i++)

fprintf(fp,”page%d \n”,i,i);

}

Tip : If you want to download more galleries use another for loop changing the url

If you don’t know programming….

Don’t worry,there is a ready made PHP program form you. You just need to enter the Url and the starting and the ending number of the images. Follow this link
Posted under c-programing, Download images, html, php, programming

No comments:

Featured Posts

Adding Accesspolicy to KeyVault for Service Principal Using Portal and Powershell

  Scripts path : https://drive.google.com/drive/folders/1sbBpnVFgXhUIXLdf2E9heyWDeU2f9427?usp=sharing  Adding Accesspolicy to KeyVault for S...