如何仅从Google_images_download中获取图片网址而不是内容?

我正在尝试开发一个discord机器人,当我从discord收到一个特定的关键字时,我会使用google_images_download搜索它。然后,我想返回来自搜索结果的随机图像URL。

response = google_images_download.googleimagesdownload()
arguments = {"keywords":"yuzu figure skater","limit":10,"print_urls":True} #creating list of arguments
paths = response.download(arguments)   #passing the arguments to the function

但是,这样做会下载图像。但是我只想要与图像关联的URL。不是图像本身。

我不熟悉google_images_download。任何指针表示赞赏。

zxcvbn1234po 回答:如何仅从Google_images_download中获取图片网址而不是内容?

您需要在参数中添加"no_download": True。可能的参数的完整列表可以在here中找到:

arguments = {"keywords":"yuzu figure skater","limit":10,"print_urls":True,"no_download": True}
本文链接:https://www.f2er.com/3042819.html

大家都在问