简体   繁体   English

使用 google_images_download 下载图片时出错

[英]Error in downloading images using google_images_download

I am trying to run the following code to download images using the google_images_download package `我正在尝试运行以下代码以使用google_images_download包下载图像

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.我在 StackOverflow 上搜索了同样的问题,并在这里找到了一个答案但它对我不起作用。 Any sort of help will be highly appreciated.任何形式的帮助将不胜感激。

Thanks谢谢

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.抱歉,这并不能完全解决您的问题,但我尝试使用 pip 在新的环境中安装此模块,按照文档中的示例进行使用,并从 Python 和终端都遇到了相同的问题。

I headed over to the Git repo and it looks like it has broken for a number of people recentlyhttps://github.com/hardikvasa/google-images-download/issues/325我前往 Git 存储库,最近似乎有很多人无法使用它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有人在那里提到这是在 patch-1 分支中修复的https://github.com/Joeclinton1/google-images-download

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM