Google image download with python cannot download images

Amith picture Amith · Feb 24, 2020 · Viewed 8.5k times · Source

I'm using google_images_download library to download top 20 images for a keyword. It's worked perfectly when I'm using it last days. Code is as follows.

from google_images_download import google_images_download

response = google_images_download.googleimagesdownload()

arguments = {"keywords":keyword,"limit":10,"print_urls":True}
paths = response.download(arguments)

Now it gives following error.

Evaluating...
Starting Download...


Unfortunately all 10 could not be downloaded because some images were not downloadable. 0 is all we got for this search filter!

Errors: 0

How can I solve this error.

Answer

Hiranya Jayakody picture Hiranya Jayakody · Mar 6, 2020

There has been some changes on Google end (how they respond to the request) which results in this issue. Joeclinton1 on github has done some modifications to the original repo which provides a temporary fix.

You can find the updated repo here: https://github.com/Joeclinton1/google-images-download.git . The solution is in patch-1 branch if I'm not mistaken.

  1. First uninstall the current version of google_images_download.

  2. Then manually install Joeclinton1's repo by:

git clone https://github.com/Joeclinton1/google-images-download.git
cd google-images-download && sudo python setup.py install #no need for 'sudo' on windows Anaconda environment

or to install it with pip

pip install git+https://github.com/Joeclinton1/google-images-download.git

This should solve the problem. Note that currently this repo only supports upto 100 images.