1

I am trying to run the following code to download images using the google_images_download package `

from google_images_download import google_images_download

response = google_images_download.googleimagesdownload()
arguments = {"keywords":"lilly,hills","limit":5,"print_urls":True}
paths = response.download(arguments)

print(paths)

The excepted output is as follows

Image URL: https://assets.traveltriangle.com/blog/wp-content/uploads/2017/11/Hill-Stations-Near-Kolkata-cover1-400x267.jpg
Completed Image ====> 4.Hill-Stations-Near-Kolkata-cover1-400x267.jpg
Image URL: https://image.shutterstock.com/image-photo/distant-hills-hilly-steppe-curvy-260nw-1037414248.jpg
Completed Image ====> 5.distant-hills-hilly-steppe-curvy-260nw-1037414248.jpg
({'lilly': ['C:\\python3\\downloads\\lilly\\1.Lilly-Tougas.jpg', 
'C:\\python3\\downloads\\lilly\\2.1200px-Eli_Lilly_and_Company.svg.png', '
C:\\python3\\downloads\\lilly\\3.nikki-lilly-this-morning.jpg', 
'C:\\python3\\downloads\\lilly\\4.lily-plants.jpg', 
'C:\\python3\\downloads\\lilly\\5.dish-lilly-ghalichi.jpg'], 
'hills': ['C:\\python3\\downloads\\hills\\1.220px-Clouds_over_hills.jpg', 
'C:\\python3\\downloads\\hills\\2.Bacin_zari_2015.jpg', 
'C:\\python3\\downloads\\hills\\3.65ad9ac0-0455-4086-a4f4-1245f697d10e.png', 
'C:\\python3\\downloads\\hills\\4.Hill-Stations-Near-Kolkata-cover1-400x267.jpg', 
'C:\\python3\\downloads\\hills\\5.distant-hills-hilly-steppe-curvy-260nw-1037414248.jpg']}, 1)

But what I get is as follows

Item no.: 1 --> Item name = lilly
Evaluating...
Starting Download...


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

Errors: 0


Item no.: 2 --> Item name = hills
Evaluating...
Starting Download...


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

Errors: 0

({'lilly': [], 'hills': []}, 0)

I searched StackOverflow regarding the same issue and found one answer here but it is not working for me. Any sort of help will be highly appreciated.

Thanks

1 Answers1

0

Sorry this isn't exactly solving your problem, but I tried installing this module in a fresh env using pip, with usage per the examples in the documentation and got the same issue, both from Python and from terminal.

I headed over to the Git repo and it looks like it has broken for a number of people recently https://github.com/hardikvasa/google-images-download/issues/325

Someone mentioned there that this is fixed in patch-1 branch https://github.com/Joeclinton1/google-images-download

joel
  • 66
  • 5
  • Can you suggest any alternative to download images from google using Python –  Sep 19 '20 at 08:10
  • 1
    You can checkout the patch-1 branch above which seems to fix the issue: If you have git installed and use pip, then just run `pip install git+https://github.com/joeclinton1/google-images-download.git@patch-1` In the terminal. Otherwise follow the instructions per installing from CLI in the documentation, but use the URL above instead https://google-images-download.readthedocs.io/en/latest/installation.html (you'll need to uninstall the package first) – joel Sep 19 '20 at 09:06
  • will try and revert back soon –  Sep 19 '20 at 12:19